Documentation ¶
Index ¶
- Variables
- type BGR
- type BGRImage
- func (p BGRImage) At(x, y int) color.Color
- func (p *BGRImage) BGRAt(x, y int) BGR
- func (p BGRImage) Bounds() image.Rectangle
- func (p BGRImage) Channels() int
- func (p BGRImage) ColorModel() color.Model
- func (p *BGRImage) FillFromBGRImage(bgrImage *RGBImage) error
- func (p *BGRImage) FillFromGrayImage(grayImage *image.Gray) error
- func (p *BGRImage) FillFromNRGBAImage(nrgbaImage *image.NRGBA) error
- func (p *BGRImage) FillFromRGBAImage(rgbaImage *image.RGBA) error
- func (p *BGRImage) FillFromRGBImage(rgbImage *RGBImage) error
- func (p *BGRImage) FillFromYCBCRImage(ycImage *image.YCbCr) error
- func (p BGRImage) Mode() Mode
- func (p *BGRImage) PixOffset(x, y int) int
- func (p BGRImage) Pixels() []uint8
- func (p *BGRImage) Set(x, y int, c color.Color)
- func (p *BGRImage) SetBGR(x, y int, c BGR)
- func (p *BGRImage) SubImage(r image.Rectangle) image.Image
- func (p *BGRImage) ToRGBAImage() *image.RGBA
- type Image
- type Mode
- func (m Mode) Channels() int
- func (i Mode) IsAMode() bool
- func (i Mode) MarshalJSON() ([]byte, error)
- func (i Mode) MarshalText() ([]byte, error)
- func (i Mode) MarshalYAML() (interface{}, error)
- func (i *Mode) Scan(value interface{}) error
- func (i Mode) String() string
- func (i *Mode) UnmarshalJSON(data []byte) error
- func (i *Mode) UnmarshalText(text []byte) error
- func (i *Mode) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i Mode) Value() (driver.Value, error)
- type RGB
- type RGBImage
- func (p RGBImage) At(x, y int) color.Color
- func (p RGBImage) Bounds() image.Rectangle
- func (p RGBImage) Channels() int
- func (p RGBImage) ColorModel() color.Model
- func (p *RGBImage) FillFromBGRImage(bgrImage *BGRImage) error
- func (p *RGBImage) FillFromGrayImage(grayImage *image.Gray) error
- func (p *RGBImage) FillFromNRGBAImage(nrgbaImage *image.NRGBA) error
- func (p *RGBImage) FillFromRGBAImage(rgbaImage *image.RGBA) error
- func (p *RGBImage) FillFromRGBImage(rgbImage *RGBImage) error
- func (p *RGBImage) FillFromYCBCRImage(ycImage *image.YCbCr) error
- func (p RGBImage) Mode() Mode
- func (p *RGBImage) PixOffset(x, y int) int
- func (p RGBImage) Pixels() []uint8
- func (p *RGBImage) RGBAt(x, y int) RGB
- func (p *RGBImage) Set(x, y int, c color.Color)
- func (p *RGBImage) SetRGB(x, y int, c RGB)
- func (p *RGBImage) SubImage(r image.Rectangle) image.Image
- func (p *RGBImage) ToRGBAImage() *image.RGBA
- type ResizeAlgorithm
- func (i ResizeAlgorithm) IsAResizeAlgorithm() bool
- func (i ResizeAlgorithm) MarshalJSON() ([]byte, error)
- func (i ResizeAlgorithm) MarshalText() ([]byte, error)
- func (i ResizeAlgorithm) MarshalYAML() (interface{}, error)
- func (i *ResizeAlgorithm) Scan(value interface{}) error
- func (i ResizeAlgorithm) String() string
- func (i *ResizeAlgorithm) UnmarshalJSON(data []byte) error
- func (i *ResizeAlgorithm) UnmarshalText(text []byte) error
- func (i *ResizeAlgorithm) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i ResizeAlgorithm) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var (
BGRModel color.Model = color.ModelFunc(bgrModel)
)
var (
RGBModel color.Model = color.ModelFunc(rgbModel)
)
Functions ¶
This section is empty.
Types ¶
type BGR ¶
type BGR struct {
B, G, R uint8
}
BGR represents a traditional 32-bit alpha-premultiplied color, having 8 bits for each of red, green, blue.
type BGRImage ¶
type BGRImage struct { // Pix holds the image's pixels, in R, G, B order. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*3]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
BGRImage is an in-memory image whose At method returns RGB values.
func NewBGRImage ¶
NewBGRImage returns a new BGRImage image with the given bounds.
func (BGRImage) ColorModel ¶
func (*BGRImage) FillFromBGRImage ¶
func (*BGRImage) FillFromGrayImage ¶
func (*BGRImage) FillFromNRGBAImage ¶
func (*BGRImage) FillFromRGBAImage ¶
func (*BGRImage) FillFromRGBImage ¶
func (*BGRImage) FillFromYCBCRImage ¶
func (*BGRImage) PixOffset ¶
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
func (*BGRImage) SubImage ¶
SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.
func (*BGRImage) ToRGBAImage ¶
type Mode ¶
type Mode int
mode represents the image mode
func ModeString ¶
ModeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Mode) IsAMode ¶
IsAMode returns "true" if the value is listed in the enum definition. "false" otherwise
func (Mode) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for Mode
func (Mode) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Mode
func (Mode) MarshalYAML ¶
MarshalYAML implements a YAML Marshaler for Mode
func (*Mode) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for Mode
func (*Mode) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Mode
func (*Mode) UnmarshalYAML ¶
UnmarshalYAML implements a YAML Unmarshaler for Mode
type RGB ¶
type RGB struct {
R, G, B uint8
}
RGB represents a traditional 32-bit alpha-premultiplied color, having 8 bits for each of red, green, blue.
type RGBImage ¶
type RGBImage struct { // Pix holds the image's pixels, in R, G, B order. The pixel at // (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*3]. Pix []uint8 // Stride is the Pix stride (in bytes) between vertically adjacent pixels. Stride int // Rect is the image's bounds. Rect image.Rectangle }
RGBImage is an in-memory image whose At method returns RGB values.
func NewRGBImage ¶
NewRGBImage returns a new RGBImage image with the given bounds.
func (RGBImage) ColorModel ¶
func (*RGBImage) FillFromBGRImage ¶
func (*RGBImage) FillFromGrayImage ¶
func (*RGBImage) FillFromNRGBAImage ¶
func (*RGBImage) FillFromRGBAImage ¶
func (*RGBImage) FillFromRGBImage ¶
func (*RGBImage) FillFromYCBCRImage ¶
func (*RGBImage) PixOffset ¶
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
func (*RGBImage) SubImage ¶
SubImage returns an image representing the portion of the image p visible through r. The returned value shares pixels with the original image.
func (*RGBImage) ToRGBAImage ¶
type ResizeAlgorithm ¶
type ResizeAlgorithm int
const ( ResizeAlgorithmLinear ResizeAlgorithm = iota ResizeAlgorithmLinearASM ResizeAlgorithmHermite ResizeAlgorithmNearestNeighbor ResizeAlgorithmBiLinear = ResizeAlgorithmLinear ResizeAlgorithmBiLinearASM = ResizeAlgorithmLinearASM )
func ResizeAlgorithmString ¶
func ResizeAlgorithmString(s string) (ResizeAlgorithm, error)
ResizeAlgorithmString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ResizeAlgorithmValues ¶
func ResizeAlgorithmValues() []ResizeAlgorithm
ResizeAlgorithmValues returns all values of the enum
func (ResizeAlgorithm) IsAResizeAlgorithm ¶
func (i ResizeAlgorithm) IsAResizeAlgorithm() bool
IsAResizeAlgorithm returns "true" if the value is listed in the enum definition. "false" otherwise
func (ResizeAlgorithm) MarshalJSON ¶
func (i ResizeAlgorithm) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for ResizeAlgorithm
func (ResizeAlgorithm) MarshalText ¶
func (i ResizeAlgorithm) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for ResizeAlgorithm
func (ResizeAlgorithm) MarshalYAML ¶
func (i ResizeAlgorithm) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for ResizeAlgorithm
func (*ResizeAlgorithm) Scan ¶
func (i *ResizeAlgorithm) Scan(value interface{}) error
func (ResizeAlgorithm) String ¶
func (i ResizeAlgorithm) String() string
func (*ResizeAlgorithm) UnmarshalJSON ¶
func (i *ResizeAlgorithm) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for ResizeAlgorithm
func (*ResizeAlgorithm) UnmarshalText ¶
func (i *ResizeAlgorithm) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for ResizeAlgorithm
func (*ResizeAlgorithm) UnmarshalYAML ¶
func (i *ResizeAlgorithm) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for ResizeAlgorithm