8 #ifndef META_OCEAN_CV_ADVANCED_COLOR_CHANNEL_CURVE_H
9 #define META_OCEAN_CV_ADVANCED_COLOR_CHANNEL_CURVE_H
70 static inline Scalar linearizeSRGB(
const unsigned char value);
84 static inline Scalar identity(
const unsigned char value);
91 static unsigned char inline delinearizeSRGB(
const Scalar value);
98 inline Scalar operator()(
const unsigned char value)
const;
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);
154 return c *
Scalar(0.07739938080495357);
161 if (value <=
Scalar(0.03928))
162 return value *
Scalar(0.07739938080495357);
Implements a look-up table to perform fast transformations on a single color channel.
Definition: ColorChannelCurve.h:31
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.
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
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.
TransformationType
Represents a specific color channel transformation.
Definition: ColorChannelCurve.h:44
@ 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:3456
static T pow(const T x, const T y)
Returns x raised to the power of y.
Definition: Numeric.h:1860
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15