26 #include <tbb/spin_mutex.h>
43 struct SerializableFRGBA :
public UT_FRGBA
45 using UT_FRGBA::operator=;
47 template <
typename ARCHIVER_T>
48 bool serialize(ARCHIVER_T &archiver)
50 return archiver.serializeUniformArray(&
r, 4);
58 bool enable_pos_ =
true,
59 bool enable_val_ =
true,
60 bool enable_interp_ =
true)
65 enable_pos = enable_pos_;
66 enable_val = enable_val_;
67 enable_interp = enable_interp_;
70 template <
typename ARCHIVER_T>
71 bool serialize(ARCHIVER_T &archiver);
94 int64 getMemoryUsage(
bool inclusive)
const;
97 { myColorType = color_space; }
99 {
return myColorType; }
101 void clearAndDestroy();
104 void ensureRampIsBuilt();
107 {
return myGlobalEnable; }
109 { myGlobalEnable =
enable; }
115 {
return myNodes.entries() > 0 ? &myNodes(0) : 0; }
117 {
return myNodes.entries() > 0 ? &myNodes(0) : 0; }
131 int getClosestNodeIndex(
fpreal pos)
const;
134 int getCurrentNodeIndex()
const;
135 void setCurrentNodeIndex(
int i,
bool add_to_selection);
138 int doInterping = 1)
const;
139 void getColor(
fpreal pos,
float fvals[4],
140 int doInterping = 1)
const;
142 int doInterping = 1)
const;
144 void setColorAt(
int i,
float fvals[4]);
145 void setColorAt(
int i,
const UT_FRGBA &clr);
146 void setCurrentNodeColor(
fpreal32 fvals[4]);
147 void setCurrentNodeColor(
fpreal64 fvals[4]);
148 void setCurrentNodeColor(
const UT_FRGBA &clr);
153 void setEnable(
int i,
bool enable_pos,
bool enable_val,
155 bool getEnablePos(
int i)
const;
156 bool getEnableVal(
int i)
const;
157 bool getEnableInterp(
int i)
const;
159 void clearSelection();
160 bool isNodeSelected(
int i);
161 void selectNode(
int i,
bool add);
162 void selectRange(
int first_i,
int last_i,
bool add);
163 void deselectNode(
int i);
164 void toggleSelectNode(
int i);
176 bool deleteNode(
fpreal pos);
177 bool deleteNodeAt(
int i);
178 void deleteSelectedNodes();
184 void moveNodeSelection(
int node_i,
fpreal pos);
186 int load(
const char *pathname);
189 int save(
const char *pathname)
const;
190 int save(std::ostream &os)
const;
202 int order = 0)
const;
203 void rampLookupNoInterp(
fpreal pos,
float values[4])
const;
205 int ns,
int order = 0)
const;
209 template <
typename ARCHIVER_T>
210 bool serialize(ARCHIVER_T &archiver);
222 bool resolveOpRamp(
const char *op_path,
223 const char *ramp_parm,
226 int *op_version = NULL);
232 UT_RGBA *sampleColors (
int nsamples,
int doInterp);
233 UT_BIG_RGBA *sampleColors16(
int nsamples,
int doInterp);
241 void getColorAndMultiply(
fpreal pos,
int do_interp,
243 void getColorAndMultiply(
fpreal pos,
int do_interp,
246 void interpColor(
fpreal pos,
int i1,
float vals[4],
247 int order = 0)
const;
249 void updateSplineIfNeeded()
const;
251 int i,
float *
val,
int order = 0)
const;
255 typedef tbb::spin_mutex SplineLock;
265 mutable bool mySplineUpToDate;
266 mutable SplineLock mySplineLock;
283 virtual bool resolveRampParm(
UT_Ramp &target_ramp,
285 const char *ramp_parm,
288 int *op_version = NULL);
UT_ColorNode(fpreal offset, const UT_FRGBA &color, UT_SPLINE_BASIS basis_=UT_SPLINE_LINEAR, bool enable_pos_=true, bool enable_val_=true, bool enable_interp_=true)
bool getGlobalEnable() const
GLuint const GLfloat * val
GLint GLsizei const GLuint64 * values
JSON reader class which handles parsing of JSON or bJSON files.
GLuint GLdouble GLdouble GLint GLint order
Class to create a UT_Ramp from an OP node path and parameter string.
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
void setColorType(UT_ColorType color_space)
const UT_ColorNode * getRamp() const
GLuint GLuint GLsizei GLenum const void * indices
void setGlobalEnable(bool enable)
UT_ColorType getColorType() const
Utility class for containing a color ramp.
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
GLdouble GLdouble GLdouble r
OIIO_API bool copy(string_view from, string_view to, std::string &err)
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t0