19 #include <type_traits> 67 float facGB,
float facBB)
147 return (isEqual(factorRR, other.factorRR) && isEqual(
factorGR, other.
factorGR)
166 static typename std::enable_if<!std::numeric_limits<T>::is_integer,
bool>::type isEqual(T x, T y)
168 return std::fabs(x - y) <= std::numeric_limits<T>::epsilon();
308 void SetSaturation(
float saturation);
332 void ProcessInPlace(
Image& image)
const;
366 if (other.m_backendHandle)
371 m_backendHandle = other.m_backendHandle;
383 if (other.m_backendHandle)
390 m_backendHandle = other.m_backendHandle;
397 *
this = std::move(other);
404 if (m_backendHandle !=
nullptr)
408 m_backendHandle = other.m_backendHandle;
409 other.m_backendHandle =
nullptr;
419 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors));
425 size_t colorCorrectorFactorsSize = 0;
429 m_backendHandle,
nullptr, &colorCorrectorFactorsSize);
436 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors), &colorCorrectorFactorsSize);
439 return colorCorrectorFactors;
444 size_t colorCorrectorFactorsSize = 0;
448 m_backendHandle,
nullptr, &colorCorrectorFactorsSize);
455 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors), &colorCorrectorFactorsSize);
458 return colorCorrectorFactors;
461 inline float ColorCorrector::Saturation()
const 467 m_backendHandle, reinterpret_cast<float*>(&saturation));
473 inline float ColorCorrector::SaturationMin()
const 479 m_backendHandle, reinterpret_cast<float*>(&saturationMin));
482 return saturationMin;
485 inline float ColorCorrector::SaturationMax()
const 491 m_backendHandle, reinterpret_cast<float*>(&saturationMax));
494 return saturationMax;
501 m_backendHandle, saturation);
505 inline bool ColorCorrector::IsPixelFormatSupported(
PixelFormatName pixelFormatName)
const 511 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormatName),
512 reinterpret_cast<PEAK_IPL_BOOL8*>(&isPixelFormatSupported));
515 return isPixelFormatSupported > 0;
522 m_backendHandle, ImageBackendAccessor::BackendHandle(image));
526 inline Image ColorCorrector::Process(
const Image& inputImage)
const 531 m_backendHandle, ImageBackendAccessor::BackendHandle(inputImage), &outputImageHandle);
534 return ImageBackendAccessor::CreateImage(outputImageHandle);
#define PEAK_IPL_NO_DISCARD
Definition: peak_ipl_backend.h:26
struct PEAK_IPL_COLOR_CORRECTOR * PEAK_IPL_COLOR_CORRECTOR_HANDLE
Definition: peak_ipl_backend.h:345
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:175
float factorGB
Green-Blue Factor.
Definition: peak_ipl_color_corrector.hpp:161
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_Acquire(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle)
Increase the reference count of a color corrector.
#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
float factorGG
Green-Green Factor.
Definition: peak_ipl_color_corrector.hpp:158
float factorBR
Blue-Red Factor.
Definition: peak_ipl_color_corrector.hpp:156
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
PixelFormatName
Enum holding the possible pixel format names.
Definition: peak_ipl_simple_types.hpp:38
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
Red-Green Factor.
Definition: peak_ipl_color_corrector.hpp:157
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_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
Green-Red Factor.
Definition: peak_ipl_color_corrector.hpp:155
~ColorCorrector()
Destructor for the ColorCorrector instance.
Definition: peak_ipl_color_corrector.hpp:356
float factorRB
Red-Blue Factor.
Definition: peak_ipl_color_corrector.hpp:160
struct PEAK_IPL_IMAGE * PEAK_IPL_IMAGE_HANDLE
Definition: peak_ipl_backend.h:357
ColorCorrector & operator=(const ColorCorrector &other)
Copy assigment for ColorCorrector instance.
Definition: peak_ipl_color_corrector.hpp:374
void SetSaturation(float saturation)
Sets the color saturation value.
Definition: peak_ipl_color_corrector.hpp:497
ColorCorrectionFactors()=default
Constructor for a new ColorCorrectionFactors instance.
ColorCorrectionFactors(float facRR, float facGR, float facBR, float facRG, float facGG, float facBG, float facRB, float facGB, float facBB)
Constructor for a new ColorCorrectionFactors instance.
Definition: peak_ipl_color_corrector.hpp:66
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.
~ColorCorrectionFactors()=default
Destructor for the ColorCorrectionFactors instance.
int8_t PEAK_IPL_BOOL8
Definition: peak_ipl_backend.h:41
float factorBG
Blue-Green Factor.
Definition: peak_ipl_color_corrector.hpp:159
float factorBB
Blue-Blue Factor.
Definition: peak_ipl_color_corrector.hpp:162
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_Destruct(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle)
Destroys the color corrector associated with the given handle.
bool operator==(const Sharpness::SharpnessROI &lhs, const Sharpness::SharpnessROI &rhs)
Definition: peak_ipl_sharpness.hpp:419
PEAK_IPL_C_API PEAK_IPL_ColorCorrector_GetSaturationMax(PEAK_IPL_COLOR_CORRECTOR_HANDLE colorCorrectorHandle, float *saturationMax)
Returns the maximum color saturation value.
ColorCorrectionFactors & operator=(const ColorCorrectionFactors &o)=default
Copy assigment for ColorCorrectionFactors instance.
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:518
void SetColorCorrectionFactors(peak::ipl::ColorCorrectionFactors colorCorrectorFactors)
Sets the values of the color correction matrix.
Definition: peak_ipl_color_corrector.hpp:415
ColorCorrector()
Constructor for a new ColorCorrector instance.
Definition: peak_ipl_color_corrector.hpp:351
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.