Spectral (CVSpectral.dll) 14.1
Color

Spectral Cube Color exports. More...

Enumerations

enum  CVSInterpolationMethod { CVSIM_linear = 0 }
 Interpolation method. More...
 
enum  CVSStdIlluminant {
  CVSSI_UNDEFINED = 0 , CVSSI_E = 1 , CVSSI_A = 2 , CVSSI_D50 = 3 ,
  CVSSI_D65 = 4
}
 Standard Illumination. More...
 
enum  CVSStdObserver {
  CVSSO_UNDEFINED = 0 , CVSSO_CIE2006_2deg = 1 , CVSSO_CIE2006_10deg = 2 , CVSSO_CIE1964_10deg = 3 ,
  CVSSO_CIE1931_2deg = 4
}
 Standard Observer. More...
 

Functions

cvbres_t CVSConvertCubeToLab (CVCOMPOSITE ImageCube, CVSINTERPOLATOR Interpolator, IMG &ImageOut)
 Converts the Cube to a Lab image. More...
 
cvbres_t CVSConvertCubeToXYZ (CVCOMPOSITE ImageCube, CVSINTERPOLATOR Interpolator, IMG &ImageOut)
 Converts the Cube to a XYZ image. More...
 
cvbres_t CVSConvertLabToRGB8 (IMG ImageIn, CVSINTERPOLATOR Interpolator, IMG &ImageOut)
 Converts a Lab image to a sRGB image. More...
 
cvbres_t CVSConvertXYZToLab (IMG ImageIn, CVSINTERPOLATOR Interpolator, IMG &ImageOut)
 Converts an image from XYZ to Lab. More...
 
cvbres_t CVSCreateInterpolator (CVCOMPOSITE ImageCube, CVSStdObserver Observer, CVSStdIlluminant Illuminant, CVSInterpolationMethod Interpolation, CVSINTERPOLATOR &Interpolator)
 Creates an interpolator. More...
 
cvbres_t CVSInterpolatorGetIlluminant (CVSINTERPOLATOR Interpolator, CVSStdIlluminant &Illuminant)
 Retrieves the standard illuminant in the matching handle. More...
 
cvbres_t CVSInterpolatorGetObserver (CVSINTERPOLATOR Interpolator, CVSStdObserver &Observer)
 Retrieves the standard observer in the matching handle. More...
 
cvbres_t CVSInterpolatorGetWavelengths (CVSINTERPOLATOR Interpolator, double WavelengthArray[], size_t &NumberOfWavelengths)
 Retrieves the wavelengths of the illuminant spectrum. More...
 

Detailed Description

Spectral Cube Color exports.

Version
0.0.1.0
For details see function documentation.

Enumeration Type Documentation

◆ CVSInterpolationMethod

Interpolation method.

Enumerator
CVSIM_linear 

linear interpolation, at the border the last value is used

◆ CVSStdIlluminant

Standard Illumination.

Enumerator
CVSSI_UNDEFINED 

Undefined Standard Illuminant.

CVSSI_E 

Equal power Spectrum.

CVSSI_A 

Illuminant A.

CVSSI_D50 

Illuminant D50.

CVSSI_D65 

Illuminant D65.

◆ CVSStdObserver

Standard Observer.

Enumerator
CVSSO_UNDEFINED 

Undefined Standard Observer.

CVSSO_CIE2006_2deg 

2006 Observer with 2 deg

CVSSO_CIE2006_10deg 

2006 Observer with 10 deg

CVSSO_CIE1964_10deg 

1964 Observer with 10 deg

CVSSO_CIE1931_2deg 

1931 Observer with 2 deg

Function Documentation

◆ CVSConvertCubeToLab()

cvbres_t CVSConvertCubeToLab ( CVCOMPOSITE  ImageCube,
CVSINTERPOLATOR  Interpolator,
IMG ImageOut 
)

Converts the Cube to a Lab image.

Takes a normalized Image Cube and converts it to a Lab image

Parameters
[in]ImageCubeNormalized linear Cube with matching number of bands with the ones in Matching handle
[in]InterpolatorHandle contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant.
[in,out]ImageOutThis 3-planed float32 image contains the values of Lab (L-value in plane=0, a-value in plane=1, b-value in plane=2). This function supports two ways as the output:
  • ImageOut == NULL: A 3-planed image of datatype float will be created with the dimensions: samples x lines x 3 [width x height x planes]
  • ImageOut == Allocated image: Image needs to suppport linear access and be of datatype float / double with the dimensions: samples x lines x 3 [width x height x planes]. This image can be a mapped image
Returns
See also
CVSConvertCubeToXYZ CVSCreateInterpolator CVSConvertXYZToLab CVSCubeNormalize

◆ CVSConvertCubeToXYZ()

cvbres_t CVSConvertCubeToXYZ ( CVCOMPOSITE  ImageCube,
CVSINTERPOLATOR  Interpolator,
IMG ImageOut 
)

Converts the Cube to a XYZ image.

Takes a normalized image Cube and converts it to a XYZ image

Parameters
[in]ImageCubeNormalized linear Cube of matching number of bands with the ones in Matching handle
[in]InterpolatorHandle contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant.
[in,out]ImageOutThis 3-planed float32 image contains the values of XYZ (X-value in plane=0, Y-value in plane=1, Z-value in plane=2). This function supports two ways as the output:
  • ImageOut == NULL: A 3-planed image of datatype float will be created with the dimensions: samples x lines x 3 [width x height x planes]
  • ImageOut == Allocated image: Image needs to support linear access and be of datatype float / double with the dimensions: samples x lines x 3 [width x height x planes]. This image can be a mapped image
Returns
See also
CVSCreateInterpolator CVSConvertXYZToLab CVSConvertCubeToLab CVSCubeNormalize

◆ CVSConvertLabToRGB8()

cvbres_t CVSConvertLabToRGB8 ( IMG  ImageIn,
CVSINTERPOLATOR  Interpolator,
IMG ImageOut 
)

Converts a Lab image to a sRGB image.

Parameters
[in]ImageInLab image
[in]InterpolatorWhitepoint of the Standard Illuminant is used for the conversion algorithm
[out]ImageOutsRGB uint8 image
Returns
See also
CVSConvertXYZToLab

◆ CVSConvertXYZToLab()

cvbres_t CVSConvertXYZToLab ( IMG  ImageIn,
CVSINTERPOLATOR  Interpolator,
IMG ImageOut 
)

Converts an image from XYZ to Lab.

Parameters
[in]ImageIn3-planed image containing the XYZ-values
[in]InterpolatorWhitepoint of the Standard Illuminant is used for the conversion algorithm
[in,out]ImageOutTakes a NULL pointer and constructs an float32 image handle containing Lab-values. Dimensions and data type and will be equal to ImageIn
Returns
See also
CVSCreateInterpolator

◆ CVSCreateInterpolator()

cvbres_t CVSCreateInterpolator ( CVCOMPOSITE  ImageCube,
CVSStdObserver  Observer,
CVSStdIlluminant  Illuminant,
CVSInterpolationMethod  Interpolation,
CVSINTERPOLATOR &  Interpolator 
)

Creates an interpolator.

The interpolator is used to fit the wavelengths of the standard observer and the standard illuminant to the wavelengths in the Cube. As reference wavelengths the values of CVSFI_Wavelength in the cube metadata are used.

Internally the color matching functions are defined in the range:

  • 2006 2deg: [390 nm, 830 nm] in 0.1 nm steps
  • 2006 10deg: [390 nm, 830 nm] in 0.1 nm steps
  • 1964 10deg: [360 nm, 380 nm] in 5 nm steps
  • 1931 2deg: [380 nm, 825 nm] in 5 nm steps

The standard illuminant are defined in the range:

  • Standard A: [300 nm, 830 nm] in 1 nm steps
  • Standard D50: [300 nm, 780 nm] in 5 nm steps
  • Standard D65: [300 nm, 830 nm] in 1 nm steps
  • Standard E: [300 nm, 830 nm] in a 530 nm step (this spectrum is even for the whole spectrum)
Parameters
[in]ImageCubeMetadata needs to contain wavelength info
[in]ObserverStandard observer used to access predefined Color Matching functions for the Lab and XYZ Conversion
[in]IlluminantStandard illuminant used to access the predefined relative spectral power distribution for the Lab and XYZ Conversion
[in]InterpolationInterpolation method used for the color matching function and illuminant spectrum
[in,out]InterpolatorHandle contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant
Returns
See also
CVSConvertCubeToLab CVSConvertXYZToLab CVSInterpolatorGetObserver CVSInterpolatorGetIlluminant CVSInterpolatorGetWavelengths

◆ CVSInterpolatorGetIlluminant()

cvbres_t CVSInterpolatorGetIlluminant ( CVSINTERPOLATOR  Interpolator,
CVSStdIlluminant Illuminant 
)

Retrieves the standard illuminant in the matching handle.

Getter function for the Standard Illuminant enum

Parameters
[in]InterpolatorHandle contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant
[out]IlluminantStandard illuminant used to access the predefined relative spectral power distribution for the Lab and XYZ Conversion
Returns
See also
CVSCreateInterpolator CVSConvertCubeToLab CVSConvertXYZToLab CVSInterpolatorGetWavelengths CVSInterpolatorGetObserver

◆ CVSInterpolatorGetObserver()

cvbres_t CVSInterpolatorGetObserver ( CVSINTERPOLATOR  Interpolator,
CVSStdObserver Observer 
)

Retrieves the standard observer in the matching handle.

Getter function for the Standard Observer enum

Parameters
[in]InterpolatorHandle contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant
[out]ObserverStandard observer used to access predefined Color Matching functions for the Lab and XYZ Conversion
Returns
See also
CVSCreateInterpolator CVSConvertCubeToLab CVSConvertXYZToLab CVSInterpolatorGetWavelengths CVSInterpolatorGetIlluminant

◆ CVSInterpolatorGetWavelengths()

cvbres_t CVSInterpolatorGetWavelengths ( CVSINTERPOLATOR  Interpolator,
double  WavelengthArray[],
size_t &  NumberOfWavelengths 
)

Retrieves the wavelengths of the illuminant spectrum.

Getter function for the illuminant's wavelengths

Parameters
[in]InterpolatorHandle contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant
[in,out]WavelengthArrayWavelengths of the illuminant as double array. To get the array size set WavelengthArray to nullptr
[in,out]NumberOfWavelengthsNumber of wavelengths in WavelengthArray. To get the array size set WavelengthArray to nullptr
Returns
See also
CVSCreateInterpolator CVSConvertCubeToLab CVSConvertXYZToLab CVSInterpolatorGetIlluminant CVSInterpolatorGetObserver