8#ifndef META_OCEAN_CV_ADVANCED_COLOR_CHANNEL_CURVE_H
9#define META_OCEAN_CV_ADVANCED_COLOR_CHANNEL_CURVE_H
126 ocean_assert(value >= 0 && value <= 1);
128 if (value <=
Scalar(0.00304))
132 ocean_assert(c >= 0 && c <= 1);
139 ocean_assert(c >= 0 && c <= 1);
146 return value *
Scalar(0.00392156862745098);
155 return c *
Scalar(0.07739938080495357);
165 if (value <=
Scalar(0.03928))
167 return value *
Scalar(0.07739938080495357);
static Scalar identity(const unsigned char value)
Returns the input values unmodified.
Definition ColorChannelCurve.h:144
Scalar transformData[256]
Maps byte-sized input color values between 0 and 255 to the specified output value.
Definition ColorChannelCurve.h:111
ColorChannelCurve(const TransformationType type)
Creates a new color channel curve using the specified transformation function preset.
static unsigned char delinearizeSRGB(const Scalar value)
Delinearizes a given component of an sRGB triplet.
Definition ColorChannelCurve.h:124
void setTransformation(const TransformationFunction &transformFunction)
Sets the look-up-table using the specified transformation function.
Callback< Scalar, unsigned char > TransformationFunction
Callback function type that returns a floating point value for the specified unsigned char input colo...
Definition ColorChannelCurve.h:38
TransformationType
Represents a specific color channel transformation.
Definition ColorChannelCurve.h:44
@ TT_LINEAR_SRGB
Delinearization of SRGB values.
Definition ColorChannelCurve.h:48
@ TT_IDENTITY
Returns input unmodified.
Definition ColorChannelCurve.h:46
static Scalar linearizeSRGB(const unsigned char value)
Linearizes a given component of an sRGB triplet.
Definition ColorChannelCurve.h:149
Scalar operator()(const unsigned char value) const
Transform a byte-sized color component using the transformation function implemented as look-up table...
Definition ColorChannelCurve.h:119
This class implements a container for callback functions.
Definition Callback.h:3454
static Scalar pow(const Scalar x, const Scalar y)
float Scalar
Definition of a scalar type.
Definition Math.h:129
Namespace of the CV Advanced library.
Definition Advanced.h:20
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15