39 _minOriginalRange = 0;
40 _maxOriginalRange = 0;
52 double _minOriginalRange;
53 double _maxOriginalRange;
125 int getWidth (
void)
const {
return _maxIndex-_minIndex+1; }
134 int getHeight (
void)
const {
return _maxRow-_minRow+1; }
143 int getDepth (
void)
const {
return _maxLayer-_minLayer+1; }
161 unsigned int getId (
void)
const {
return _lutId._id; }
164 void setId (
unsigned int id) { _lutId._id = id; }
306 T *
getData (
void) {
return reinterpret_cast<T*
>(_data); }
309 const T *
getData (
void)
const {
return reinterpret_cast<const T*
>(_data); }
313 {
return getData()+(index*_strides[0]+row*_strides[1]+
layer*_strides[2]-_entryOffset); }
317 {
return getData()+(index*_strides[0]+row*_strides[1]+
layer*_strides[2]-_entryOffset); }
321 {
return getEntriesAt(index, row, getMinLayer()); }
325 {
return getEntriesAt(index, row, getMinLayer()); }
329 {
return getEntriesAt(index, getMinRow(), getMinLayer()); }
333 {
return getEntriesAt(index, getMinRow(), getMinLayer()); }
418 if (
newLutData->init(_visualType, _minIndex, _maxIndex, _minRow, _maxRow,
Untyped base class for LUTData template classes.
bool isInRange(int index, int row=0, int layer=0) const
Return true if specified index, row and layer position is in LUT range.
int getMaxIndex(void) const
Get maximum index value.
int getMinRow(void) const
Get minimum row value.
LUTVisualType getVisualType(void) const
Get visual type.
unsigned int getId(void) const
Get LUT ID.
LUTDataBase(MLDataType dataType)
Constructor, create empty, unallocated table.
int _numChannels
Number of channels.
int getHeight(void) const
Get number of rows.
void setFullId(const LUTDataId &id)
Set full LUT data ID, including min/max ranged from renderRescaled.
int getDepth(void) const
Get number of layers.
void clearData(void)
Clear data buffer.
void setId(unsigned int id)
Set LUT ID.
int getMaxRow(void) const
Get maximum row value.
bool ownsData(void) const
Return true if this LUTData object owns the referenced LUT data buffer.
MLErrorCode initShared1D(LUTVisualType visualType, int minIndex, int maxIndex, int row, int layer, LUTDataBase *srcLutData, int srcIndex, int srcRow, int srcLayer)
Initialize 1D-LUT data for specified visual type, index range and row/layer.
int getMinLayer(void) const
Get minimum layer value.
int getNumChannels(void) const
Get number of channels.
void * _data
LUT data pointer.
MLErrorCode initShared2D(LUTVisualType visualType, int minRow, int maxRow, int layer, LUTDataBase *srcLutData, int srcRow, int srcLayer)
Initialize 2D-LUT data for specified visual type, row range and layer.
bool _ownsData
This flag is true if LUT data buffer is owned by this LUTData object.
void setId(unsigned int id, double minIndex, double maxIndex)
Set LUT ID including min/max range on rescaled luts.
LUTVisualType _visualType
Visual type.
int getDataSize(void) const
Get size of LUT data area (in bytes)
LUTDimensionality _dimensionality
Dimensionality (1, 2 or 3)
int getMinIndex(void) const
Get minimum index value.
MLErrorCode init(LUTVisualType visualType, int minIndex, int maxIndex, int minRow, int maxRow, int minLayer, int maxLayer)
Initialize LUT data for specified visual type and index/row/layer ranges.
bool initData(void)
Initialize data buffer, return true if successful.
int getLength(void) const
Get total number of entries.
void reset(void)
Reset properties.
int getStride(int dim) const
Get entry stride for index (dim = 1), row (2) and layer (3) dimension, relative to entry size,...
MLDataType _dataType
Data type identifier constant.
bool isInitialized(void) const
Return true if LUT initialized.
const LUTDataId & getFullId() const
Get full LUT data ID, including min/max ranged from renderRescaled.
int _entrySize
Size of single data entry.
int getMaxLayer(void) const
Get maximum layer value.
LUTDimensionality getDimensionality(void) const
Get number of dimensions (1, 2, or 3)
virtual ~LUTDataBase()
Destructor.
int _dataLength
Number of entries.
MLDataType getDataType(void) const
Get data type.
int _entryOffset
Entry offset for addressing via getEntriesAt() in derived LUTData class.
int getWidth(void) const
Get index range width.
int getEntrySize(void) const
Get size of a single LUT entry.
bool operator!=(const LUTDataId &other) const
void update(unsigned int id, double minOrig, double maxOrig)
bool operator==(const LUTDataId &other) const
A LUTData object stores an instance of a LUT, rendered for a specified visual type,...
T * getEntriesAt(int index, int row, int layer)
Get LUT entries at given index, row and layer.
LUTData()
Constructor, passes data type identifier constant to LUTDataBase A specialized constructor for each s...
const T * getEntriesAt(int index, int row) const
Get LUT entries at given index and row (const version)
const T * getEntriesAt(int index, int row, int layer) const
Get LUT entries at given index, row and layer (const version)
MLDataType getType(MLint64 *)
virtual LUTData< T > * clone(void) const
Create a new LUTData object with the same properties and a new, uninitialized data buffer.
MLErrorCode init(LUTVisualType visualType, int minIndex, int maxIndex, int minRow, int maxRow, int minLayer, int maxLayer, T maxEntry)
Initialize 3D-LUT data for specified visual type, index/row/layer ranges and maximum entry value (= r...
MLDataType getType(MLint32 *)
MLDataType getType(float *)
T * getData(void)
Get LUT data pointer, entries are stored interleaved (e.g. RGBARGBA...)
T * getEntriesAt(int index, int row)
Get LUT entries at given index and row.
MLDataType getType(MLuint16 *)
T * getEntriesAt(int index)
Get LUT entries at given index.
T _maxEntry
Maximum entry value (= reference value used for scaling LUT entries)
MLDataType getType(MLuint64 *)
MLDataType getType(double *)
MLDataType getType(MLuint8 *)
supported basic data types
MLErrorCode initShared2D(LUTVisualType visualType, int minRow, int maxRow, int layer, LUTData< T > *srcLutData, int srcRow, int srcLayer)
Initialize 2D-LUT data for specified visual type, row range and layer.
MLErrorCode init(LUTVisualType visualType, int minIndex, int maxIndex, T maxEntry)
Initialize LUT data for specified visual type, index range and maximum entry value (= reference value...
const T * getData(void) const
Get LUT data pointer (const version)
const T * getEntriesAt(int index) const
Get LUT entries at given index (const version)
MLDataType getType(MLldouble *)
MLErrorCode init(LUTVisualType visualType, int minIndex, int maxIndex, int minRow, int maxRow, T maxEntry)
Initialize 2D-LUT data for specified visual type, index/row ranges and maximum entry value (= referen...
MLDataType getType(MLint8 *)
T getMaxEntry(void) const
Get maximum (reference) entry value.
MLDataType getType(MLuint32 *)
MLDataType getType(MLint16 *)
MLErrorCode initShared1D(LUTVisualType visualType, int minIndex, int maxIndex, int row, int layer, LUTData< T > *srcLutData, int srcIndex, int srcRow, int srcLayer)
Initialize 1D-LUT data for specified visual type and index range.
MLint32 MLDataType
MLDataType.
@ MLuint8Type
Enumerator for the unsigned 8 bit ML integer type.
@ MLuint32Type
Enumerator for the unsigned 32 bit ML integer type.
@ MLfloatType
Enumerator for the signed 32 bit ML floating point type.
@ MLuint16Type
Enumerator for the unsigned 16 bit ML integer type.
@ MLint64Type
Enumerator for the signed 64 bit ML integer type.
@ MLint16Type
Enumerator for the signed 16 bit ML integer type.
@ MLint32Type
Enumerator for the signed 32 bit ML integer type.
@ MLdoubleType
Enumerator for the signed 64 bit ML floating point type.
@ MLint8Type
Enumerator for the signed 8 bit ML integer type.
@ MLuint64Type
Enumerator for the unsigned 64 bit ML integer type.
#define ML_BAD_PARAMETER
A bad/invalid parameter (or even an inappropriate image) has been passed to a module or an algorithm;...
MLint32 MLErrorCode
Type of an ML Error code.
#define ML_RESULT_OK
No error. Everything seems to be okay.
#define MLLUT_EXPORT
System specific macro definitions.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
UINT64 MLuint64
Introduce platform independent 64 bit unsigned integer type.
INT64 MLint64
Include 64 bit integer support for Windows or Unix.
LUTDimensionality
LUT dimensionality.
LUTVisualType
LUT visual type constants to identify the visual interpretation of the individual LUT channels.