Documentation
¶
Overview ¶
Package colour provides spectral, hero-wavelength and RGB support functions and types.
Index ¶
- Constants
- func RGBToSpectrumSmits99(r, g, b, lambda float32) (c float32)
- type CieObserverData
- type RGB
- type RGBA
- type Space
- type Spectrum
- func (wv *Spectrum) Add(other Spectrum)
- func (wv *Spectrum) FromRGB(rgb RGB) error
- func (wv *Spectrum) Mul(other Spectrum)
- func (wv *Spectrum) Scale(s float32)
- func (wv *Spectrum) Set(v float32)
- func (wv *Spectrum) SetZero()
- func (wv *Spectrum) ToRGB() (rgb RGB)
- func (wv *Spectrum) Wavelength(j int) (v float32)
Constants ¶
const ( LambdaMin = 450 LambdaMax = 750 LambdaN = 4 )
Constants for min and maximum wavelength and number of wavelength samples in use for the hero-wavelength.
Variables ¶
This section is empty.
Functions ¶
func RGBToSpectrumSmits99 ¶
RGBToSpectrumSmits99 converts an RGB triple to a spectrum at a given wavelength
Types ¶
type CieObserverData ¶
type CieObserverData struct {
LambdaMin, LambdaMax float32
// contains filtered or unexported fields
}
CieObserverData encapsulates Standard CIE observer functions
func (*CieObserverData) X ¶
func (ob *CieObserverData) X(lambda float32) float32
X returns the x observer function for the given wavelength lambda.
func (*CieObserverData) Y ¶
func (ob *CieObserverData) Y(lambda float32) float32
Y returns the y observer function for the given wavelength lambda.
func (*CieObserverData) Z ¶
func (ob *CieObserverData) Z(lambda float32) float32
Z returns the z observer function for the given wavelength lambda.
type RGB ¶
type RGB [3]float32
RGB represents a colour triple.
type Space ¶
type Space struct {
// contains filtered or unexported fields
}
Space represents a transform from XYZ to a different space.
type Spectrum ¶
Spectrum represents a line spectrum using the hero-wavelength idea.
func (*Spectrum) Add ¶
Add adds other to the spectrum. Both spectra must represent the same wavelength.
func (*Spectrum) Mul ¶
Mul multiplies the spectrum by other. Both spectra must represent the same wavelength.
func (*Spectrum) Wavelength ¶
Wavelength returns the wavelength for index j (see hero-wavelength paper). j = 0..LambdaN