13#ifndef ML_LUTITERATOR_H
14#define ML_LUTITERATOR_H
72 inline int operator () (
void)
const {
return _index; }
154 inline void operator ++ (
void) { ++
_index; (this->*
_inc)(); }
182 static_cast<double>(*
chn[
G]),
183 static_cast<double>(*
chn[
B]))); }
211 lutData.getMinRow(), lutData.getMinLayer())
222 row, lutData.getMinLayer())
LUTVisualType getVisualType(void) const
Get visual type.
int getMinIndex(void) const
Get minimum index value.
int getStride(int dim) const
T * getEntriesAt(int index, int row, int layer)
Get LUT entries at given index, row and layer.
ConvMethod
Conversion method id.
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).
@ MAX_CHANNELS
Number of channels.
@ A_RGBA
Alpha channel (source type = RGBA).
@ A_LA
Alpha channel (source type = LA).
LUTVisualType _vtFrom
Source visual type, used by the LUT being rendered.
int _row
Current row and layer.
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.
enum ml::LUTIteratorBase::ConvMethod _convMethodId
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?
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)
void(LUTIterator< T >::* IncrementFnc)(void)
Increment method pointer type definition.
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.
IncrementFnc _incPointers
int _dpLut
Pointer increment.
void init(LUTData< T > &lutData)
Initialize.
#define MLLUT_EXPORT
System specific macro definitions.
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.
@ 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.
T LUTCastFromDouble(double value)
MLLUT_EXPORT LUTVisualType LUTReducedVisualType(LUTVisualType visualType)
Get reduced visual type, i.e. ignoring layout variants.