34 assetMgr->
textures().push_back(
this);
53 for (
auto alpha : alphaValues)
60 assetMgr->
textures().push_back(
this);
77 for (
auto color : colorValues)
80 for (
auto alpha : alphaValues)
87 assetMgr->
textures().push_back(
this);
99 assert(lutType !=
CLUT_custom &&
"SLTexColorLUT::colors: Custom LUT now allowed");
109 name(
"Gradient Texture (LUT): B-W");
114 name(
"Gradient Texture (LUT): W-B");
120 name(
"Gradient Texture (LUT): W-Y-R");
128 name(
"Gradient Texture (LUT): R-Y-G-C-B");
136 name(
"Gradient Texture (LUT): B-C-G-Y-R");
145 name(
"Gradient Texture (LUT): R-Y-G-C-B-K");
154 name(
"Gradient Texture (LUT): K-B-C-G-Y-R");
163 name(
"Gradient Texture (LUT): R-Y-G-C-B-M");
172 name(
"Gradient Texture (LUT): M-B-C-G-Y-R");
181 name(
"Gradient Texture (LUT): For daylight");
184 SL_EXIT_MSG(
"SLTexColorLUT::colors: undefined color LUT.");
194 "SLTexColorLUT::generateTexture: Not enough color values.");
207 { return a.pos < b.pos; });
210 if (
_alphas.front().pos < 0.0f)
211 SL_EXIT_MSG(
"SLTexColorLUT::generateTexture: Lower alpha pos below 0");
213 SL_EXIT_MSG(
"SLTexColorLUT::generateTexture: Upper alpha pos above 1");
214 if (
_colors.front().pos < 0.0f)
215 SL_EXIT_MSG(
"SLTexColorLUT::generateTexture: Lower color pos below 0");
217 SL_EXIT_MSG(
"SLTexColorLUT::generateTexture: Upper color pos above 1");
220 if (
_alphas.front().pos > 0.0f)
224 if (
_colors.front().pos > 0.0f)
232 SL_EXIT_MSG(
"SLTexColorLUT::generateTexture: Alpha position deltas to small.");
242 { return a.pos < b.pos; });
247 SL_EXIT_MSG(
"SLTexColorLUT::generateTexture: Color position deltas to small.");
251 c.color.clampMinMax(0.0f, 1.0f);
vector< SLfloat > SLVfloat
#define SL_EXIT_MSG(message)
Declares a color look up table functionality.
vector< SLColorLUTPoint > SLVColorLUTPoint
SLColorLUTType
Predefined color lookup tables.
@ CLUT_RYGCBK
red to yellow to green to cyan to blue to black
@ CLUT_custom
enum for any other custom LUT
@ CLUT_MBCGYR
magenta to blue to cyan to green to yellow to red
@ CLUT_RYGCBM
red to yellow to green to cyan to blue to magenta
@ CLUT_DAYLIGHT
daylight from sunrise to sunset with noon in the middle
@ CLUT_BCGYR
blue to cyan to green to yellow to red
@ CLUT_RYGCB
red to yellow to green to cyan to blue
@ CLUT_KBCGYR
black to blue to cyan to green to yellow to red
vector< SLAlphaLUTPoint > SLVAlphaLUTPoint
SLVec3< SLfloat > SLCol3f
vector< SLCol3f > SLVCol3f
vector< SLCol4f > SLVCol4f
Toplevel holder of the assets meshes, materials, textures and shaders.
SLVGLTexture & textures()
SLint _width
Texture image width in pixels (images exist either in _images or on the GPU or on both)
SLint _wrap_t
Wrapping in t direction.
SLint _min_filter
Minification filter.
void load(const SLstring &filename, SLbool flipVertical=true, SLbool loadGrayscaleIntoAlpha=false)
Loads the texture, converts color depth & applies vertical mirroring.
SLint _wrap_s
Wrapping in s direction.
SLint _height
Texture image height in pixels (images exist either in _images or on the GPU or on both)
SLTextureType _texType
See SLTextureType.
void deleteData(SLbool deleteAlsoOnGPU)
Delete all data (CVImages and GPU textures)
CVVImage _images
Vector of CVImage pointers.
SLint _depth
3D Texture image depth (images exist either in _images or on the GPU or on both)
SLenum _target
texture target
SLint _mag_filter
Magnification filter.
const SLstring & name() const
SLVAlphaLUTPoint _alphas
vector of colors in TF
SLVColorLUTPoint _colors
Color LUT identifier.
SLTexColorLUT(SLAssetManager *assetMgr, SLColorLUTType lutType, SLuint length=256)
Default ctor color LUT of a specific SLColorLUTType.
SLVColorLUTPoint & colors()
SLColorLUTType _colorLUT
Length of transfer function (default 256)
SLVfloat allAlphas()
Returns all alpha values of the transfer function as a float vector.
SLVCol3f allColors()
Returns all alpha values of the transfer function as a float vector.
void generateTexture()
Generates the full 256 value LUT as 1x256 RGBA texture.
T clamp(T a, T min, T max)
Alpha point with alpha value and position value between 0-1.
Color point with color and position value between 0-1.