package image

Import Path
	image (on golang.org and go.dev)

Dependency Relation
	imports 8 packages, and imported by 5 packages

Involved Source Files
	    format.go
	    geom.go
	d-> image.go
	    names.go
	    ycbcr.go

Exported Type Names

type Alpha (struct) Alpha is an in-memory image whose At method returns color.Alpha values. Pix []uint8 Rect Rectangle Stride int (*T) AlphaAt(x, y int) color.Alpha (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetAlpha(x, y int, c color.Alpha) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewAlpha(r Rectangle) *Alpha
type Alpha16 (struct) Alpha16 is an in-memory image whose At method returns color.Alpha16 values. Pix []uint8 Rect Rectangle Stride int (*T) Alpha16At(x, y int) color.Alpha16 (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetAlpha16(x, y int, c color.Alpha16) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewAlpha16(r Rectangle) *Alpha16
type CMYK (struct) CMYK is an in-memory image whose At method returns color.CMYK values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) CMYKAt(x, y int) color.CMYK (*T) ColorModel() color.Model (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetCMYK(x, y int, c color.CMYK) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewCMYK(r Rectangle) *CMYK
type Config (struct) Config holds an image's color model and dimensions. ColorModel color.Model Height int Width int func DecodeConfig(r io.Reader) (Config, string, error) func image/gif.DecodeConfig(r io.Reader) (Config, error) func image/jpeg.DecodeConfig(r io.Reader) (Config, error) func image/png.DecodeConfig(r io.Reader) (Config, error)
type Gray (struct) Gray is an in-memory image whose At method returns color.Gray values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) GrayAt(x, y int) color.Gray (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetGray(x, y int, c color.Gray) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewGray(r Rectangle) *Gray
type Gray16 (struct) Gray16 is an in-memory image whose At method returns color.Gray16 values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Gray16At(x, y int) color.Gray16 (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetGray16(x, y int, c color.Gray16) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewGray16(r Rectangle) *Gray16
type Image (interface) Image is a finite rectangular grid of color.Color values taken from a color model. (T) At(x, y int) color.Color (T) Bounds() Rectangle (T) ColorModel() color.Model *Alpha *Alpha16 *CMYK *Gray *Gray16 *NRGBA *NRGBA64 *NYCbCrA *Paletted PalettedImage (interface) Rectangle *RGBA *RGBA64 *Uniform *YCbCr image/draw.Image (interface) func Decode(r io.Reader) (Image, string, error) func (*Alpha).SubImage(r Rectangle) Image func (*Alpha16).SubImage(r Rectangle) Image func (*CMYK).SubImage(r Rectangle) Image func (*Gray).SubImage(r Rectangle) Image func (*Gray16).SubImage(r Rectangle) Image func (*NRGBA).SubImage(r Rectangle) Image func (*NRGBA64).SubImage(r Rectangle) Image func (*NYCbCrA).SubImage(r Rectangle) Image func (*Paletted).SubImage(r Rectangle) Image func (*RGBA).SubImage(r Rectangle) Image func (*RGBA64).SubImage(r Rectangle) Image func (*YCbCr).SubImage(r Rectangle) Image func image/gif.Decode(r io.Reader) (Image, error) func image/jpeg.Decode(r io.Reader) (Image, error) func image/png.Decode(r io.Reader) (Image, error) func image/draw.Draw(dst draw.Image, r Rectangle, src Image, sp Point, op draw.Op) func image/draw.DrawMask(dst draw.Image, r Rectangle, src Image, sp Point, mask Image, mp Point, op draw.Op) func image/draw.DrawMask(dst draw.Image, r Rectangle, src Image, sp Point, mask Image, mp Point, op draw.Op) func image/draw.Drawer.Draw(dst draw.Image, r Rectangle, src Image, sp Point) func image/draw.Op.Draw(dst draw.Image, r Rectangle, src Image, sp Point) func image/draw.Quantizer.Quantize(p color.Palette, m Image) color.Palette func image/gif.Encode(w io.Writer, m Image, o *gif.Options) error func image/jpeg.Encode(w io.Writer, m Image, o *jpeg.Options) error func image/png.Encode(w io.Writer, m Image) error func image/png.(*Encoder).Encode(w io.Writer, m Image) error
type NRGBA (struct) NRGBA is an in-memory image whose At method returns color.NRGBA values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) NRGBAAt(x, y int) color.NRGBA (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetNRGBA(x, y int, c color.NRGBA) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewNRGBA(r Rectangle) *NRGBA
type NRGBA64 (struct) NRGBA64 is an in-memory image whose At method returns color.NRGBA64 values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) NRGBA64At(x, y int) color.NRGBA64 (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetNRGBA64(x, y int, c color.NRGBA64) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewNRGBA64(r Rectangle) *NRGBA64
type NYCbCrA (struct) NYCbCrA is an in-memory image of non-alpha-premultiplied Y'CbCr-with-alpha colors. A and AStride are analogous to the Y and YStride fields of the embedded YCbCr. A []uint8 AStride int YCbCr YCbCr YCbCr.CStride int YCbCr.Cb []uint8 YCbCr.Cr []uint8 YCbCr.Rect Rectangle YCbCr.SubsampleRatio YCbCrSubsampleRatio YCbCr.Y []uint8 YCbCr.YStride int (*T) AOffset(x, y int) int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) COffset(x, y int) int (*T) ColorModel() color.Model (*T) NYCbCrAAt(x, y int) color.NYCbCrA (*T) Opaque() bool (*T) SubImage(r Rectangle) Image (*T) YCbCrAt(x, y int) color.YCbCr (*T) YOffset(x, y int) int *T : Image func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA
type Paletted (struct) Paletted is an in-memory image of uint8 indices into a given palette. Palette color.Palette Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorIndexAt(x, y int) uint8 (*T) ColorModel() color.Model (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) Set(x, y int, c color.Color) (*T) SetColorIndex(x, y int, index uint8) (*T) SubImage(r Rectangle) Image *T : Image *T : PalettedImage *T : image/draw.Image func NewPaletted(r Rectangle, p color.Palette) *Paletted
type PalettedImage (interface) PalettedImage is an image whose colors may come from a limited palette. If m is a PalettedImage and m.ColorModel() returns a color.Palette p, then m.At(x, y) should be equivalent to p[m.ColorIndexAt(x, y)]. If m's color model is not a color.Palette, then ColorIndexAt's behavior is undefined. (T) At(x, y int) color.Color (T) Bounds() Rectangle (T) ColorIndexAt(x, y int) uint8 (T) ColorModel() color.Model *Paletted T : Image
type Point (struct) A Point is an X, Y coordinate pair. The axes increase right and down. X int Y int (T) Add(q Point) Point (T) Div(k int) Point (T) Eq(q Point) bool (T) In(r Rectangle) bool (T) Mod(r Rectangle) Point (T) Mul(k int) Point (T) String() string (T) Sub(q Point) Point T : expvar.Var T : fmt.Stringer func Pt(X, Y int) Point func Point.Add(q Point) Point func Point.Div(k int) Point func Point.Mod(r Rectangle) Point func Point.Mul(k int) Point func Point.Sub(q Point) Point func Rectangle.Size() Point func Point.Add(q Point) Point func Point.Eq(q Point) bool func Point.Sub(q Point) Point func Rectangle.Add(p Point) Rectangle func Rectangle.Sub(p Point) Rectangle func image/draw.Draw(dst draw.Image, r Rectangle, src Image, sp Point, op draw.Op) func image/draw.DrawMask(dst draw.Image, r Rectangle, src Image, sp Point, mask Image, mp Point, op draw.Op) func image/draw.DrawMask(dst draw.Image, r Rectangle, src Image, sp Point, mask Image, mp Point, op draw.Op) func image/draw.Drawer.Draw(dst draw.Image, r Rectangle, src Image, sp Point) func image/draw.Op.Draw(dst draw.Image, r Rectangle, src Image, sp Point) func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool) var ZP
type Rectangle (struct) A Rectangle contains the points with Min.X <= X < Max.X, Min.Y <= Y < Max.Y. It is well-formed if Min.X <= Max.X and likewise for Y. Points are always well-formed. A rectangle's methods always return well-formed outputs for well-formed inputs. A Rectangle is also an Image whose bounds are the rectangle itself. At returns color.Opaque for points in the rectangle and color.Transparent otherwise. Max Point Min Point (T) Add(p Point) Rectangle (T) At(x, y int) color.Color (T) Bounds() Rectangle (T) Canon() Rectangle (T) ColorModel() color.Model (T) Dx() int (T) Dy() int (T) Empty() bool (T) Eq(s Rectangle) bool (T) In(s Rectangle) bool (T) Inset(n int) Rectangle (T) Intersect(s Rectangle) Rectangle (T) Overlaps(s Rectangle) bool (T) Size() Point (T) String() string (T) Sub(p Point) Rectangle (T) Union(s Rectangle) Rectangle T : Image T : expvar.Var T : fmt.Stringer func Rect(x0, y0, x1, y1 int) Rectangle func (*Alpha).Bounds() Rectangle func (*Alpha16).Bounds() Rectangle func (*CMYK).Bounds() Rectangle func (*Gray).Bounds() Rectangle func (*Gray16).Bounds() Rectangle func Image.Bounds() Rectangle func (*NRGBA).Bounds() Rectangle func (*NRGBA64).Bounds() Rectangle func (*Paletted).Bounds() Rectangle func PalettedImage.Bounds() Rectangle func Rectangle.Add(p Point) Rectangle func Rectangle.Bounds() Rectangle func Rectangle.Canon() Rectangle func Rectangle.Inset(n int) Rectangle func Rectangle.Intersect(s Rectangle) Rectangle func Rectangle.Sub(p Point) Rectangle func Rectangle.Union(s Rectangle) Rectangle func (*RGBA).Bounds() Rectangle func (*RGBA64).Bounds() Rectangle func (*Uniform).Bounds() Rectangle func (*YCbCr).Bounds() Rectangle func image/draw.Image.Bounds() Rectangle func NewAlpha(r Rectangle) *Alpha func NewAlpha16(r Rectangle) *Alpha16 func NewCMYK(r Rectangle) *CMYK func NewGray(r Rectangle) *Gray func NewGray16(r Rectangle) *Gray16 func NewNRGBA(r Rectangle) *NRGBA func NewNRGBA64(r Rectangle) *NRGBA64 func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA func NewPaletted(r Rectangle, p color.Palette) *Paletted func NewRGBA(r Rectangle) *RGBA func NewRGBA64(r Rectangle) *RGBA64 func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr func (*Alpha).SubImage(r Rectangle) Image func (*Alpha16).SubImage(r Rectangle) Image func (*CMYK).SubImage(r Rectangle) Image func (*Gray).SubImage(r Rectangle) Image func (*Gray16).SubImage(r Rectangle) Image func (*NRGBA).SubImage(r Rectangle) Image func (*NRGBA64).SubImage(r Rectangle) Image func (*NYCbCrA).SubImage(r Rectangle) Image func (*Paletted).SubImage(r Rectangle) Image func Point.In(r Rectangle) bool func Point.Mod(r Rectangle) Point func Rectangle.Eq(s Rectangle) bool func Rectangle.In(s Rectangle) bool func Rectangle.Intersect(s Rectangle) Rectangle func Rectangle.Overlaps(s Rectangle) bool func Rectangle.Union(s Rectangle) Rectangle func (*RGBA).SubImage(r Rectangle) Image func (*RGBA64).SubImage(r Rectangle) Image func (*YCbCr).SubImage(r Rectangle) Image func image/draw.Draw(dst draw.Image, r Rectangle, src Image, sp Point, op draw.Op) func image/draw.DrawMask(dst draw.Image, r Rectangle, src Image, sp Point, mask Image, mp Point, op draw.Op) func image/draw.Drawer.Draw(dst draw.Image, r Rectangle, src Image, sp Point) func image/draw.Op.Draw(dst draw.Image, r Rectangle, src Image, sp Point) func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool) var ZR
type RGBA (struct) RGBA is an in-memory image whose At method returns color.RGBA values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) RGBAAt(x, y int) color.RGBA (*T) Set(x, y int, c color.Color) (*T) SetRGBA(x, y int, c color.RGBA) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewRGBA(r Rectangle) *RGBA func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool)
type RGBA64 (struct) RGBA64 is an in-memory image whose At method returns color.RGBA64 values. Pix []uint8 Rect Rectangle Stride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Opaque() bool (*T) PixOffset(x, y int) int (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetRGBA64(x, y int, c color.RGBA64) (*T) SubImage(r Rectangle) Image *T : Image *T : image/draw.Image func NewRGBA64(r Rectangle) *RGBA64
type Uniform (struct) Uniform is an infinite-sized Image of uniform color. It implements the color.Color, color.Model, and Image interfaces. C color.Color (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Convert(color.Color) color.Color (*T) Opaque() bool (*T) RGBA() (r, g, b, a uint32) *T : Image *T : image/color.Color *T : image/color.Model func NewUniform(c color.Color) *Uniform var Black *Uniform var Opaque *Uniform var Transparent *Uniform var White *Uniform
type YCbCr (struct) YCbCr is an in-memory image of Y'CbCr colors. There is one Y sample per pixel, but each Cb and Cr sample can span one or more pixels. YStride is the Y slice index delta between vertically adjacent pixels. CStride is the Cb and Cr slice index delta between vertically adjacent pixels that map to separate chroma samples. It is not an absolute requirement, but YStride and len(Y) are typically multiples of 8, and: For 4:4:4, CStride == YStride/1 && len(Cb) == len(Cr) == len(Y)/1. For 4:2:2, CStride == YStride/2 && len(Cb) == len(Cr) == len(Y)/2. For 4:2:0, CStride == YStride/2 && len(Cb) == len(Cr) == len(Y)/4. For 4:4:0, CStride == YStride/1 && len(Cb) == len(Cr) == len(Y)/2. For 4:1:1, CStride == YStride/4 && len(Cb) == len(Cr) == len(Y)/4. For 4:1:0, CStride == YStride/4 && len(Cb) == len(Cr) == len(Y)/8. CStride int Cb []uint8 Cr []uint8 Rect Rectangle SubsampleRatio YCbCrSubsampleRatio Y []uint8 YStride int (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) COffset(x, y int) int (*T) ColorModel() color.Model (*T) Opaque() bool (*T) SubImage(r Rectangle) Image (*T) YCbCrAt(x, y int) color.YCbCr (*T) YOffset(x, y int) int *T : Image func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool)
type YCbCrSubsampleRatio int YCbCrSubsampleRatio is the chroma subsample ratio used in a YCbCr image. (T) String() string T : expvar.Var T : fmt.Stringer func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr const YCbCrSubsampleRatio410 const YCbCrSubsampleRatio411 const YCbCrSubsampleRatio420 const YCbCrSubsampleRatio422 const YCbCrSubsampleRatio440 const YCbCrSubsampleRatio444
Exported Values
var Black *Uniform Black is an opaque black uniform image.
func Decode(r io.Reader) (Image, string, error) Decode decodes an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec- specific package.
func DecodeConfig(r io.Reader) (Config, string, error) DecodeConfig decodes the color model and dimensions of an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec-specific package.
var ErrFormat error ErrFormat indicates that decoding encountered an unknown format.
func NewAlpha(r Rectangle) *Alpha NewAlpha returns a new Alpha image with the given bounds.
func NewAlpha16(r Rectangle) *Alpha16 NewAlpha16 returns a new Alpha16 image with the given bounds.
func NewCMYK(r Rectangle) *CMYK NewCMYK returns a new CMYK image with the given bounds.
func NewGray(r Rectangle) *Gray NewGray returns a new Gray image with the given bounds.
func NewGray16(r Rectangle) *Gray16 NewGray16 returns a new Gray16 image with the given bounds.
func NewNRGBA(r Rectangle) *NRGBA NewNRGBA returns a new NRGBA image with the given bounds.
func NewNRGBA64(r Rectangle) *NRGBA64 NewNRGBA64 returns a new NRGBA64 image with the given bounds.
func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA NewNYCbCrA returns a new NYCbCrA image with the given bounds and subsample ratio.
func NewPaletted(r Rectangle, p color.Palette) *Paletted NewPaletted returns a new Paletted image with the given width, height and palette.
func NewRGBA(r Rectangle) *RGBA NewRGBA returns a new RGBA image with the given bounds.
func NewRGBA64(r Rectangle) *RGBA64 NewRGBA64 returns a new RGBA64 image with the given bounds.
func NewUniform(c color.Color) *Uniform NewUniform returns a new Uniform image of the given color.
func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr NewYCbCr returns a new YCbCr image with the given bounds and subsample ratio.
var Opaque *Uniform Opaque is a fully opaque uniform image.
func Pt(X, Y int) Point Pt is shorthand for Point{X, Y}.
func Rect(x0, y0, x1, y1 int) Rectangle Rect is shorthand for Rectangle{Pt(x0, y0), Pt(x1, y1)}. The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed.
func RegisterFormat(name, magic string, decode func(io.Reader) (Image, error), decodeConfig func(io.Reader) (Config, error)) RegisterFormat registers an image format for use by Decode. Name is the name of the format, like "jpeg" or "png". Magic is the magic prefix that identifies the format's encoding. The magic string can contain "?" wildcards that each match any one byte. Decode is the function that decodes the encoded image. DecodeConfig is the function that decodes just its configuration.
var Transparent *Uniform Transparent is a fully transparent uniform image.
var White *Uniform White is an opaque white uniform image.
var ZP Point ZP is the zero Point. Deprecated: Use a literal image.Point{} instead.
var ZR Rectangle ZR is the zero Rectangle. Deprecated: Use a literal image.Rectangle{} instead.