19 #include <type_traits> 43 float facGB,
float facBB)
83 static typename std::enable_if<!std::numeric_limits<T>::is_integer,
bool>::type isEqual(T x, T y)
85 return std::fabs(x - y) <= std::numeric_limits<T>::epsilon();
143 float Saturation()
const;
152 float SaturationMin()
const;
161 float SaturationMax()
const;
170 void SetSaturation(
float saturation);
194 void ProcessInPlace(
Image& image)
const;
228 *
this = std::move(other);
236 m_backendHandle = other.m_backendHandle;
237 other.m_backendHandle =
nullptr;
247 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors));
253 size_t colorCorrectorFactorsSize = 0;
257 m_backendHandle,
nullptr, &colorCorrectorFactorsSize);
264 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors), &colorCorrectorFactorsSize);
267 return colorCorrectorFactors;
272 size_t colorCorrectorFactorsSize = 0;
276 m_backendHandle,
nullptr, &colorCorrectorFactorsSize);
283 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors), &colorCorrectorFactorsSize);
286 return colorCorrectorFactors;
295 m_backendHandle, reinterpret_cast<float*>(&saturation));
307 m_backendHandle, reinterpret_cast<float*>(&saturationMin));
310 return saturationMin;
319 m_backendHandle, reinterpret_cast<float*>(&saturationMax));
322 return saturationMax;
329 m_backendHandle, saturation);
339 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormatName),
340 reinterpret_cast<PEAK_IPL_BOOL8*>(&isPixelFormatSupported));
343 return isPixelFormatSupported > 0;
350 m_backendHandle, ImageBackendAccessor::BackendHandle(image));
359 m_backendHandle, ImageBackendAccessor::BackendHandle(inputImage), &outputImageHandle);
362 return ImageBackendAccessor::CreateImage(outputImageHandle);
struct PEAK_IPL_COLOR_CORRECTOR * PEAK_IPL_COLOR_CORRECTOR_HANDLE
Definition: peak_ipl_backend.h:314
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_SetColorCorrectionFactors(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float *colorCorrectorFactors)
Sets the factors of the color correction matrix.
Applies a 3x3 color correction matrix to the data.
Definition: peak_ipl_color_corrector.hpp:92
float factorGB
Definition: peak_ipl_color_corrector.hpp:78
#define PEAK_IPL_C_ABI_PREFIX
Definition: peak_ipl_dll_defines.h:16
The Factors of the Color Correction Matrix.
Definition: peak_ipl_color_corrector.hpp:40
PixelFormatName
Enum holding the possible pixel format names.
Definition: peak_ipl_simple_types.hpp:38
bool IsPixelFormatSupported(PixelFormatName pixelFormatName) const
Returns whether the color corrector supports the given pixel format.
Definition: peak_ipl_color_corrector.hpp:333
float factorGG
Definition: peak_ipl_color_corrector.hpp:75
float factorBR
Definition: peak_ipl_color_corrector.hpp:73
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_GetColorCorrectionFactors(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float *colorCorrectorFactors, size_t *colorCorrectorFactorsSize)
Returns the color corrector 3x3 matrix factors and its size.
The "peak::ipl" namespace contains the whole image processing library.
Definition: peak_ipl_binning.hpp:22
ColorCorrectionFactors & operator=(ColorCorrectionFactors &&o)=default
Image Process(const Image &inputImage) const
Corrects the colors of the given image by applying a 3x3 color correction matrix to the data...
Definition: peak_ipl_color_corrector.hpp:354
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_GetSaturation(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float *saturation)
Returns the color saturation value.
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_Construct(PEAK_IPL_COLOR_CORRECTOR_HANDLE *colorCorrectorHandle)
Creates a color corrector.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition: peak_ipl_exception.hpp:182
float factorRG
Definition: peak_ipl_color_corrector.hpp:74
Stores the pixel format, width and height of an image and the pointer to the image buffer...
Definition: peak_ipl_image.hpp:39
peak::ipl::ColorCorrectionFactors ColorCorrectionFactors()
Returns the factors of the color correction matrix.
Definition: peak_ipl_color_corrector.hpp:251
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_ProcessInPlace(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, PEAK_IPL_IMAGE_HANDLE imageHandle)
Corrects the colors of the given image.
float factorGR
Definition: peak_ipl_color_corrector.hpp:72
~ColorCorrector()
Definition: peak_ipl_color_corrector.hpp:218
float factorRB
Definition: peak_ipl_color_corrector.hpp:77
struct PEAK_IPL_IMAGE * PEAK_IPL_IMAGE_HANDLE
Definition: peak_ipl_backend.h:326
void SetSaturation(float saturation)
Sets the color saturation value.
Definition: peak_ipl_color_corrector.hpp:325
ColorCorrectionFactors()=default
ColorCorrectionFactors(float facRR, float facGR, float facBR, float facRG, float facGG, float facBG, float facRB, float facGB, float facBB)
Definition: peak_ipl_color_corrector.hpp:42
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_Process(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_IMAGE_HANDLE *outputImageHandle)
Corrects the colors of the given image.
float SaturationMin() const
Returns the minimum color saturation value.
Definition: peak_ipl_color_corrector.hpp:301
~ColorCorrectionFactors()=default
int8_t PEAK_IPL_BOOL8
Definition: peak_ipl_backend.h:25
float factorBG
Definition: peak_ipl_color_corrector.hpp:76
float factorBB
Definition: peak_ipl_color_corrector.hpp:79
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_Destruct(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle)
Destroys the color corrector associated with the given handle.
float SaturationMax() const
Returns the maximum color saturation value.
Definition: peak_ipl_color_corrector.hpp:313
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_GetSaturationMax(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float *saturationMax)
Returns the maximum color saturation value.
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_GetSaturationMin(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float *saturationMin)
Returns the minimum color saturation value.
void ProcessInPlace(Image &image) const
Corrects the colors of the given image by applying a 3x3 color correction matrix to the data in place...
Definition: peak_ipl_color_corrector.hpp:346
void SetColorCorrectionFactors(peak::ipl::ColorCorrectionFactors colorCorrectorFactors)
Sets the values of the color correction matrix.
Definition: peak_ipl_color_corrector.hpp:243
float Saturation() const
Returns the color saturation value.
Definition: peak_ipl_color_corrector.hpp:289
ColorCorrector & operator=(const ColorCorrector &other)=delete
ColorCorrector()
Definition: peak_ipl_color_corrector.hpp:213
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_SetSaturation(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float saturation)
Sets the color saturation value.
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_GetIsPixelFormatSupported(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, PEAK_IPL_PIXEL_FORMAT pixelFormat, PEAK_IPL_BOOL8 *isPixelFormatSupported)
Asks the given color corrector whether it supports the given pixel format.
float factorRR
Definition: peak_ipl_color_corrector.hpp:71
bool operator==(const ColorCorrectionFactors &other) const
Definition: peak_ipl_color_corrector.hpp:62