type Alpha(struct)
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) Set(x, y int, c color.Color)(*T) SetAlpha(x, y int, c color.Alpha)
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 : 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 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) Set(x, y int, c color.Color)(*T) SetAlpha16(x, y int, c color.Alpha16)
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 : 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 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) Set(x, y int, c color.Color)(*T) SetCMYK(x, y int, c color.CMYK)
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 : image/draw.Image
func NewCMYK(r Rectangle) *CMYK
type Gray(struct)
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) Set(x, y int, c color.Color)(*T) SetGray(x, y int, c color.Gray)
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 : 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 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) Set(x, y int, c color.Color)(*T) SetGray16(x, y int, c color.Gray16)
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 : image/draw.Image
func NewGray16(r Rectangle) *Gray16
type NRGBA(struct)
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) Set(x, y int, c color.Color)(*T) SetNRGBA(x, y int, c color.NRGBA)
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 : 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 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) Set(x, y int, c color.Color)(*T) SetNRGBA64(x, y int, c color.NRGBA64)
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 : image/draw.Image
func NewNRGBA64(r Rectangle) *NRGBA64
type Paletted(struct)
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) Set(x, y int, c color.Color)(*T) SetColorIndex(x, y int, index uint8)
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 : 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.
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
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.
MaxPointMinPoint
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.
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 : 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 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) RGBAAt(x, y int) color.RGBA(*T) Set(x, y int, c color.Color)(*T) SetRGBA(x, y int, c color.RGBA)
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 : 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 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 : image/draw.Image
func NewRGBA64(r Rectangle) *RGBA64
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.
CStrideintCb[]uint8Cr[]uint8RectRectangleSubsampleRatioYCbCrSubsampleRatioY[]uint8YStrideint(*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
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
func NewYCbCr(r Rectangle, subsampleRatio YCbCrSubsampleRatio) *YCbCr
func image/internal/imageutil.DrawYCbCr(dst *RGBA, r Rectangle, src *YCbCr, sp Point) (ok bool)
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 ErrFormaterror
ErrFormat indicates that decoding encountered an unknown format.
func NewAlpha(r Rectangle) *Alpha
NewAlpha returns a new Alpha image with the given bounds.
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 ZPPoint
ZP is the zero Point.
Deprecated: Use a literal image.Point{} instead.
var ZRRectangle
ZR is the zero Rectangle.
Deprecated: Use a literal image.Rectangle{} instead.
The pages are generated with Goldsv0.1.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.