Documentation
¶
Index ¶
- func Div255(x uint32) uint32
- func Md255(a, b uint32) uint32
- func Sqrt(x uint32) uint32
- func Unpremultiply(color, alpha uint32) uint32
- type BlendCompositing
- type Config
- func (c *Config) DefaultColorModel() color.Model
- func (c *Config) DefaultOutputMode() core.DefaultOutputMode
- func (c *Config) PixelIterator() core.PixelIterator
- func (c *Config) SetDefaultColorModel(model color.Model) error
- func (c *Config) SetDefaultOutputMode(defaultOutput core.DefaultOutputMode)
- func (c *Config) SetPixelIterator(pixIter core.PixelIterator)
- type Op
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Md255 ¶
Md255 performs a multiplication then division by 255. Parameters a and b must be less than 256 due to using a lookup table. Approximates: (a * b / 255).
func Sqrt ¶
Sqrt performs a square root. Parameter x must be less than 256 due to using a lookup table. Approximates: sqrt(x).
func Unpremultiply ¶
Unpremultiply performs an RGBA unpremultiplication. Color and alpha must be less than 256 due to using a lookup table. Approximates: (color / alpha).
Types ¶
type BlendCompositing ¶
type BlendCompositing int
BlendCompositing defines the blending mode for composite operations. Exposed for public use in the op package.
const ( CompositeBlendOnly BlendCompositing = 1 CompositeBlendAndDst BlendCompositing = 2 CompositeBlendAndSrc BlendCompositing = 4 CompositeAll BlendCompositing = 6 // CompositeBlendAndDst | CompositeBlendAndSrc )
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
var DefaultConfig *Config
DefaultConfig is the configuration used by top-level functions.
func NewConfig ¶
func NewConfig(pixIter core.PixelIterator, defaultOutputMode core.DefaultOutputMode, defaultColorModel color.Model) *Config
func (*Config) DefaultColorModel ¶
func (*Config) DefaultOutputMode ¶
func (c *Config) DefaultOutputMode() core.DefaultOutputMode
func (*Config) PixelIterator ¶
func (c *Config) PixelIterator() core.PixelIterator
func (*Config) SetDefaultColorModel ¶
func (*Config) SetDefaultOutputMode ¶
func (c *Config) SetDefaultOutputMode(defaultOutput core.DefaultOutputMode)
func (*Config) SetPixelIterator ¶
func (c *Config) SetPixelIterator(pixIter core.PixelIterator)
type Op ¶
type Op interface {
IsValid() bool
ApplyNRGBA(pixIter core.PixelIterator, calc core.PixCalculator[*image.NRGBA]) *image.NRGBA
ApplyRGBA(pixIter core.PixelIterator, calc core.PixCalculator[*image.RGBA]) *image.RGBA
}
Op defines a drawing operation.
Click to show internal directories.
Click to hide internal directories.