Documentation ¶
Overview ¶
Package limage introduces structures to read and build layered images
Index ¶
- type Composite
- type GrayAlpha
- func (g *GrayAlpha) At(x, y int) color.Color
- func (g *GrayAlpha) Bounds() image.Rectangle
- func (g *GrayAlpha) ColorModel() color.Model
- func (g *GrayAlpha) GrayAlphaAt(x, y int) lcolor.GrayAlpha
- func (g *GrayAlpha) Opaque() bool
- func (g *GrayAlpha) PixOffset(x, y int) int
- func (g *GrayAlpha) Set(x, y int, c color.Color)
- func (g *GrayAlpha) SetGrayAlpha(x, y int, ga lcolor.GrayAlpha)
- func (g *GrayAlpha) SubImage(r image.Rectangle) image.Image
- type Image
- type Layer
- type MaskedImage
- type PalettedAlpha
- func (p *PalettedAlpha) At(x, y int) color.Color
- func (p *PalettedAlpha) Bounds() image.Rectangle
- func (p *PalettedAlpha) ColorModel() color.Model
- func (p *PalettedAlpha) IndexAlphaAt(x, y int) lcolor.IndexedAlpha
- func (p *PalettedAlpha) Opaque() bool
- func (p *PalettedAlpha) PixOffset(x, y int) int
- func (p *PalettedAlpha) Set(x, y int, c color.Color)
- func (p *PalettedAlpha) SetIndexAlpha(x, y int, ia lcolor.IndexedAlpha)
- func (p *PalettedAlpha) SubImage(r image.Rectangle) image.Image
- type RGB
- func (r *RGB) At(x, y int) color.Color
- func (r *RGB) Bounds() image.Rectangle
- func (r *RGB) ColorModel() color.Model
- func (r *RGB) Opaque() bool
- func (r *RGB) PixOffset(x, y int) int
- func (r *RGB) RGBAt(x, y int) lcolor.RGB
- func (r *RGB) Set(x, y int, c color.Color)
- func (r *RGB) SetRGB(x, y int, rgb lcolor.RGB)
- func (r *RGB) SubImage(rt image.Rectangle) image.Image
- type Text
- type TextData
- type TextDatum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Composite ¶
type Composite uint32
Composite determines how two layers are composed together
const ( CompositeNormal Composite = iota CompositeDissolve CompositeBehind CompositeMultiply CompositeScreen CompositeOverlay CompositeDifference CompositeAddition CompositeSubtract CompositeDarkenOnly CompositeLightenOnly CompositeHue CompositeSaturation CompositeColor CompositeValue CompositeDivide CompositeDodge CompositeBurn CompositeHardLight CompositeSoftLight CompositeGrainExtract CompositeGrainMerge CompositeLuminosity CompositePlus CompositeDestinationIn CompositeDestinationOut CompositeSourceAtop CompositeDestinationAtop CompositeColorErase CompositeChroma CompositeLightness CompositeVividLight CompositePinLight CompositeLinearLight CompositeHardMix CompositeExclusion CompositeLinearBurn CompositeLuminance CompositeErase CompositeMerge CompositeSplit CompositePassThrough )
Composite constants
type GrayAlpha ¶
GrayAlpha is an image of GrayAlpha pixels
func NewGrayAlpha ¶
NewGrayAlpha create a new GrayAlpha image with the given bounds
func (*GrayAlpha) ColorModel ¶
ColorModel returns a color model to transform arbitrary colours into a GrayAlpha color
func (*GrayAlpha) GrayAlphaAt ¶
GrayAlphaAt returns a GrayAlpha colr for the specified coords
func (*GrayAlpha) PixOffset ¶
PixOffset returns the index of the element of Pix corresponding to the given coords
func (*GrayAlpha) Set ¶
Set converts the given colour to a GrayAlpha colour and sets it at the given coords
func (*GrayAlpha) SetGrayAlpha ¶
SetGrayAlpha sets the colour at the given coords
type Image ¶
type Image []Layer
Image represents a collection of layers
func (Image) ColorModel ¶
ColorModel represents the color model of the group. It uses the first layer to determine the color model
type Layer ¶
type Layer struct { Name string LayerBounds image.Rectangle // Bounds within the layer group Mode Composite Invisible bool Transparency uint8 image.Image }
Layer represents a single layer of a multilayered image
type MaskedImage ¶
MaskedImage represents an image that has a to-be-applied mask
type PalettedAlpha ¶
type PalettedAlpha struct { Pix []lcolor.IndexedAlpha Stride int Rect image.Rectangle Palette lcolor.AlphaPalette }
PalettedAlpha represents a paletted image with an alpha channel
func NewPalettedAlpha ¶
func NewPalettedAlpha(r image.Rectangle, p lcolor.AlphaPalette) *PalettedAlpha
NewPalettedAlpha creates a new image that uses a palette with an alpha channel
func (*PalettedAlpha) At ¶
func (p *PalettedAlpha) At(x, y int) color.Color
At returns the color of the pixel at the given coords
func (*PalettedAlpha) Bounds ¶
func (p *PalettedAlpha) Bounds() image.Rectangle
Bounds returns the limits of the image
func (*PalettedAlpha) ColorModel ¶
func (p *PalettedAlpha) ColorModel() color.Model
ColorModel a color model to tranform arbitrary colors to one in the palette
func (*PalettedAlpha) IndexAlphaAt ¶
func (p *PalettedAlpha) IndexAlphaAt(x, y int) lcolor.IndexedAlpha
IndexAlphaAt returns the palette index and Alpha component of the given coords
func (*PalettedAlpha) Opaque ¶
func (p *PalettedAlpha) Opaque() bool
Opaque returns true if the image is completely opaque
func (*PalettedAlpha) PixOffset ¶
func (p *PalettedAlpha) PixOffset(x, y int) int
PixOffset returns the index of the Pix array corresponding to the given coords
func (*PalettedAlpha) Set ¶
func (p *PalettedAlpha) Set(x, y int, c color.Color)
Set converts the given colour to the closest in the palette and sets it at the given coords
func (*PalettedAlpha) SetIndexAlpha ¶
func (p *PalettedAlpha) SetIndexAlpha(x, y int, ia lcolor.IndexedAlpha)
SetIndexAlpha directly set the index and alpha channels to the given coords
type RGB ¶
RGB is an image of RGB colours
func (*RGB) ColorModel ¶
ColorModel returns a colour model that converts arbitrary colours to the RGB space
func (*RGB) PixOffset ¶
PixOffset returns the index of the Pix array correspinding to the given coords