Documentation ¶
Overview ¶
Package adobergb provides support for the Adobe RGB (1998) colour space.
Index ¶
- Variables
- func EncodeColor(c color.Color) color.RGBA64
- func EncodeImage(dst draw.Image, src image.Image, parallelism int)
- func From16Bit(v uint16) float32
- func From8Bit(v uint8) float32
- func LineariseColor(c color.Color) color.RGBA64
- func LineariseImage(dst draw.Image, src image.Image, parallelism int)
- func To16Bit(v float32) uint16
- func To8Bit(v float32) uint8
- type Color
- func ColorFromEncodedColor(c color.Color) (col Color, alpha float32)
- func ColorFromLinear(r, g, b float32) Color
- func ColorFromLinearColor(c color.Color) (col Color, alpha float32)
- func ColorFromNRGBA(c color.NRGBA) (col Color, alpha float32)
- func ColorFromRGBA(c color.RGBA) (col Color, alpha float32)
- func ColorFromXYZ(c ciexyz.Color) Color
Constants ¶
This section is empty.
Variables ¶
var PrimaryBlue = ciexyy.Color{X: 0.15, Y: 0.06, YY: 1}
var PrimaryGreen = ciexyy.Color{X: 0.21, Y: 0.71, YY: 1}
var PrimaryRed = ciexyy.Color{X: 0.64, Y: 0.33, YY: 1}
var StandardWhitePoint = ciexyy.D65
Functions ¶
func EncodeColor ¶ added in v0.26.0
EncodeColor converts a linear colour value to an Adobe RGB encoded one.
func EncodeImage ¶ added in v0.26.0
EncodeImage converts an image with linear colour into an Adobe RGB encoded one.
src is the linearised image to be encoded.
dst is the image to write the result to, beginning at its origin.
src and dst may be the same image.
parallelism specifies the degree of parallel processing; a value of 4 indicates that processing will be spread across four threads.
func From16Bit ¶ added in v0.29.0
From16Bit converts a 16-bit Adobe RGB encoded value to a normalised linear value between 0.0 and 1.0.
This implementation uses a fast look-up table without sacrificing accuracy.
func From8Bit ¶
From8Bit converts an 8-bit Adobe RGB encoded value to a normalised linear value between 0.0 and 1.0.
This implementation uses a fast look-up table without sacrificing accuracy.
func LineariseColor ¶ added in v0.26.0
LineariseColor converts an Adobe RGB encoded colour into a linear one.
func LineariseImage ¶ added in v0.26.0
LineariseImage converts an image with Adobe RGB encoded colour to linear colour.
src is the encoded image to be linearised.
dst is the image to write the result to, beginning at its origin.
src and dst may be the same image.
parallelism specifies the degree of parallel processing; a value of 4 indicates that processing will be spread across four threads.
Types ¶
type Color ¶
Color represents a linear normalised colour in Adobe RGB (1998) space.
func ColorFromEncodedColor ¶ added in v0.26.0
ColorFromEncodedColor creates a Color instance from an Adobe RGB encoded color.Color value. The alpha value is returned as a normalised value between 0.0–1.0.
func ColorFromLinear ¶ added in v0.19.0
ColorFromLinear creates a Color instance from a linear normalised RGB triplet.
func ColorFromLinearColor ¶ added in v0.26.0
ColorFromLinearColor creates a Color instance from a linear color.Color value. The alpha value is returned as a normalised value between 0.0–1.0.
func ColorFromNRGBA ¶
ColorFromNRGBA creates a Color instance by interpreting an 8-bit NRGBA colour as Adobe RGB (1998) encoded. The alpha value is returned as a normalised value between 0.0–1.0.
func ColorFromRGBA ¶ added in v0.18.0
ColorFromRGBA creates a Color instance by interpreting an 8-bit RGBA colour as Adobe RGB (1998) encoded. The alpha value is returned as a normalised value between 0.0–1.0.
func ColorFromXYZ ¶
ColorFromXYZ creates an Adobe RGB Color instance from a CIE XYZ colour.
func (Color) ToNRGBA ¶ added in v0.8.0
ToNRGBA returns an encoded 8-bit NRGBA representation of this colour suitable for use with instances of image.NRGBA.
alpha is the normalised alpha value and will be clipped to 0.0–1.0.
func (Color) ToRGBA ¶ added in v0.18.0
ToRGBA returns an encoded 8-bit RGBA representation of this colour suitable for use with instances of image.RGBA.
alpha is the normalised alpha value and will be clipped to 0.0–1.0.