Namespace: go.std.image.color
v1.0Contents
Summary
Provides a low-level interface to the image/color package.
Package color implements a basic color library.
Index
- *Alpha
- *Alpha16
- *CMYK
- *Gray
- *Gray16
- *NRGBA
- *NRGBA64
- *NYCbCrA
- *Palette
- *RGBA
- *RGBA64
- *YCbCr
- Alpha
- Alpha16
- Alpha16Model
- AlphaModel
- Black
- CMYK
- CMYKModel
- CMYKToRGB
- Color
- Gray
- Gray16
- Gray16Model
- GrayModel
- Model
- NRGBA
- NRGBA64
- NRGBA64Model
- NRGBAModel
- NYCbCrA
- NYCbCrAModel
- Opaque
- Palette
- RGBA
- RGBA64
- RGBA64Model
- RGBAModel
- RGBToCMYK
- RGBToYCbCr
- Transparent
- White
- YCbCr
- YCbCrModel
- YCbCrToRGB
- arrayOfAlpha
- arrayOfAlpha16
- arrayOfCMYK
- arrayOfColor
- arrayOfGray
- arrayOfGray16
- arrayOfModel
- arrayOfNRGBA
- arrayOfNRGBA64
- arrayOfNYCbCrA
- arrayOfPalette
- arrayOfRGBA
- arrayOfRGBA64
- arrayOfYCbCr
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
Alpha16Model
Var v1.0Models for the standard color types.
-
AlphaModel
Var v1.0Models for the standard color types.
-
Black
Var v1.0Standard colors.
-
CMYKModel
Var v1.0CMYKModel is the Model for CMYK colors.
-
Gray16Model
Var v1.0Models for the standard color types.
-
GrayModel
Var v1.0Models for the standard color types.
-
NRGBA64Model
Var v1.0Models for the standard color types.
-
NRGBAModel
Var v1.0Models for the standard color types.
-
NYCbCrAModel
Var v1.0NYCbCrAModel is the Model for non-alpha-premultiplied Y'CbCr-with-alpha
colors.
-
Opaque
Var v1.0Standard colors.
-
RGBA64Model
Var v1.0Models for the standard color types.
-
RGBAModel
Var v1.0Models for the standard color types.
-
Transparent
Var v1.0Standard colors.
-
White
Var v1.0Standard colors.
-
YCbCrModel
Var v1.0YCbCrModel is the Model for Y'CbCr colors.
Functions, Macros, and Special Forms
-
CMYKToRGB
Function v1.0(CMYKToRGB c m y k)
CMYKToRGB converts a CMYK quadruple to an RGB triple.
Go input arguments: (c uint8, m uint8, y uint8, k uint8)
Go returns: (uint8, uint8, uint8)
Joker input arguments: [^Int c, ^Int m, ^Int y, ^Int k]
Joker returns: [^Int, ^Int, ^Int] -
RGBToCMYK
Function v1.0(RGBToCMYK r g b)
RGBToCMYK converts an RGB triple to a CMYK quadruple.
Go input arguments: (r uint8, g uint8, b uint8)
Go returns: (uint8, uint8, uint8, uint8)
Joker input arguments: [^Int r, ^Int g, ^Int b]
Joker returns: [^Int, ^Int, ^Int, ^Int] -
RGBToYCbCr
Function v1.0(RGBToYCbCr r g b)
RGBToYCbCr converts an RGB triple to a Y'CbCr triple.
Go input arguments: (r uint8, g uint8, b uint8)
Go returns: (uint8, uint8, uint8)
Joker input arguments: [^Int r, ^Int g, ^Int b]
Joker returns: [^Int, ^Int, ^Int] -
YCbCrToRGB
Function v1.0(YCbCrToRGB y cb cr)
YCbCrToRGB converts a Y'CbCr triple to an RGB triple.
Go input arguments: (y uint8, cb uint8, cr uint8)
Go returns: (uint8, uint8, uint8)
Joker input arguments: [^Int y, ^Int cb, ^Int cr]
Joker returns: [^Int, ^Int, ^Int]
Types
-
*Alpha
Concrete Type v1.0Alpha represents an 8-bit alpha color.
-
*Alpha16
Concrete Type v1.0Alpha16 represents a 16-bit alpha color.
-
*CMYK
Concrete Type v1.0CMYK represents a fully opaque CMYK color, having 8 bits for each of cyan,
magenta, yellow and black.
It is not associated with any particular color profile.
-
*Gray
Concrete Type v1.0Gray represents an 8-bit grayscale color.
-
*Gray16
Concrete Type v1.0Gray16 represents a 16-bit grayscale color.
-
*NRGBA
Concrete Type v1.0NRGBA represents a non-alpha-premultiplied 32-bit color.
-
*NRGBA64
Concrete Type v1.0NRGBA64 represents a non-alpha-premultiplied 64-bit color,
having 16 bits for each of red, green, blue and alpha.
-
*NYCbCrA
Concrete Type v1.0NYCbCrA represents a non-alpha-premultiplied Y'CbCr-with-alpha color, having
8 bits each for one luma, two chroma and one alpha component.
-
*Palette
Concrete Type v1.0Palette is a palette of colors.
-
*RGBA
Concrete Type v1.0RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
bits for each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
-
*RGBA64
Concrete Type v1.0RGBA64 represents a 64-bit alpha-premultiplied color, having 16 bits for
each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
-
*YCbCr
Concrete Type v1.0YCbCr represents a fully opaque 24-bit Y'CbCr color, having 8 bits each for
one luma and two chroma components.
JPEG, VP8, the MPEG family and other codecs use this color model. Such
codecs often use the terms YUV and Y'CbCr interchangeably, but strictly
speaking, the term YUV applies only to analog video signals, and Y' (luma)
is Y (luminance) after applying gamma correction.
Conversion between RGB and Y'CbCr is lossy and there are multiple, slightly
different formulae for converting between the two. This package follows
the JFIF specification at https://www.w3.org/Graphics/JPEG/jfif3.pdf.
-
Alpha
Concrete Type v1.0Alpha represents an 8-bit alpha color.
-
RGBA
Receiver for Alpha v1.0([])
-
Alpha16
Concrete Type v1.0Alpha16 represents a 16-bit alpha color.
-
RGBA
Receiver for Alpha16 v1.0([])
-
CMYK
Concrete Type v1.0CMYK represents a fully opaque CMYK color, having 8 bits for each of cyan,
magenta, yellow and black.
It is not associated with any particular color profile.
-
RGBA
Receiver for CMYK v1.0([])
-
Color
Abstract Type v1.0Color can convert itself to alpha-premultiplied 16-bits per channel RGBA.
The conversion may be lossy.
-
RGBA
Method for Color v1.0([])
-
Gray
Concrete Type v1.0Gray represents an 8-bit grayscale color.
-
RGBA
Receiver for Gray v1.0([])
-
Gray16
Concrete Type v1.0Gray16 represents a 16-bit grayscale color.
-
RGBA
Receiver for Gray16 v1.0([])
-
Model
Abstract Type v1.0Model can convert any Color to one from its own color model. The conversion
may be lossy.
-
Convert
Method for Model v1.0([c])
-
NRGBA
Concrete Type v1.0NRGBA represents a non-alpha-premultiplied 32-bit color.
-
RGBA
Receiver for NRGBA v1.0([])
-
NRGBA64
Concrete Type v1.0NRGBA64 represents a non-alpha-premultiplied 64-bit color,
having 16 bits for each of red, green, blue and alpha.
-
RGBA
Receiver for NRGBA64 v1.0([])
-
NYCbCrA
Concrete Type v1.0NYCbCrA represents a non-alpha-premultiplied Y'CbCr-with-alpha color, having
8 bits each for one luma, two chroma and one alpha component.
-
RGBA
Receiver for NYCbCrA v1.0([])
-
Palette
Concrete Type v1.0Palette is a palette of colors.
-
Convert
Receiver for Palette v1.0([c])
Convert returns the palette color closest to c in Euclidean R,G,B space.
-
Index
Receiver for Palette v1.0([c])
Index returns the index of the palette color closest to c in Euclidean
R,G,B,A space.
-
RGBA
Concrete Type v1.0RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
bits for each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
-
RGBA
Receiver for RGBA v1.0([])
-
RGBA64
Concrete Type v1.0RGBA64 represents a 64-bit alpha-premultiplied color, having 16 bits for
each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
-
RGBA
Receiver for RGBA64 v1.0([])
-
YCbCr
Concrete Type v1.0YCbCr represents a fully opaque 24-bit Y'CbCr color, having 8 bits each for
one luma and two chroma components.
JPEG, VP8, the MPEG family and other codecs use this color model. Such
codecs often use the terms YUV and Y'CbCr interchangeably, but strictly
speaking, the term YUV applies only to analog video signals, and Y' (luma)
is Y (luminance) after applying gamma correction.
Conversion between RGB and Y'CbCr is lossy and there are multiple, slightly
different formulae for converting between the two. This package follows
the JFIF specification at https://www.w3.org/Graphics/JPEG/jfif3.pdf.
-
RGBA
Receiver for YCbCr v1.0([])
-
arrayOfAlpha
Concrete Type v1.0Alpha represents an 8-bit alpha color.
-
arrayOfAlpha16
Concrete Type v1.0Alpha16 represents a 16-bit alpha color.
-
arrayOfCMYK
Concrete Type v1.0CMYK represents a fully opaque CMYK color, having 8 bits for each of cyan,
magenta, yellow and black.
It is not associated with any particular color profile.
-
arrayOfColor
Concrete Type v1.0Color can convert itself to alpha-premultiplied 16-bits per channel RGBA.
The conversion may be lossy.
-
arrayOfGray
Concrete Type v1.0Gray represents an 8-bit grayscale color.
-
arrayOfGray16
Concrete Type v1.0Gray16 represents a 16-bit grayscale color.
-
arrayOfModel
Concrete Type v1.0Model can convert any Color to one from its own color model. The conversion
may be lossy.
-
arrayOfNRGBA
Concrete Type v1.0NRGBA represents a non-alpha-premultiplied 32-bit color.
-
arrayOfNRGBA64
Concrete Type v1.0NRGBA64 represents a non-alpha-premultiplied 64-bit color,
having 16 bits for each of red, green, blue and alpha.
-
arrayOfNYCbCrA
Concrete Type v1.0NYCbCrA represents a non-alpha-premultiplied Y'CbCr-with-alpha color, having
8 bits each for one luma, two chroma and one alpha component.
-
arrayOfPalette
Concrete Type v1.0Palette is a palette of colors.
-
arrayOfRGBA
Concrete Type v1.0RGBA represents a traditional 32-bit alpha-premultiplied color, having 8
bits for each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
-
arrayOfRGBA64
Concrete Type v1.0RGBA64 represents a 64-bit alpha-premultiplied color, having 16 bits for
each of red, green, blue and alpha.
An alpha-premultiplied color component C has been scaled by alpha (A), so
has valid values 0 <= C <= A.
-
arrayOfYCbCr
Concrete Type v1.0YCbCr represents a fully opaque 24-bit Y'CbCr color, having 8 bits each for
one luma and two chroma components.
JPEG, VP8, the MPEG family and other codecs use this color model. Such
codecs often use the terms YUV and Y'CbCr interchangeably, but strictly
speaking, the term YUV applies only to analog video signals, and Y' (luma)
is Y (luminance) after applying gamma correction.
Conversion between RGB and Y'CbCr is lossy and there are multiple, slightly
different formulae for converting between the two. This package follows
the JFIF specification at https://www.w3.org/Graphics/JPEG/jfif3.pdf.