13#ifndef ML_LUTFLINEAR_H
14#define ML_LUTFLINEAR_H
35 LUTRGBAPoint(
double posArg,
double rArg,
double gArg,
double bArg,
double aArg);
38 double pos()
const {
return _v[0]; }
40 void setPos(
double posArg) { _v[0] = posArg; }
43 double r()
const {
return _v[1]; }
44 void setR(
double rArg) { _v[1] = rArg; }
45 double g()
const {
return _v[2]; }
46 void setG(
double gArg) { _v[2] = gArg; }
47 double b()
const {
return _v[3]; }
48 void setB(
double bArg) { _v[3] = bArg; }
49 double a()
const {
return _v[4]; }
50 void setA(
double aArg) { _v[4] = aArg; }
54 _v[1] = lArg; _v[2] = lArg; _v[3] = lArg;
62 void setRGBA(
double rArg,
double gArg,
double bArg,
double aArg) {
69 void setRGB(
double rArg,
double gArg,
double bArg) {
79 double &operator [](
int idx) {
86 const double &operator [](
int idx)
const {
92 return this->
pos()<p.
pos();
97 return this->
pos()>p.
pos();
238 double minIndex,
double maxIndex)
const override;
243 template <
typename T>
245 double startIndex,
double endIndex)
const;
virtual double getStartIndex(void) const
Get start index.
void readStateFromTree(TreeNode *parent) override
Reads the object state from the children of the given parent node.
float getAlphaFactor() const
Get the global alpha factor.
const LUTRGBAPoint & getPoint(int idx) const
Get a point at given index.
ColorInterpolation _colorInterpolation
Color interpolation mode.
bool _relativeUsesNativeRange
bool isValid(void) const override
Return true if the LUT function is valid.
bool renderLUTRescaled(LUTDataBase *lutData, LUTIteratorBase *lutIterator, double minIndex, double maxIndex) const override
void setAlphaFactor(float factor)
Set the global alpha factor (default is 1.).
bool renderLUTNative(LUTDataBase *lutData, LUTIteratorBase *lutIterator) const override
const LUTRGBAPointList & getPoints() const
Get sampling point table as a const reference.
void setVisualType(LUTVisualType visualType)
Set the visual type of the table (this affects how the points in the list are handled).
ML_SET_ADDSTATE_VERSION(1)
double getNativeMinIndex(void) const override
Get native minimum index.
void copyPoint(int idx, double *array) const
Copy the point at table index idx to the given array (ordered like in the LUTIterator).
virtual void setColorInterpolation(ColorInterpolation c)
Set color interpolation mode.
virtual bool setPoints(const LUTRGBAPointList &points)
virtual double getEndIndex(void) const
Get end index.
void setRelativeUsesNativeRange(bool flag)
static EnumValues< ColorInterpolation > getColorInterpolationValues()
Color interpolation values.
virtual ColorInterpolation getColorInterpolation(void) const
Get color interpolation mode.
bool renderLUT(LUTData< T > *lutData, LUTIterator< T > *lutIterator, double startIndex, double endIndex) const
LUTRGBAPointList & getModifiablePoints()
LUTRGBAPointList _points
LUT sampling point table.
ML_CLASS_HEADER(LUTFLinear)
LUTFLinear(void)
Constructor.
bool relativeUsesNativeRange() const
void addStateToTree(TreeNode *parent) const override
Attaches the object state as children of the given parent node.
double getNativeMaxIndex(void) const override
Get native maximum index.
int insertPoint(const LUTRGBAPoint &point)
Insert a given point and return the resulting index in the sampling point table.
ColorInterpolation
Color interpolation constants.
@ InterpolateHLS
Interpolation in HLS space, closest H direction.
@ InterpolateRGB
Interpolation in RGB space.
@ InterpolateHLSneg
Interpolation in HLS space, negative H direction.
@ InterpolateConstant
Interpolation by floor() truncation.
@ InterpolateSRGB
Convert to linear RGB, interpolate and convert back.
@ InterpolateHLSpos
Interpolation in HLS space, positive H direction.
void setPoint(int idx, const LUTRGBAPoint &point)
Set a point at given index, does not check if position is correct!
void removePoint(int idx)
Remove the point at the given index.
float _alphaFactor
Global alpha factor.
LUTVisualType _visualType
LUT visual type.
LUTFunction(LUTVisualType vt, bool relative)
Constructor.
LUT iterator base class with type independent functionality and declarations.
A LUT sampling point with index position and RGBA channel values,.
double r() const
Access the color/alpha components.
double pos() const
Get index position of point.
double l() const
Return luminance (assuming that R == G == B).
void setPos(double posArg)
Set index position of point.
LUTRGBAPoint(double posArg, double rArg, double gArg, double bArg, double aArg)
Explicit value constructor.
void setRGBA(double rArg, double gArg, double bArg, double aArg)
void setRGB(double rArg, double gArg, double bArg)
void setL(double lArg)
Set R, G, B components to luminance l.
LUTRGBAPoint()
Default constructor.
#define MLLUT_EXPORT
System specific macro definitions.
std::vector< LUTRGBAPoint > LUTRGBAPointList
Type definition for a vector of sampling points.