CVB++ 14.0
Interpolator Class Referencefinal

Spectral Interpolator object. More...

#include <cvb/spectral/interpolator.hpp>

Public Member Functions

Spectral::StdObserver StdObserver () const
 Retrieves the standard observer from the interpolator object. More...
 
Spectral::StdIlluminant StdIlluminant () const
 Retrieves the standard illuminant from the interpolator object. More...
 
std::vector< double > Wavelengths () const
 Retrieves the wavelengths of the illuminant spectrum. More...
 
void * Handle () const noexcept
 Returns C-API style handle to the Interpolator. More...
 

Static Public Member Functions

static std::unique_ptr< InterpolatorCreate (const Cube &cube, StdObserver stdObserver, StdIlluminant stdIlluminant, InterpolationMethod interpolationMethod)
 Creates an Interpolator object. More...
 
static std::unique_ptr< InterpolatorFromHandle (HandleGuard< Interpolator > &&guard)
 Creates Interpolator from a classic API Interpolator handle. More...
 

Detailed Description

Spectral Interpolator object.

Member Function Documentation

◆ Create()

static std::unique_ptr< Interpolator > Create ( const Cube cube,
StdObserver  stdObserver,
StdIlluminant  stdIlluminant,
InterpolationMethod  interpolationMethod 
)
inlinestatic

Creates an Interpolator object.

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]cubeMetadata needs to contain wavelength info
[in]stdObserverStandard observer used to access predefined Color Matching functions for the Lab and XYZ Conversion
[in]stdIlluminantStandard illuminant used to access the predefined relative spectral power distribution for the Lab and XYZ Conversion
[in]interpolationMethodInterpolation method used for the color matching function and illuminant spectrum
Returns
Object contains the interpolated values of the relative spectral power distribution from color matching functions and standard illuminant.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Wavelengths StdIlluminant StdObserver
Examples
Spectral/ColorConvert.

◆ FromHandle()

static std::unique_ptr< Interpolator > FromHandle ( HandleGuard< Interpolator > &&  guard)
inlinestatic

Creates Interpolator from a classic API Interpolator handle.

The Interpolator takes ownership of the handle, so you must share it before using this function.

Parameters
[in]guardLife time guard for C-API handle.
Returns
The Cube created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Handle Create

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Returns C-API style handle to the Interpolator.

Returns
C-API handle
See also
FromHandle

◆ StdIlluminant()

Retrieves the standard illuminant from the interpolator object.

Returns
Standard illuminant used to access the predefined relative spectral power distribution for the Lab and XYZ Conversion.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Wavelengths StdObserver

◆ StdObserver()

Retrieves the standard observer from the interpolator object.

Returns
Standard observer used to access predefined Color Matching functions for the Lab and XYZ Conversion.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
Wavelengths StdIlluminant

◆ Wavelengths()

std::vector< double > Wavelengths ( ) const
inline

Retrieves the wavelengths of the illuminant spectrum.

Returns
Wavelengths of the illuminant spectrum.
Exceptions
Anyexception derived from std::exception including CvbException.
See also
StdIlluminant StdObserver