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 Package image implements a basic 2-D image library. The fundamental interface is called Image. An Image contains colors, which are described in the image/color package. Values of the Image interface are created either by calling functions such as NewRGBA and NewPaletted, or by calling Decode on an io.Reader containing image data in a format such as GIF, JPEG or PNG. Decoding any particular image format requires the prior registration of a decoder function. Registration is typically automatic as a side effect of initializing that format's package so that, to decode a PNG image, it suffices to have import _ "image/png" in a program's main package. The _ means to import a package purely for its initialization side effects. See "The Go image package" for more details: https://golang.org/doc/articles/image_package.html names.go ycbcr.go
Package-Level Type Names (total 20)
/* sort by: | */
Alpha is an in-memory image whose At method returns color.Alpha values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) AlphaAt(x, y int) color.Alpha (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetAlpha(x, y int, c color.Alpha) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewAlpha(r Rectangle) *Alpha
Alpha16 is an in-memory image whose At method returns color.Alpha16 values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) Alpha16At(x, y int) color.Alpha16 (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetAlpha16(x, y int, c color.Alpha16) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewAlpha16(r Rectangle) *Alpha16
CMYK is an in-memory image whose At method returns color.CMYK values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) CMYKAt(x, y int) color.CMYK (*T) ColorModel() color.Model Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetCMYK(x, y int, c color.CMYK) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewCMYK(r Rectangle) *CMYK
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)
Gray is an in-memory image whose At method returns color.Gray values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) GrayAt(x, y int) color.Gray Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetGray(x, y int, c color.Gray) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewGray(r Rectangle) *Gray
Gray16 is an in-memory image whose At method returns color.Gray16 values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) Gray16At(x, y int) color.Gray16 Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetGray16(x, y int, c color.Gray16) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewGray16(r Rectangle) *Gray16
Image is a finite rectangular grid of color.Color values taken from a color model. At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one. Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0). ColorModel returns the Image's color model. *Alpha *Alpha16 *CMYK *Gray *Gray16 *NRGBA *NRGBA64 *NYCbCrA *Paletted PalettedImage (interface) Rectangle *RGBA *RGBA64 RGBA64Image (interface) *Uniform *YCbCr image/draw.Image (interface) image/draw.RGBA64Image (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
NRGBA is an in-memory image whose At method returns color.NRGBA values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) NRGBAAt(x, y int) color.NRGBA Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetNRGBA(x, y int, c color.NRGBA) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewNRGBA(r Rectangle) *NRGBA
NRGBA64 is an in-memory image whose At method returns color.NRGBA64 values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model (*T) NRGBA64At(x, y int) color.NRGBA64 Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetNRGBA64(x, y int, c color.NRGBA64) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewNRGBA64(r Rectangle) *NRGBA64
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 AOffset returns the index of the first element of A that corresponds to the pixel at (x, y). (*T) At(x, y int) color.Color (*T) Bounds() Rectangle COffset returns the index of the first element of Cb or Cr that corresponds to the pixel at (x, y). (*T) ColorModel() color.Model (*T) NYCbCrAAt(x, y int) color.NYCbCrA Opaque scans the entire image and reports whether it is fully opaque. (*T) RGBA64At(x, y int) color.RGBA64 SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. (*T) YCbCrAt(x, y int) color.YCbCr YOffset returns the index of the first element of Y that corresponds to the pixel at (x, y). *T : Image *T : RGBA64Image func NewNYCbCrA(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *NYCbCrA
Paletted is an in-memory image of uint8 indices into a given palette. Palette is the image's palette. Pix holds the image's pixels, as palette indices. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorIndexAt(x, y int) uint8 (*T) ColorModel() color.Model Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetColorIndex(x, y int, index uint8) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : PalettedImage *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewPaletted(r Rectangle, p color.Palette) *Paletted
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. At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one. Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0). ColorIndexAt returns the palette index of the pixel at (x, y). ColorModel returns the Image's color model. *Paletted T : Image
A Point is an X, Y coordinate pair. The axes increase right and down. X int Y int Add returns the vector p+q. Div returns the vector p/k. Eq reports whether p and q are equal. In reports whether p is in r. Mod returns the point q in r such that p.X-q.X is a multiple of r's width and p.Y-q.Y is a multiple of r's height. Mul returns the vector p*k. String returns a string representation of p like "(3,4)". Sub returns the vector p-q. 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
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 Add returns the rectangle r translated by p. At implements the Image interface. Bounds implements the Image interface. Canon returns the canonical version of r. The returned rectangle has minimum and maximum coordinates swapped if necessary so that it is well-formed. ColorModel implements the Image interface. Dx returns r's width. Dy returns r's height. Empty reports whether the rectangle contains no points. Eq reports whether r and s contain the same set of points. All empty rectangles are considered equal. In reports whether every point in r is in s. Inset returns the rectangle r inset by n, which may be negative. If either of r's dimensions is less than 2*n then an empty rectangle near the center of r will be returned. Intersect returns the largest rectangle contained by both r and s. If the two rectangles do not overlap then the zero rectangle will be returned. Overlaps reports whether r and s have a non-empty intersection. RGBA64At implements the RGBA64Image interface. Size returns r's width and height. String returns a string representation of r like "(3,4)-(6,5)". Sub returns the rectangle r translated by -p. Union returns the smallest rectangle that contains both r and s. T : Image T : RGBA64Image 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 RGBA64Image.Bounds() Rectangle func (*Uniform).Bounds() Rectangle func (*YCbCr).Bounds() Rectangle func image/draw.Image.Bounds() Rectangle func image/draw.RGBA64Image.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
RGBA is an in-memory image whose At method returns color.RGBA values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) RGBAAt(x, y int) color.RGBA (*T) Set(x, y int, c color.Color) (*T) SetRGBA(x, y int, c color.RGBA) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewRGBA(r Rectangle) *RGBA func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool)
RGBA64 is an in-memory image whose At method returns color.RGBA64 values. Pix holds the image's pixels, in R, G, B, A order. The pixel at (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4]. Rect is the image's bounds. Stride is the Pix stride (in bytes) between vertically adjacent pixels. (*T) At(x, y int) color.Color (*T) Bounds() Rectangle (*T) ColorModel() color.Model Opaque scans the entire image and reports whether it is fully opaque. PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y). (*T) RGBA64At(x, y int) color.RGBA64 (*T) Set(x, y int, c color.Color) (*T) SetRGBA64(x, y int, c color.RGBA64) SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. *T : Image *T : RGBA64Image *T : image/draw.Image *T : image/draw.RGBA64Image func NewRGBA64(r Rectangle) *RGBA64
RGBA64Image is an Image whose pixels can be converted directly to a color.RGBA64. At returns the color of the pixel at (x, y). At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid. At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one. Bounds returns the domain for which At can return non-zero color. The bounds do not necessarily contain the point (0, 0). ColorModel returns the Image's color model. RGBA64At returns the RGBA64 color of the pixel at (x, y). It is equivalent to calling At(x, y).RGBA() and converting the resulting 32-bit return values to a color.RGBA64, but it can avoid allocations from converting concrete color types to the color.Color interface type. *Alpha *Alpha16 *CMYK *Gray *Gray16 *NRGBA *NRGBA64 *NYCbCrA *Paletted Rectangle *RGBA *RGBA64 *Uniform *YCbCr image/draw.RGBA64Image (interface) T : Image
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 Opaque scans the entire image and reports whether it is fully opaque. (*T) RGBA() (r, g, b, a uint32) (*T) RGBA64At(x, y int) color.RGBA64 *T : Image *T : RGBA64Image *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
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 COffset returns the index of the first element of Cb or Cr that corresponds to the pixel at (x, y). (*T) ColorModel() color.Model (*T) Opaque() bool (*T) RGBA64At(x, y int) color.RGBA64 SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image. (*T) YCbCrAt(x, y int) color.YCbCr YOffset returns the index of the first element of Y that corresponds to the pixel at (x, y). *T : Image *T : RGBA64Image func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool)
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
Package-Level Functions (total 18)
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.
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.
NewAlpha returns a new Alpha image with the given bounds.
NewAlpha16 returns a new Alpha16 image with the given bounds.
NewCMYK returns a new CMYK image with the given bounds.
NewGray returns a new Gray image with the given bounds.
NewGray16 returns a new Gray16 image with the given bounds.
NewNRGBA returns a new NRGBA image with the given bounds.
NewNRGBA64 returns a new NRGBA64 image with the given bounds.
NewNYCbCrA returns a new NYCbCrA image with the given bounds and subsample ratio.
NewPaletted returns a new Paletted image with the given width, height and palette.
NewRGBA returns a new RGBA image with the given bounds.
NewRGBA64 returns a new RGBA64 image with the given bounds.
NewUniform returns a new Uniform image of the given color.
NewYCbCr returns a new YCbCr image with the given bounds and subsample ratio.
Pt is shorthand for Point{X, Y}.
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.
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.
Package-Level Variables (total 7)
Black is an opaque black uniform image.
ErrFormat indicates that decoding encountered an unknown format.
Opaque is a fully opaque uniform image.
Transparent is a fully transparent uniform image.
White is an opaque white uniform image.
ZP is the zero Point. Deprecated: Use a literal image.Point{} instead.
ZR is the zero Rectangle. Deprecated: Use a literal image.Rectangle{} instead.