internal

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Div255

func Div255(x uint32) uint32

Div255 performs a division by 255. Approximates: (x / 255).

func Md255

func Md255(a, b uint32) uint32

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

func Sqrt(x uint32) uint32

Sqrt performs a square root. Parameter x must be less than 256 due to using a lookup table. Approximates: sqrt(x).

func Unpremultiply

func Unpremultiply(color, alpha uint32) uint32

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 (c *Config) DefaultColorModel() color.Model

func (*Config) DefaultOutputMode

func (c *Config) DefaultOutputMode() core.DefaultOutputMode

func (*Config) PixelIterator

func (c *Config) PixelIterator() core.PixelIterator

func (*Config) SetDefaultColorModel

func (c *Config) SetDefaultColorModel(model color.Model) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL