HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RU_ColorCurve.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* NAME: RU_ColorCurve.h
7
*
8
* COMMENTS:
9
* A simple 2D curve for quick evaluation (for color curves).
10
*/
11
#ifndef RU_SMOOTHCURVE_H
12
#define RU_SMOOTHCURVE_H
13
14
#include "
RU_API.h
"
15
#include <
UT/UT_FloatArray.h
>
16
#include <
UT/UT_Singleton.h
>
17
#include <
UT/UT_Vector2Array.h
>
18
#include <
TIL/TIL_Defines.h
>
19
20
#include "
RU_PixelFunction.h
"
21
22
class
GU_Detail
;
23
24
class
RU_API
RU_ColorCurve
25
{
26
public
:
27
RU_ColorCurve
();
28
~
RU_ColorCurve
();
29
30
void
reset
();
31
void
addPoint(
float
pos,
float
val
,
float
sharpness);
32
void
create(
bool
extend_slopes =
true
);
33
34
float
evaluate
(
float
pos)
const
;
35
36
// data
37
UT_FloatArray
myDivs
;
38
UT_FloatArray
myValues
;
39
UT_FloatArray
mySharp
;
40
UT_Vector2Array
myPoints
;
41
float
myPreSlope
, myPostSlope;
42
bool
myExtendSlope
;
43
int
myNumPoints
;
44
int
myNumSplines
;
45
};
46
47
48
class
RU_API
RU_ColorCurveFunc
:
public
RU_PixelFunction
49
{
50
public
:
51
RU_ColorCurveFunc
(
RU_ColorCurve
*curve);
52
RU_ColorCurveFunc
(
RU_ColorCurve
**curves,
int
num);
53
54
~
RU_ColorCurveFunc
()
override
;
55
56
protected
:
57
bool
eachComponentDifferent
()
const override
58
{
return
myNumCurves > 1; }
59
60
static
float
curve(
RU_PixelFunction
*pf,
float
val
,
int
);
61
RUPixelFunc
getPixelFunction
()
const override
{
return
curve; }
62
void
getPixelShader
(
UT_String
&frag_shader)
override
;
63
64
RU_ColorCurve
*myCurves[4];
65
int
myNumCurves
;
66
float
*
myCurveData
;
67
};
68
69
class
RU_API
RU_HueCurveFunc
:
public
RU_PixelFunction
70
{
71
public
:
72
// mode = 0, adjust sat. mode = 1, adjust lum.
73
RU_HueCurveFunc
(
RU_ColorCurve
*curve,
int
mode
);
74
75
~
RU_HueCurveFunc
()
override
;
76
77
protected
:
78
bool
needAllComponents
()
const override
{
return
true
; }
79
80
static
void
hueSat(
RU_PixelFunction
*
f
,
float
**vals,
81
const
bool
*scope);
82
static
void
hueLum(
RU_PixelFunction
*
f
,
float
**vals,
83
const
bool
*scope);
84
RUVectorFunc
getVectorFunction
()
const override
85
{
return
myMode ? hueLum:hueSat; }
86
void
getPixelShader
(
UT_String
&frag_shader)
override
;
87
88
struct
CurveData
89
{
90
CurveData
(
RU_HueCurveFunc
*hf);
91
~
CurveData
();
92
93
float
*
myScales
;
94
float
myAvgScale
;
95
};
96
97
RU_ColorCurve
*
myCurve
;
98
int
myMode
;
99
UT_SingletonWithLock<CurveData, true>
myCurveData
;
100
};
101
102
103
#endif
CE_OSDPatchEval::evaluate
CE_API bool evaluate(const CE_OSDRefinement &topo, const CE_OSDEvaluator &eval, const cl::Buffer &coarse, const CE_OSDPatchCoords &patch_coords, const CE_FloatArray *refined_data, cl::Buffer &out, cl::Buffer *du, cl::Buffer *dv)
RU_ColorCurveFunc::myNumCurves
int myNumCurves
Definition:
RU_ColorCurve.h:65
RU_ColorCurve::myExtendSlope
bool myExtendSlope
Definition:
RU_ColorCurve.h:42
RU_ColorCurveFunc::getPixelFunction
RUPixelFunc getPixelFunction() const override
Definition:
RU_ColorCurve.h:61
RU_HueCurveFunc::getVectorFunction
RUVectorFunc getVectorFunction() const override
Definition:
RU_ColorCurve.h:84
RU_ColorCurve::myNumSplines
int myNumSplines
Definition:
RU_ColorCurve.h:44
RU_API
#define RU_API
Definition:
RU_API.h:10
UT_ValArray< float >
RU_HueCurveFunc
Definition:
RU_ColorCurve.h:69
RU_API.h
RU_ColorCurve::myDivs
UT_FloatArray myDivs
Definition:
RU_ColorCurve.h:37
UT_Singleton.h
TIL_Defines.h
RU_ColorCurve::mySharp
UT_FloatArray mySharp
Definition:
RU_ColorCurve.h:39
f
GLfloat f
Definition:
glcorearb.h:1926
RU_ColorCurve::myNumPoints
int myNumPoints
Definition:
RU_ColorCurve.h:43
reset
GLboolean reset
Definition:
glad.h:5138
RU_ColorCurveFunc::myCurveData
float * myCurveData
Definition:
RU_ColorCurve.h:66
RU_PixelFunction
Definition:
RU_PixelFunction.h:29
RU_HueCurveFunc::CurveData
Definition:
RU_ColorCurve.h:88
RU_HueCurveFunc::myCurve
RU_ColorCurve * myCurve
Definition:
RU_ColorCurve.h:97
RU_PixelFunction.h
mode
GLenum mode
Definition:
glcorearb.h:99
RU_HueCurveFunc::CurveData::myAvgScale
float myAvgScale
Definition:
RU_ColorCurve.h:94
RU_ColorCurveFunc
Definition:
RU_ColorCurve.h:48
RU_HueCurveFunc::needAllComponents
bool needAllComponents() const override
Definition:
RU_ColorCurve.h:78
RU_ColorCurve
Definition:
RU_ColorCurve.h:24
GU_Detail
Definition:
GU_Detail.h:159
UT_SingletonWithLock
Definition:
UT_Singleton.h:234
RU_ColorCurve::myPreSlope
float myPreSlope
Definition:
RU_ColorCurve.h:41
UT_FloatArray.h
val
GLuint GLfloat * val
Definition:
glcorearb.h:1608
RU_HueCurveFunc::myMode
int myMode
Definition:
RU_ColorCurve.h:98
UT_String
Definition:
UT_String.h:76
RU_ColorCurve::myPoints
UT_Vector2Array myPoints
Definition:
RU_ColorCurve.h:40
UT_Vector2Array.h
RUVectorFunc
void(* RUVectorFunc)(RU_PixelFunction *, float **, const bool *)
Definition:
RU_PixelFunction.h:27
RU_HueCurveFunc::myCurveData
UT_SingletonWithLock< CurveData, true > myCurveData
Definition:
RU_ColorCurve.h:99
RU_PixelFunction::getPixelShader
virtual void getPixelShader(UT_String &frag_shader)
RUPixelFunc
float(* RUPixelFunc)(RU_PixelFunction *, float, int)
Definition:
RU_PixelFunction.h:26
RU_ColorCurve::myValues
UT_FloatArray myValues
Definition:
RU_ColorCurve.h:38
RU_ColorCurveFunc::eachComponentDifferent
bool eachComponentDifferent() const override
Definition:
RU_ColorCurve.h:57
RU_HueCurveFunc::CurveData::myScales
float * myScales
Definition:
RU_ColorCurve.h:93
RU
RU_ColorCurve.h
Generated on Sat Aug 22 2026 02:17:59 for HDK by
1.8.6