Documentation ¶
Index ¶
- type AlphaOverPainter
- type AlphaSrcPainter
- type ClipRectPainter
- type GammaCorrectionPainter
- type MonochromePainter
- type Painter
- type PainterFunc
- type RGBAColFuncPainter
- type RGBAPainter
- type ScannerFT
- func (s *ScannerFT) Clear()
- func (s *ScannerFT) Draw()
- func (s *ScannerFT) GetPathExtent() fixed.Rectangle26_6
- func (s *ScannerFT) Line(b fixed.Point26_6)
- func (s *ScannerFT) SetBounds(width, height int)
- func (s *ScannerFT) SetClip(rect image.Rectangle)
- func (s *ScannerFT) SetColor(clr interface{})
- func (s *ScannerFT) SetWinding(useNonZeroWinding bool)
- func (s *ScannerFT) Start(a fixed.Point26_6)
- type Span
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlphaOverPainter ¶
An AlphaOverPainter is a Painter that paints Spans onto a *image.Alpha using the Over Porter-Duff composition operator.
func NewAlphaOverPainter ¶
func NewAlphaOverPainter(m *image.Alpha) AlphaOverPainter
NewAlphaOverPainter creates a new AlphaOverPainter for the given image.
type AlphaSrcPainter ¶
An AlphaSrcPainter is a Painter that paints Spans onto a *image.Alpha using the Src Porter-Duff composition operator.
func NewAlphaSrcPainter ¶
func NewAlphaSrcPainter(m *image.Alpha) AlphaSrcPainter
NewAlphaSrcPainter creates a new AlphaSrcPainter for the given image.
type ClipRectPainter ¶
type ClipRectPainter struct { // Painter is the wrapped Painter. Painter Painter // a is the precomputed alpha values for linear interpolation, with fully // opaque == 0xffff. ClipRect image.Rectangle }
A ClipRectPainter wraps another Painter, but restricts painting to within the ClipRect
type GammaCorrectionPainter ¶
type GammaCorrectionPainter struct { // Painter is the wrapped Painter. Painter Painter // contains filtered or unexported fields }
A GammaCorrectionPainter wraps another Painter, performing gamma-correction on each Span's alpha value.
func NewGammaCorrectionPainter ¶
func NewGammaCorrectionPainter(p Painter, gamma float64) *GammaCorrectionPainter
NewGammaCorrectionPainter creates a new GammaCorrectionPainter that wraps the given Painter.
func (*GammaCorrectionPainter) Paint ¶
func (g *GammaCorrectionPainter) Paint(ss []Span, done bool, clip image.Rectangle)
Paint delegates to the wrapped Painter after performing gamma-correction on each Span.
func (*GammaCorrectionPainter) SetGamma ¶
func (g *GammaCorrectionPainter) SetGamma(gamma float64)
SetGamma sets the gamma value.
type MonochromePainter ¶
type MonochromePainter struct { Painter Painter // contains filtered or unexported fields }
A MonochromePainter wraps another Painter, quantizing each Span's alpha to be either fully opaque or fully transparent.
func NewMonochromePainter ¶
func NewMonochromePainter(p Painter) *MonochromePainter
NewMonochromePainter creates a new MonochromePainter that wraps the given Painter.
type Painter ¶
A Painter knows how to paint a batch of Spans. Rasterization may involve Painting multiple batches, and done will be true for the final batch. The Spans' Y values are monotonically increasing during a rasterization. Paint may use all of ss as scratch space during the call.
type PainterFunc ¶
The PainterFunc type adapts an ordinary function to the Painter interface.
type RGBAColFuncPainter ¶
type RGBAColFuncPainter struct { RGBAPainter // contains filtered or unexported fields }
RGBAColFuncPainter is a Painter that paints Spans onto a *image.RGBA, and uses a color function as a the color source, or the composed RGBA paint func for a solid color
type RGBAPainter ¶
type RGBAPainter struct { // Image is the image to compose onto. Image *image.RGBA // Op is the Porter-Duff composition operator. Op draw.Op // contains filtered or unexported fields }
An RGBAPainter is a Painter that paints Spans onto a *image.RGBA.
func NewRGBAPainter ¶
func NewRGBAPainter(m *image.RGBA) *RGBAPainter
NewRGBAPainter creates a new RGBAPainter for the given image.
func (*RGBAPainter) Paint ¶
func (r *RGBAPainter) Paint(ss []Span, done bool, clip image.Rectangle)
Paint satisfies the Painter interface.
func (*RGBAPainter) SetColor ¶
func (r *RGBAPainter) SetColor(c color.Color)
SetColor sets the color to paint the spans.
type ScannerFT ¶
type ScannerFT struct { // If false, the behavior is to use the even-odd winding fill // rule during Rasterize. UseNonZeroWinding bool // An offset (in pixels) to the painted spans. Dx, Dy int Pntr *RGBAColFuncPainter // contains filtered or unexported fields }
Rasterizer converts a path to a raster using the grainless algorithm.
func NewScannerFT ¶
func NewScannerFT(width, height int, p *RGBAPainter) *ScannerFT
NewScanner creates a new Scanner with the given bounds.
func (*ScannerFT) Draw ¶
func (s *ScannerFT) Draw()
Draw converts r's accumulated curves into Spans for p. The Spans passed to the painter 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.
func (*ScannerFT) GetPathExtent ¶
func (s *ScannerFT) GetPathExtent() fixed.Rectangle26_6
func (*ScannerFT) SetBounds ¶
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.
func (*ScannerFT) SetClip ¶
SetClip sets an optional clipping rectangle to restrict rendering only to that region -- if size is 0 then ignored (set to image.ZR to clear)