3 #include "../_cexports/c_spectral.h" 4 #include "spectral.hpp" 12 inline HandleGuard<Spectral::Interpolator>::HandleGuard(
void * handle) noexcept
13 : HandleGuard<Spectral::Interpolator>(handle, [](
void* handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
57 return Internal::DoResCallObjectOut<Interpolator>([&](
void* & obj)
59 return CVB_CALL_CAPI(CVSCreateInterpolator(cube.
Handle()
60 , static_cast<CExports::CVSStdObserver>(stdObserver)
61 , static_cast<CExports::CVSStdIlluminant>(stdIlluminant)
62 , static_cast<CExports::CVSInterpolationMethod>(interpolationMethod)
76 auto cVal = Internal::DoResCallValueOut<CExports::CVSStdObserver>([&](CExports::CVSStdObserver val)
78 return CVB_CALL_CAPI(CVSInterpolatorGetObserver(this->
Handle(), val));
80 return static_cast<Spectral::StdObserver>(cVal);
92 auto cVal = Internal::DoResCallValueOut<CExports::CVSStdIlluminant>([&](CExports::CVSStdIlluminant val)
94 return CVB_CALL_CAPI(CVSInterpolatorGetIlluminant(this->
Handle(), val));
96 return static_cast<Spectral::StdIlluminant>(cVal);
109 CVB_CALL_CAPI_CHECKED(CVSInterpolatorGetWavelengths(this->
Handle()
110 , reinterpret_cast<double*>(NULL), sz));
112 CVB_CALL_CAPI_CHECKED(CVSInterpolatorGetWavelengths(this->
Handle()
113 , waves.data(), sz));
125 return handle_.Handle();
147 Interpolator(HandleGuard<Interpolator>&& guard) noexcept
148 : handle_(std::move(guard))
153 : handle_(std::move(other.handle_))
157 Interpolator & operator=(Interpolator && other) =
default;
160 HandleGuard<Interpolator> handle_;
164 using Spectral::Interpolator;
void * Handle() const noexcept
Returns C-API style handle to the Cube.
Definition: cube.hpp:366
StdObserver
Defines Standard Observer.
Definition: spectral.hpp:260
StdIlluminant
Defines Standard Illumination.
Definition: spectral.hpp:245
Spectral Interpolator object.
Definition: interpolator.hpp:22
static std::unique_ptr< Interpolator > FromHandle(HandleGuard< Interpolator > &&guard)
Creates Interpolator from a classic API Interpolator handle.
Definition: interpolator.hpp:138
static std::unique_ptr< Interpolator > Create(const Cube &cube, StdObserver stdObserver, StdIlluminant stdIlluminant, InterpolationMethod interpolationMethod)
Creates an Interpolator object.
Definition: interpolator.hpp:52
Spectral Cube object.
Definition: cube.hpp:50
Root namespace for the Image Manager interface.
Definition: version.hpp:11
Spectral::StdIlluminant StdIlluminant() const
Retrieves the standard illuminant from the interpolator object.
Definition: interpolator.hpp:90
InterpolationMethod
Defines the interpolation method.
Definition: spectral.hpp:275
void * Handle() const noexcept
Returns C-API style handle to the Interpolator.
Definition: interpolator.hpp:123
std::vector< double > Wavelengths() const
Retrieves the wavelengths of the illuminant spectrum.
Definition: interpolator.hpp:106
Spectral::StdObserver StdObserver() const
Retrieves the standard observer from the interpolator object.
Definition: interpolator.hpp:74