IDS peak IPL v1.16.1
Loading...
Searching...
No Matches
peak_ipl_chromatic_adaption.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
17
21namespace peak
22{
23namespace ipl
24{
212
219
221{
222 if (m_backendHandle)
223 {
225 }
226}
227
229{
230 if (other.m_backendHandle)
231 {
233 [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_ChromaticAdapter_Acquire(other.m_backendHandle); });
234 }
235
236 m_backendHandle = other.m_backendHandle;
237}
238
240{
241 if (this != &other)
242 {
243 if (m_backendHandle)
244 {
246 }
247
248 if (other.m_backendHandle)
249 {
251 [&] { return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_ChromaticAdapter_Acquire(other.m_backendHandle); });
252 }
253 }
254
255 m_backendHandle = other.m_backendHandle;
256
257 return *this;
258}
259
261{
262 *this = std::move(other);
263}
264
266{
267 if (this != &other)
268 {
269 if (m_backendHandle != nullptr)
270 {
272 }
273
274 m_backendHandle = other.m_backendHandle;
275 other.m_backendHandle = nullptr;
276 }
277
278 return *this;
279}
280
282{
283 ColorSpace colorSpace{};
284
287 m_backendHandle, reinterpret_cast<PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE*>(&colorSpace));
288 });
289
290 return colorSpace;
291}
292
300
302{
303 Algorithm algorithm{};
304
307 m_backendHandle, reinterpret_cast<PEAK_IPL_CHROMATIC_ADAPTER_ALGORITHM*>(&algorithm));
308 });
309
310 return algorithm;
311}
312
320
322 const ColorCorrectionFactors& correctionFactors) const
323{
324 ColorCorrectionFactors correctionFactorsCalculated{};
327 m_backendHandle, colorTemperature, reinterpret_cast<const float*>(&correctionFactors),
328 reinterpret_cast<float*>(&correctionFactorsCalculated));
329 });
330
331 return correctionFactorsCalculated;
332}
333
335{
336 uint32_t minTemp{};
337 uint32_t maxTemp{};
338 uint32_t incTemp{};
340 return PEAK_IPL_C_ABI_PREFIX PEAK_IPL_ChromaticAdapter_GetTemperatureRange(m_backendHandle, &minTemp, &maxTemp, &incTemp);
341 });
342
343 return Range<uint32_t>{minTemp, maxTemp, incTemp};
344}
345
346} /* namespace ipl */
347} /* namespace peak */
Adjust to changes in lighting conditions to maintain consistent color perception despite variations i...
Definition peak_ipl_chromatic_adaption.hpp:39
void SetTargetColorSpace(ColorSpace colorSpace)
Set the target color space.
Definition peak_ipl_chromatic_adaption.hpp:293
ChromaticAdapter()
Constructor for a new Chromatic Adapter instance.
Definition peak_ipl_chromatic_adaption.hpp:213
Range< uint32_t > TemperatureRange() const
Returns the allowed temperature range for the current combination of color space and algorithm.
Definition peak_ipl_chromatic_adaption.hpp:334
Algorithm
Enumeration that defines the available chromatic adaption algorithms.
Definition peak_ipl_chromatic_adaption.hpp:73
@ Legacy
Definition peak_ipl_chromatic_adaption.hpp:75
@ Bradford
Definition peak_ipl_chromatic_adaption.hpp:78
ColorSpace
Enumeration that defines the available color spaces.
Definition peak_ipl_chromatic_adaption.hpp:49
@ SRGB_D50
sRGB (standard RGB): standard illuminant D50 (5000 K), gamma 2.2.
Definition peak_ipl_chromatic_adaption.hpp:51
@ SRGB_D65
sRGB (standard RGB): standard illuminant D65 (6500 K), gamma 2.2.
Definition peak_ipl_chromatic_adaption.hpp:54
@ Adobe_RGB_D65
Adobe RGB: standard illuminant D65 (6500 K), gamma 2.2.
Definition peak_ipl_chromatic_adaption.hpp:63
@ CIE_RGB_E
CIE-RGB: standard illuminant E (equal energy distribution), gamma 2.2.
Definition peak_ipl_chromatic_adaption.hpp:57
@ ECI_RGB_D50
ECI-RGB: standard illuminant D50 (5000 K), gamma 1.8.
Definition peak_ipl_chromatic_adaption.hpp:60
ChromaticAdapter & operator=(const ChromaticAdapter &other)
Copy assigment for Chromatic Adapter instance.
Definition peak_ipl_chromatic_adaption.hpp:239
ColorSpace TargetColorSpace() const
Get the target color space.
Definition peak_ipl_chromatic_adaption.hpp:281
void SetAdaptionAlgorithm(Algorithm algorithm)
Set the algorithm used for chromatic adaption.
Definition peak_ipl_chromatic_adaption.hpp:313
~ChromaticAdapter()
Destructor for the Chromatic Adapter.
Definition peak_ipl_chromatic_adaption.hpp:220
Algorithm AdaptionAlgorithm() const
Get the current algorithm used for chromatic adaption.
Definition peak_ipl_chromatic_adaption.hpp:301
ColorCorrectionFactors CalculateColorCorrectionMatrix(uint32_t colorTemperature, const ColorCorrectionFactors &correctionFactors=ColorCorrectionFactors::Identity()) const
Calculate the color correction factors for colorTemperature using the current algorithm and color spa...
Definition peak_ipl_chromatic_adaption.hpp:321
Range support and convenience class.
Definition peak_ipl_range.hpp:31
Definition peak_ipl_binning.hpp:25
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition peak_ipl_exception.hpp:182
The "peak::ipl" namespace contains the whole image processing library.
Definition peak_ipl_binning.hpp:23
#define PEAK_IPL_NO_DISCARD
Definition peak_ipl_attribute_defines.h:25
@ PEAK_IPL_CHROMATIC_ADAPTER_ALGORITHM_BRADFORD
Definition peak_ipl_backend.h:367
@ PEAK_IPL_CHROMATIC_ADAPTER_ALGORITHM_LEGACY
Definition peak_ipl_backend.h:366
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_GetTargetColorSpace(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle, PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE *colorSpace)
Get the current target color space for the chromatic adapter instance.
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_Destruct(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle)
Destroys the chromatic adapter object associated with the given handle.
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_GetTemperatureRange(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle, uint32_t *minTemperature, uint32_t *maxTemperature, uint32_t *incTemperature)
Possible temperature range for the chromatic adapter instance.
@ PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE_CIE_RGB_E
Definition peak_ipl_backend.h:358
@ PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE_ADOBE_RGB_D65
Definition peak_ipl_backend.h:360
@ PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE_SRGB_D65
Definition peak_ipl_backend.h:357
@ PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE_SRGB_D50
Definition peak_ipl_backend.h:356
@ PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE_ECI_RGB_D50
Definition peak_ipl_backend.h:359
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_CalculateColorCorrectionMatrix(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle, uint32_t temperature, const float *colorCorrectionMatrixInput, float *colorCorrectionMatrixOutput)
Calculate the color correction matrix for the chromatic adapter instance.
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_SetTargetColorSpace(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle, PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE colorSpace)
Set the target color space for the chromatic adapter instance.
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_SetAdaptionAlgorithm(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle, PEAK_IPL_CHROMATIC_ADAPTER_ALGORITHM model)
Set the model for the chromatic adapter instance.
uint16_t PEAK_IPL_CHROMATIC_ADAPTER_ALGORITHM
Definition peak_ipl_backend.h:369
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_Construct(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE *handle)
Creates a chromatic adapter object.
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_GetAdaptionAlgorithm(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle, PEAK_IPL_CHROMATIC_ADAPTER_ALGORITHM *algorithm)
Get the current model for the chromatic adapter instance.
PEAK_IPL_C_API PEAK_IPL_ChromaticAdapter_Acquire(PEAK_IPL_CHROMATIC_ADAPTER_HANDLE handle)
Increase the reference count of a chromatic adapter object.
uint16_t PEAK_IPL_CHROMATIC_ADAPTER_COLOR_SPACE
Definition peak_ipl_backend.h:362
struct PEAK_IPL_CHROMATIC_ADAPTER * PEAK_IPL_CHROMATIC_ADAPTER_HANDLE
Definition peak_ipl_backend.h:433
#define PEAK_IPL_C_ABI_PREFIX
Definition peak_ipl_dll_defines.h:16
The Factors of the Color Correction Matrix.
Definition peak_ipl_color_correction_factors.hpp:32
static constexpr ColorCorrectionFactors Identity()
Create an identity matrix.
Definition peak_ipl_color_correction_factors.hpp:182