Documentation ¶
Overview ¶
Package images provides image formats useful for embedded programming that are unavailable in the standard image package.
Index ¶
- Constants
- Variables
- type AlphaN
- func (p *AlphaN) AlphaAt(x, y int) color.Alpha
- func (p *AlphaN) At(x, y int) color.Color
- func (p *AlphaN) Bounds() image.Rectangle
- func (p *AlphaN) ColorModel() color.Model
- func (p *AlphaN) PixOffset(x, y int) (offset int, shift uint)
- func (p *AlphaN) RGBA64At(x, y int) color.RGBA64
- func (p *AlphaN) Set(x, y int, c color.Color)
- func (p *AlphaN) SetAlpha(x, y int, c color.Alpha)
- func (p *AlphaN) SetRGBA64(x, y int, c color.RGBA64)
- func (p *AlphaN) SubImage(r image.Rectangle) image.Image
- type AlphaNModel
- type ImmAlphaN
- func (p *ImmAlphaN) AlphaAt(x, y int) color.Alpha
- func (p *ImmAlphaN) At(x, y int) color.Color
- func (p *ImmAlphaN) Bounds() image.Rectangle
- func (p *ImmAlphaN) ColorModel() color.Model
- func (p *ImmAlphaN) PixOffset(x, y int) (offset int, shift uint)
- func (p *ImmAlphaN) RGBA64At(x, y int) color.RGBA64
- func (p *ImmAlphaN) SubImage(r image.Rectangle) image.Image
- type ImmRGB
- func (p *ImmRGB) At(x, y int) color.Color
- func (p *ImmRGB) Bounds() image.Rectangle
- func (p *ImmRGB) ColorModel() color.Model
- func (p *ImmRGB) Opaque() bool
- func (p *ImmRGB) PixOffset(x, y int) int
- func (p *ImmRGB) RGBA64At(x, y int) color.RGBA64
- func (p *ImmRGB) RGBAAt(x, y int) color.RGBA
- func (p *ImmRGB) SubImage(r image.Rectangle) image.Image
- type ImmRGB16
- func (p *ImmRGB16) At(x, y int) color.Color
- func (p *ImmRGB16) Bounds() image.Rectangle
- func (p *ImmRGB16) ColorModel() color.Model
- func (p *ImmRGB16) Opaque() bool
- func (p *ImmRGB16) PixOffset(x, y int) int
- func (p *ImmRGB16) RGBAAt(x, y int) color.RGBA
- func (p *ImmRGB16) SubImage(r image.Rectangle) image.Image
- type Magnifier
- type Mirror
- type Mono
- func (p *Mono) At(x, y int) color.Color
- func (p *Mono) Bounds() image.Rectangle
- func (p *Mono) ColorModel() color.Model
- func (p *Mono) GrayAt(x, y int) color.Gray
- func (p *Mono) PixOffset(x, y int) (offset int, shift uint)
- func (p *Mono) RGBA64At(x, y int) color.RGBA64
- func (p *Mono) Set(x, y int, c color.Color)
- func (p *Mono) SetGray(x, y int, c color.Gray)
- func (p *Mono) SetRGBA64(x, y int, c color.RGBA64)
- type RGB
- func (p *RGB) At(x, y int) color.Color
- func (p *RGB) Bounds() image.Rectangle
- func (p *RGB) ColorModel() color.Model
- func (p *RGB) Opaque() bool
- func (p *RGB) PixOffset(x, y int) int
- func (p *RGB) RGBA64At(x, y int) color.RGBA64
- func (p *RGB) RGBAAt(x, y int) color.RGBA
- func (p *RGB) Set(x, y int, c color.Color)
- func (p *RGB) SetRGBA(x, y int, c color.RGBA)
- func (p *RGB) SetRGBA64(x, y int, c color.RGBA64)
- func (p *RGB) SubImage(r image.Rectangle) image.Image
- type RGB16
- func (p *RGB16) At(x, y int) color.Color
- func (p *RGB16) Bounds() image.Rectangle
- func (p *RGB16) ColorModel() color.Model
- func (p *RGB16) Opaque() bool
- func (p *RGB16) PixOffset(x, y int) int
- func (p *RGB16) RGBA64At(x, y int) color.RGBA64
- func (p *RGB16) RGBAAt(x, y int) color.RGBA
- func (p *RGB16) Set(x, y int, c color.Color)
- func (p *RGB16) SetRGBA(x, y int, c color.RGBA)
- func (p *RGB16) SetRGBA64(x, y int, c color.RGBA64)
- func (p *RGB16) SubImage(r image.Rectangle) image.Image
Constants ¶
const ( // Nearest means nearest-neighbor scaling. Use if the pixelated look of the // scaled image is acceptable or desirable. Nearest byte = iota // Bilinear means bilinear interpolation. Use if the pixelated look of the // Nearest is undesirable. Bilinear )
Scaling mode.
const ( MI = 0 // identity (no operation) MV = 1 << iota // swap X with Y MX // mirror X axis MY // mirror Y axis )
Variables ¶
var ( RGBModel = color.ModelFunc(rgbModel) RGB16Model = color.ModelFunc(rgb16Model) )
var MonoModel = color.ModelFunc(monoModel)
Functions ¶
This section is empty.
Types ¶
type AlphaN ¶
type AlphaN struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels LogN uint8 // 1<<LogN is the number of bits per pixel Shift uint8 // the bit offest in Pix[0] to the first pixel Pix []uint8 // the image pixels }
AlphaN is an in-memory image whose At method returns color.Alpha with 1, 2, 4 or 8 bit precision.
func NewAlphaN ¶
NewAlphaN returns a new AlphaN image with the given bounds and number of bits per pixel.
func (*AlphaN) ColorModel ¶
type AlphaNModel ¶
type AlphaNModel uint8
AlphaNModel is a color model for n-bit transparency
const ( Alpha1Model AlphaNModel = 1 // 2 levels of transparency Alpha2Model AlphaNModel = 2 // 4 levels of transparency Alpha4Model AlphaNModel = 4 // 16 levels of transparency Alpha8Model AlphaNModel = 8 // 256 levels of transparency )
type ImmAlphaN ¶
type ImmAlphaN struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels LogN uint8 // 1<<LogN is the number of bits per pixel Shift uint8 // the bit offest in Pix[0] to the first pixel Pix string // the image pixels }
ImmAlphaN is an immutable counterpart of AlphaN.
func NewImmAlphaN ¶
NewImmAlphaN returns a new ImmAlpha image with the given bounds and content.
func (*ImmAlphaN) ColorModel ¶
type ImmRGB ¶
type ImmRGB struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels Pix string // the image pixels }
ImmRGB is an immutable counterpart of RGB.
func (*ImmRGB) ColorModel ¶
type ImmRGB16 ¶
type ImmRGB16 struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels Pix string // the image pixels }
ImmRGB16 is an immutable counterpart of RGB16.
func NewImmRGB16 ¶
NewImmRGB16 returns a new ImmRGB16 image with the given bounds and content.
func (*ImmRGB16) ColorModel ¶
type Magnifier ¶
type Magnifier struct { Image image.Image Sx, Sy int // scaling factors along X and Y axes Mode byte // scaling mode: Nearest or Bilinear }
Magnifier can be used to wrap an image to scale it up at runtime by integer factor.
func Magnify ¶
Magnify wraps img into Magnifier to scale it up by scale factor usind given scaling mode.
func (*Magnifier) ColorModel ¶
ColorModel implements image.Image interface.
type Mirror ¶
Mirror can be used to wrap an image to reflect it through three different axes: (0, t) for MX, (t, 0) for MY and (t, t) for MV (parentheses contain parametric descriptions of axes).
func (*Mirror) ColorModel ¶
ColorModel implements image.Image interface.
type Mono ¶
type Mono struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels Shift uint // the bit offest in Pix[0] to the first pixel Pix []byte // the image pixels }
Mono is an in-memory image whose At method returns color.Gray with two possible values: 0 or 255.
func (*Mono) ColorModel ¶
type RGB ¶
type RGB struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels Pix []uint8 // the image pixels }
RGB is an in-memory image whose At method returns RGB values.
func (*RGB) ColorModel ¶
type RGB16 ¶
type RGB16 struct { Rect image.Rectangle // image bounds Stride int // stride (in bytes) between vertically adjacent pixels Pix []uint8 // the image pixels }
RGB16 is an in-memory image whose At method returns RGB16 values.