13#ifndef ML_LUTITERATOR_H
14#define ML_LUTITERATOR_H
104 return _index >= _width;
233 chn[
L][2] = chn[
L][1] = chn[
L][0];
240 LUTConvertRGBtoL(
static_cast<double>(*chn[
R]),
static_cast<double>(*chn[
G]),
static_cast<double>(*chn[
B])));
247 (this->*_incConvert)();
248 (this->*_incPointers)();
256 IncrementFnc
_inc, _incConvert, _incPointers;
303 _incConvert =
nullptr;
304 _incPointers =
nullptr;
311 _dummy =
new T[MAX_CHANNELS];
312 chn =
new T*[MAX_CHANNELS];
313 for (
int i = 0;
i < MAX_CHANNELS;
i++)
323 switch (_convMethodId) {
336 switch (_incMethodId) {
369 switch (
lutData.getVisualType()) {
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
LUT iterator base class with type independent functionality and declarations.
ConvMethod
Conversion method id.
int operator()(void) const
Get current index (zero based)
virtual ~LUTIteratorBase()
Destructor (declared here to make it virtual)
int _incMethodId
Pointer increment method id (= number of channel pointers to increment)
bool _valid
Iterator valid flag.
bool alphaNeedsInit(void) const
Alpha channel needs initialization.
int getWidth(void) const
Get LUT width.
LUTVisualType getTargetType(void) const
Get visual type used for storing (target type)
LUTVisualType _vtFrom
Source visual type, used by the LUT being rendered.
int getLayer(void) const
Get current layer.
int _width
Width of LUTData object.
bool isValid(void) const
Is iterator valid?
bool _initAlpha
Alpha channel needs initialization.
LUTIteratorBase(LUTVisualType vtFrom, LUTVisualType vtTo, int width, int row, int layer)
Constructor (protected, class can only be used by derived classes)
LUTVisualType getSourceType(void) const
Get visual type used for rendering (source type)
int getRow(void) const
Get current row.
LUTVisualType _vtTo
Target visual type, used by the LUTData object storing the rendered LUT.
int getNumChannels(void) const
Get number of (source) channels.
bool atEnd(void) const
End of index range reached?
The LUTIterator class template is used by a LUTFunction object for rendering into a LUTData object.
void convertLtoRGB(void)
Convert Luminance to RGB.
IncrementFnc _inc
Increment method pointers.
void clear(void)
Clean up.
T * _dummy
Dummy channel entries.
LUTIterator(LUTVisualType visualType, LUTData< T > &lutData)
Constructor for addressing a 1D-LUT visualType is the type of the LUT being rendered,...
void operator++(void)
Increment operator.
T ** chn
Channel pointer array.
void convertAndInc(void)
Increment method including conversion.
~LUTIterator() override
Destructor.
void inc1(void)
! Increment methods
void convertRGBtoL(void)
Convert RGB to Luminance.
int _dpLut
Pointer increment.
void init(LUTData< T > &lutData)
Initialize.
#define MLLUT_EXPORT
System specific macro definitions.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLLUT_EXPORT double LUTConvertRGBtoL(double r, double g, double b)
Convert RGB to luminance.
MLLUT_EXPORT int LUTNumberOfChannels(LUTVisualType visualType)
Get number of channels for given LUTVisualType, or 0 if unknown.
LUTVisualType
LUT visual type constants to identify the visual interpretation of the individual LUT channels.
@ LUT_ABGR
Alpha, Blue, Green, Red.
@ LUT_BGR
Blue, Green, Red.
@ LUT_RGBA
Red, Green, Blue, Alpha.
@ LUT_LA
Luminance and Alpha.
@ LUT_RGB
Red, Green, Blue.
MLLUT_EXPORT int LUTAlphaChannelIndex(LUTVisualType visualType)
Get index of alpha channel, or -1 if none.
MLLUT_EXPORT LUTVisualType LUTReducedVisualType(LUTVisualType visualType)
Get reduced visual type, i.e. ignoring layout variants.