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();
158 void ProcessInPlace(
Image& image)
const;
189 *
this = std::move(other);
197 m_backendHandle = other.m_backendHandle;
198 other.m_backendHandle =
nullptr;
208 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors));
214 size_t colorCorrectorFactorsSize = 0;
218 m_backendHandle,
nullptr, &colorCorrectorFactorsSize);
225 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors), &colorCorrectorFactorsSize);
228 return colorCorrectorFactors;
233 size_t colorCorrectorFactorsSize = 0;
237 m_backendHandle,
nullptr, &colorCorrectorFactorsSize);
244 m_backendHandle, reinterpret_cast<float*>(&colorCorrectorFactors), &colorCorrectorFactorsSize);
247 return colorCorrectorFactors;
256 static_cast<PEAK_IPL_PIXEL_FORMAT>(pixelFormatName),
257 reinterpret_cast<PEAK_IPL_BOOL8*>(&isPixelFormatSupported));
260 return isPixelFormatSupported > 0;
267 m_backendHandle, ImageBackendAccessor::BackendHandle(image));
276 m_backendHandle, ImageBackendAccessor::BackendHandle(inputImage), &outputImageHandle);
279 return ImageBackendAccessor::CreateImage(outputImageHandle);
struct PEAK_IPL_COLOR_CORRECTOR * PEAK_IPL_COLOR_CORRECTOR_HANDLE
Definition: peak_ipl_backend.h:215
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:250
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_color_corrector.hpp:30
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:271
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:128
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:37
peak::ipl::ColorCorrectionFactors ColorCorrectionFactors()
Returns the factors of the color correction matrix.
Definition: peak_ipl_color_corrector.hpp:212
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:182
float factorRB
Definition: peak_ipl_color_corrector.hpp:77
struct PEAK_IPL_IMAGE * PEAK_IPL_IMAGE_HANDLE
Definition: peak_ipl_backend.h:227
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.
~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.
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:263
void SetColorCorrectionFactors(peak::ipl::ColorCorrectionFactors colorCorrectorFactors)
Sets the values of the color correction matrix.
Definition: peak_ipl_color_corrector.hpp:204
ColorCorrector & operator=(const ColorCorrector &other)=delete
ColorCorrector()
Definition: peak_ipl_color_corrector.hpp:177
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