Involved Source Filesgeom.gopaint.go Package raster provides an anti-aliasing 2-D rasterizer.
It is part of the larger Freetype suite of font-related packages, but the
raster package is not specific to font rasterization, and can be used
standalone without any other Freetype package.
Rasterization is done by the same area/coverage accumulation algorithm as
the Freetype "smooth" module, and the Anti-Grain Geometry library. A
description of the area/coverage algorithm is at
http://projects.tuxee.net/cl-vectors/section-the-cl-aa-algorithmstroke.go
An AlphaOverPainter is a Painter that paints Spans onto a *image.Alpha using
the Over Porter-Duff composition operator.Image*image.Alpha Paint satisfies the Painter interface.
AlphaOverPainter : Painter
func NewAlphaOverPainter(m *image.Alpha) AlphaOverPainter
An AlphaSrcPainter is a Painter that paints Spans onto a *image.Alpha using
the Src Porter-Duff composition operator.Image*image.Alpha Paint satisfies the Painter interface.
AlphaSrcPainter : Painter
func NewAlphaSrcPainter(m *image.Alpha) AlphaSrcPainter
The CapperFunc type adapts an ordinary function to be a Capper.( CapperFunc) Cap(p Adder, halfWidth fixed.Int26_6, pivot, n1 fixed.Point26_6)
CapperFunc : Capper
A GammaCorrectionPainter wraps another Painter, performing gamma-correction
on each Span's alpha value. Painter is the wrapped Painter. Paint delegates to the wrapped Painter after performing gamma-correction on
each Span. SetGamma sets the gamma value.
*GammaCorrectionPainter : Painter
func NewGammaCorrectionPainter(p Painter, gamma float64) *GammaCorrectionPainter
The JoinerFunc type adapts an ordinary function to be a Joiner.( JoinerFunc) Join(lhs, rhs Adder, halfWidth fixed.Int26_6, pivot, n0, n1 fixed.Point26_6)
JoinerFunc : Joiner
A MonochromePainter wraps another Painter, quantizing each Span's alpha to
be either fully opaque or fully transparent.PainterPainter Paint delegates to the wrapped Painter after quantizing each Span's alpha
value and merging adjacent fully opaque Spans.
*MonochromePainter : Painter
func NewMonochromePainter(p Painter) *MonochromePainter
The PainterFunc type adapts an ordinary function to the Painter interface. Paint just delegates the call to f.
PainterFunc : Painter
A Path is a sequence of curves, and a curve is a start point followed by a
sequence of linear, quadratic or cubic segments. Add1 adds a linear segment to the current curve. Add2 adds a quadratic segment to the current curve. Add3 adds a cubic segment to the current curve. AddPath adds the Path q to p. AddStroke adds a stroked Path. Clear cancels any previous calls to p.Start or p.AddXxx. Start starts a new curve at the given point. String returns a human-readable representation of a Path.
*Path : Adder
Path : expvar.Var
Path : fmt.Stringer
func Stroke(p Adder, q Path, width fixed.Int26_6, cr Capper, jr Joiner)
func (*Path).AddPath(q Path)
func (*Path).AddStroke(q Path, width fixed.Int26_6, cr Capper, jr Joiner)
func (*Rasterizer).AddPath(p Path)
func (*Rasterizer).AddStroke(q Path, width fixed.Int26_6, cr Capper, jr Joiner)
An offset (in pixels) to the painted spans. An offset (in pixels) to the painted spans. If false, the default behavior is to use the even-odd winding fill
rule during Rasterize. Add1 adds a linear segment to the current curve. Add2 adds a quadratic segment to the current curve. Add3 adds a cubic segment to the current curve. AddPath adds the given Path. AddStroke adds a stroked Path. Clear cancels any previous calls to r.Start or r.AddXxx. Rasterize converts r's accumulated curves into Spans for p. The Spans passed
to p are non-overlapping, and sorted by Y and then X. They all have non-zero
width (and 0 <= X0 < X1 <= r.width) and non-zero A, except for the final
Span, which has Y, X0, X1 and A all equal to zero. SetBounds sets the maximum width and height of the rasterized image and
calls Clear. The width and height are in pixels, not fixed.Int26_6 units. Start starts a new curve at the given point.
*Rasterizer : Adder
func NewRasterizer(width, height int) *Rasterizer
An RGBAPainter is a Painter that paints Spans onto a *image.RGBA. Image is the image to compose onto. Op is the Porter-Duff composition operator. Paint satisfies the Painter interface. SetColor sets the color to paint the spans.
*RGBAPainter : Painter
func NewRGBAPainter(m *image.RGBA) *RGBAPainter
NewAlphaOverPainter creates a new AlphaOverPainter for the given image.
NewAlphaSrcPainter creates a new AlphaSrcPainter for the given image.
NewGammaCorrectionPainter creates a new GammaCorrectionPainter that wraps
the given Painter.
NewMonochromePainter creates a new MonochromePainter that wraps the given
Painter.
NewRasterizer creates a new Rasterizer with the given bounds.
NewRGBAPainter creates a new RGBAPainter for the given image.
Stroke adds q stroked with the given width to p. The result is typically
self-intersecting and should be rasterized with UseNonZeroWinding.
cr and jr may be nil, which defaults to a RoundCapper or RoundJoiner.
Package-Level Variables (total 5)
BevelJoiner adds bevel joins to a stroked path.
ButtCapper adds butt caps to a stroked path.
RoundCapper adds round caps to a stroked path.
RoundJoiner adds round joins to a stroked path.
SquareCapper adds square caps to a stroked path.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.