Documentation
¶
Overview ¶
Package image contains utility functions for reading, writing and converting images.
Image types:
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Black = &Uniform{color.RGBA{0x00, 0x00, 0x00, 0xff}} Red = &Uniform{color.RGBA{0xff, 0x00, 0x00, 0xff}} Green = &Uniform{color.RGBA{0x00, 0xff, 0x00, 0xff}} Blue = &Uniform{color.RGBA{0x00, 0x00, 0xff, 0xff}} Yellow = &Uniform{color.RGBA{0xff, 0xff, 0x00, 0xff}} Magenta = &Uniform{color.RGBA{0xff, 0x00, 0xff, 0xff}} Cyan = &Uniform{color.RGBA{0x00, 0xff, 0xff, 0xff}} White = &Uniform{color.RGBA{0xff, 0xff, 0xff, 0xff}} DarkGray = &Uniform{color.RGBA{0x63, 0x66, 0x6a, 0xff}} MidGray = &Uniform{color.RGBA{0x7f, 0x7f, 0x7f, 0xff}} LightGray = &Uniform{color.RGBA{0xd9, 0xd9, 0xd6, 0xff}} Brown = &Uniform{color.RGBA{0xa4, 0x75, 0x51, 0xff}} Orange = &Uniform{color.RGBA{0xff, 0xa5, 0x00, 0xff}} Purple = &Uniform{color.RGBA{0x40, 0x00, 0x80, 0xff}} )
Predefined uniform color images for use with RenderShape.
var NewUniform func(color.Color) *Uniform = image.NewUniform
var Opaque = image.Opaque
var Transparent = image.Transparent
Functions ¶
Types ¶
type Alpha ¶
func GrayToAlpha ¶
GrayToAlpha does a shallow copy (vs going through the ColorModel).
func GrayToAlphaDeep ¶
GrayToAlphaDeep does a deep copy (vs going through the ColorModel).
type Alpha16 ¶
func Gray16ToAlpha16 ¶
Gray16ToAlpha16 does a shallow copy (vs going through the ColorModel).
func Gray16ToAlpha16Deep ¶
Gray16ToAlpha16Deep does a deep copy (vs going through the ColorModel).
type Colorizer ¶
Colorizer uses the gray or red channel of an image to create an image tinted with a lerp'd gradient between two or more colors.
func NewColorizer ¶
func NewColorizer(img Image, c1, c2 color.Color, stops []int, colors []color.Color, post bool) *Colorizer
NewColorizer creates a new Colorizer and creates the internal lut. c1 and c2 are the colors at the start and end of the colorizer. The stops (in range [1,254] and colors values determine any intermediate points and can be nil. The post flag turns off the lerping between colors and yields a posterized image.
func (*Colorizer) ColorModel ¶
ColorModel implements the ColorModel function in the Image interface.
type Gray ¶
func AlphaToGray ¶
AlphaToGray does a shallow copy (vs going through the ColorModel).
func AlphaToGrayDeep ¶
AlphaToGrayDeep does a deep copy (vs going through the ColorModel).
type Gray16 ¶
func Alpha16ToGray16 ¶
Alpha16ToGray16 does a shallow copy (vs going through the ColorModel).
func Alpha16ToGray16Deep ¶
Alpha16ToGray16Deep does a deep copy (vs going through the ColorModel).
type Patch ¶
Patch is an infinite image covered with a patch of colors.
func (*Patch) ColorModel ¶
ColorModel implements the ColorModel function in the Image interface.
type Tile ¶
Tile is an infinite image covered with a tile.
func (*Tile) ColorModel ¶
ColorModel implements the ColorModel function in the Image interface.