13#ifndef ML_LUTFUNCTION_H
14#define ML_LUTFUNCTION_H
32#define ML_LUT_NATIVE_MINMAX_DOUBLE 1
67 virtual bool isValid (
void)
const {
return true; }
73 virtual bool isRelative (
void)
const {
return _relative; }
92 virtual int getDepth (
void)
const {
return 1; }
105 unsigned int getId (
void)
const {
return _id; }
190 template <
typename T>
197 template <
typename T>
Class representing general ML objects that support import/export via strings (setPersistentState() an...
Untyped base class for LUTData template classes.
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
Common base class for lookup tables.
virtual bool renderLUTRescaled(LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const
Render a single row of a rescaled LUT into lutData using lutIterator to access and increment the LUT ...
virtual LUTVisualType getVisualType(void) const
Get LUT visual type.
virtual bool render(LUTDataBase *lutData) const
Render LUT in (previously initialized) LUTData object.
virtual int getDepth(void) const
Get native LUT depth (= number of layers, numbering starts at 0)
unsigned int getId(void) const
Get current LUT ID.
virtual LUTVisualType getRenderType(LUTDataBase *) const
Get visual type used for rendering.
static unsigned int generateUniqueId(void)
Generate a unique id (unique for all mlLUTFunctions), this can also be called to get a unique id for ...
void changed(void)
Assign a new LUT ID.
virtual double getNativeMaxIndex(void) const
Get native maximum index.
unsigned int _id
Unique LUT ID, changed by the changed() method whenever a property of the LUT function object is modi...
virtual bool isRelative(void) const
Is LUT relative?
static unsigned int _gNextId
Global storage for next unused LUT ID to ensure uniqueness.
virtual bool renderRescaled(LUTDataBase *lutData, double minIndex, double maxIndex) const
Render rescaled LUT in (previously initialized) LUTData object.
virtual double getNativeMinIndex(void) const
Get native minimum index.
virtual LUTDimensionality getDimensionality(void) const
Get dimensionality (1, 2, or 3), usually depending on height and depth.
virtual bool isValid(void) const
Return true if the LUT function is valid. An invalid LUT function can not be rendered.
virtual double getNativeMinValue(void) const
Get native minimum LUT value.
virtual int getHeight(void) const
Get native LUT height (= number of rows, numbering starts at 0)
void overwriteUniqueId(unsigned int newId)
Overwrites the unique id. NOTE: use this only if you really know what you are doing!
virtual void setRelative(bool relative)
Set/reset relative flag.
bool interpolateLUT(LUTData< T > *lutData, LUTIterator< T > *lutIterator, double minIndex, double maxIndex) const
Perform type-specific rescaled LUT rendering by.
virtual bool renderLUTNative(LUTDataBase *lutData, LUTIteratorBase *lutIterator) const =0
Render a single row of the lookup table into lutData using lutIterator to access and increment the LU...
LUTVisualType _visualType
LUT visual type.
LUTFunction(LUTVisualType vt, bool relative)
Constructor.
bool renderT(LUTData< T > *lutData, bool rescaled, double minIndex, double maxIndex) const
Perform type-specific, native or rescaled (rescaled = true, rescale to range minIndex ....
ML_ABSTRACT_CLASS_HEADER(LUTFunction)
virtual double getNativeMaxValue(void) const
Get native maximum LUT value.
bool _relative
Flag for relative LUT.
LUT iterator base class with type independent functionality and declarations.
The LUTIterator class template is used by a LUTFunction object for rendering into a LUTData object.
#define MLLUT_EXPORT
System specific macro definitions.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
LUTDimensionality
LUT dimensionality.
@ LUT_1D
1D-LUT, consists of a single row
@ LUT_3D
3D-LUT, consists of multiple layers
@ LUT_2D
2D-LUT, consists of multiple rows in a single layer
LUTVisualType
LUT visual type constants to identify the visual interpretation of the individual LUT channels.