Documentation ¶
Index ¶
- type Cell
- type CellM
- type CellWorker
- type Collector
- type Line
- type RGBACollector
- type ScannerS
- func (s *ScannerS) Clear()
- func (s *ScannerS) Draw()
- func (s *ScannerS) GetPathExtent() fixed.Rectangle26_6
- func (s *ScannerS) Line(b fixed.Point26_6)
- func (s *ScannerS) SetBounds(height, width int)
- func (s *ScannerS) SetClip(rect image.Rectangle)
- func (s *ScannerS) SetColor(color interface{})
- func (s *ScannerS) SetWinding(useNonZeroWinding bool)
- func (s *ScannerS) Start(a fixed.Point26_6)
- type ScannerT
- func (s *ScannerT) Clear()
- func (s *ScannerT) Close()
- func (s *ScannerT) Draw()
- func (s *ScannerT) GetPathExtent() fixed.Rectangle26_6
- func (s *ScannerT) Line(b fixed.Point26_6)
- func (s *ScannerT) SetBounds(height, width int)
- func (s *ScannerT) SetClip(rect image.Rectangle)
- func (s *ScannerT) SetColor(color interface{})
- func (s *ScannerT) SetWinding(useNonZeroWinding bool)
- func (s *ScannerT) Start(a fixed.Point26_6)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Used as entries in the scanLinks linked list
type CellM ¶
type CellM struct { AreaOvCov int // contains filtered or unexported fields }
Used to message cells via the channels
type CellWorker ¶
type CellWorker struct {
// contains filtered or unexported fields
}
CellWorker listends to cellChan to store cell cover and area values into the scanLines linked list of cells
type Collector ¶
type Collector interface { Sweeper(lastX, scanLine, len int, cover int16) SetColor(clr interface{}) }
Collector translates the line seweep data to the target format. For example a 16 bit alpha only image would use a different collector than an RGBA image.
type RGBACollector ¶
RGBA collector implements the collector interface for image.RGBA images.
func (*RGBACollector) SetColor ¶
func (r *RGBACollector) SetColor(clr interface{})
SetColor accepts either a color.Color or a rastserx.ColorFunc
func (*RGBACollector) Sweeper ¶
func (r *RGBACollector) Sweeper(x, y, len int, alpha int16)
Sweeper sweeps the accumulated alpha value into the collector's RGBA image using Duff-Porter color composition equations. If the collector's ColorFunc is not nil it uses that otherwise it uses the collectors color. len is the number of steps in the y direction the sweep extends.
type ScannerS ¶
type ScannerS struct {
// contains filtered or unexported fields
}
ScannerS is a single threaded version of the cl-aa antialiasing algorithm. ScannerS implements the rasterx.Scanner interface, so it can be used with the rasterx and oksvg packages. There is considerable repeat code between ScannerS and ScannerT which, while not desirable, is done to optimize performance.
func NewScanS ¶
NewScanS returns a single-threaded implementation of the cl-aa antialiasing algorithm ScannerS implements the rasterx.Scannner interface for use with the rasterx and oksvg packages. An object implementing the Collector interface must be provided, which will convert x,y, and alpha values to the target format such as an image.RGBA. A collector for image.RGBA, RGBACollector, is defined in this package.
func (*ScannerS) Clear ¶
func (s *ScannerS) Clear()
Clear reinitializes the cell linked lists and the path extents to make it ready for new paths
func (*ScannerS) Draw ¶
func (s *ScannerS) Draw()
Draw finishes the path if it is open and then sweeps the accumulated area and cover cell values to the collector
func (*ScannerS) GetPathExtent ¶
func (s *ScannerS) GetPathExtent() fixed.Rectangle26_6
GetPathExtent returns the bounaries of the current path
func (*ScannerS) SetBounds ¶
SetBounds set the boundaries in which the scanner is allowed to draw. Negative values are excluded
func (*ScannerS) SetColor ¶
func (s *ScannerS) SetColor(color interface{})
SetColor sends either a rasterx.ColorFunc or color.Color value to the collector
func (*ScannerS) SetWinding ¶
SetWinding does nothing for now
type ScannerT ¶
type ScannerT struct {
// contains filtered or unexported fields
}
ScannerT is a multi-threaded version of the cl-aa antialiasing algorithm. ScannerT implements the rasterx.Scanner interface, so it can be used with the rasterx and oksvg packages.
func NewScanT ¶
NewScanT returns a multi-threaded implementation of the cl-aa antialiasing algorithm ScannerT implements the rasterx.Scannner interface for use with the rasterx and oksvg packages. An object implementing the Collector interface must be provided, which will convert x,y, and alpha values to the target format such as an image.RGBA. A collector for image.RGBA, RGBACollector, is defined in this package.
func (*ScannerT) Clear ¶
func (s *ScannerT) Clear()
Clear reinitializes the cell linked lists and the path extents to make it ready for new paths
func (*ScannerT) Close ¶
func (s *ScannerT) Close()
Close shuts down the channels associated with the ScannerT
func (*ScannerT) Draw ¶
func (s *ScannerT) Draw()
Draw finishes the path if it is open and then sweeps the accumulated area and cover cell values to the collector
func (*ScannerT) GetPathExtent ¶
func (s *ScannerT) GetPathExtent() fixed.Rectangle26_6
GetPathExtent returns the bounaries of the current path
func (*ScannerT) SetBounds ¶
SetBounds set the boundaries in which the scanner is allowed to draw. Negative values are excluded
func (*ScannerT) SetColor ¶
func (s *ScannerT) SetColor(color interface{})
SetColor sends either a rasterx.ColorFunc or color.Color value to the collector
func (*ScannerT) SetWinding ¶
SetWinding does nothing for now