Documentation ¶
Overview ¶
Package prophotorgb provides support for the Pro Photo RGB colour space.
Index ¶
- Variables
- func Convert16BitToLinear(v uint16) float32
- func Convert8BitToLinear(v uint8) float32
- func ConvertLinearTo16Bit(v float32) uint16
- func ConvertLinearTo8Bit(v float32) uint8
- func EncodeColor(c color.Color) color.RGBA64
- func EncodeImage(img draw.Image)
- func From8Bit(v uint8) float32
- func LineariseColor(c color.Color) color.RGBA64
- func LineariseImage(img draw.Image)
- func To16Bit(linear float32) uint16
- func To8Bit(linear 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.036598, Y: 0.000105, YY: 1}
var PrimaryGreen = ciexyy.Color{X: 0.159597, Y: 0.840403, YY: 1}
var PrimaryRed = ciexyy.Color{X: 0.734699, Y: 0.265301, YY: 1}
var StandardWhitePoint = ciexyy.D50
Functions ¶
func Convert16BitToLinear ¶ added in v0.26.0
Convert16BitToLinear converts a 16-bit Pro Photo RGB encoded value to a normalised linear value between 0.0 and 1.0.
func Convert8BitToLinear ¶
Convert8BitToLinear converts an 8-bit Pro Photo RGB encoded value to a normalised linear value between 0.0 and 1.0.
This implementation uses an exact analytical method. If performance is critical, see From8Bit.
func ConvertLinearTo16Bit ¶ added in v0.26.0
ConvertLinearTo16Bit converts a linear value to a 16-bit Pro Photo RGB encoded value, clipping the linear value to between 0.0 and 1.0.
func ConvertLinearTo8Bit ¶
ConvertLinearTo8Bit converts a linear value to an 8-bit Pro Photo RGB encoded value, clipping the linear value to between 0.0 and 1.0.
This implementation uses an exact analytical method. If performance is critical, see To8Bit.
func EncodeColor ¶ added in v0.26.0
EncodeColor converts a linear colour value to a Pro Photo RGB encoded one.
func EncodeImage ¶ added in v0.26.0
EncodeImage converts an image with linear colour into a Pro Photo RGB encoded one.
func From8Bit ¶
From8Bit converts an 8-bit Pro Photo 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 a Pro Photo RGB encoded colour into a linear one.
func LineariseImage ¶ added in v0.26.0
LineariseImage converts an image with Pro Photo RGB encoded colour to linear colour.
Types ¶
type Color ¶
Color represents a linear normalised colour in Pro Photo RGB space.
func ColorFromEncodedColor ¶ added in v0.26.0
ColorFromEncodedColor creates a Color instance from a Pro Photo 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 Pro Photo RGB 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 Pro Photo RGB encoded. The alpha value is returned as a normalised value between 0.0–1.0.
func ColorFromXYZ ¶
ColorFromXYZ creates a Pro Photo RGB Color instance from a CIE XYZ colour.
func (Color) ToNRGBA ¶
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.