28 #include <tbb/spin_mutex.h>
49 struct SerializableFRGBA :
public UT_FRGBA
51 using UT_FRGBA::operator=;
53 template <
typename ARCHIVER_T>
54 bool serialize(ARCHIVER_T &archiver)
56 return archiver.serializeUniformArray(&
r, 4);
64 bool enable_pos_ =
true,
65 bool enable_val_ =
true,
66 bool enable_interp_ =
true)
73 enable_pos = enable_pos_;
74 enable_val = enable_val_;
75 enable_interp = enable_interp_;
80 template <
typename ARCHIVER_T>
81 bool serialize(ARCHIVER_T &archiver);
107 int64 getMemoryUsage(
bool inclusive)
const;
110 { myColorType = color_space; }
112 {
return myColorType; }
114 void clearAndDestroy();
117 void ensureRampIsBuilt();
120 {
return myGlobalEnable; }
122 { myGlobalEnable = enable; }
136 bool do_interp =
true,
146 int getClosestNodeIndex(
fpreal pos)
const;
152 int getCurrentNodeIndex()
const;
153 void setCurrentNodeIndex(
int i,
bool add_to_selection);
156 bool do_interp =
true)
const;
157 void getColor(
fpreal pos,
float fvals[4],
158 bool do_interp =
true)
const;
160 bool do_interp =
true)
const;
164 void setColorAt(
int i,
float fvals[4]);
165 void setColorAt(
int i,
const UT_FRGBA &clr);
166 void setCurrentNodeColor(
fpreal32 fvals[4]);
167 void setCurrentNodeColor(
fpreal64 fvals[4]);
168 void setCurrentNodeColor(
const UT_FRGBA &clr);
173 void setEnable(
int i,
bool enable_pos,
bool enable_val,
175 bool getEnablePos(
int i)
const;
176 bool getEnableVal(
int i)
const;
177 bool getEnableInterp(
int i)
const;
179 bool getStrictOrder()
const;
180 void setStrictOrder(
bool strict);
182 void clearSelection();
183 bool isNodeSelected(
int i)
const;
184 void selectNode(
int i,
bool add);
185 void selectRange(
int first_i,
int last_i,
bool add);
186 void deselectNode(
int i);
187 void toggleSelectNode(
int i);
197 bool current =
true);
200 bool current =
true);
203 bool current =
true);
207 bool current =
true);
210 bool current =
true);
214 void recordNodePositions();
216 bool deleteNode(
fpreal pos);
217 bool deleteNodeAt(
int i);
218 void deleteSelectedNodes();
220 bool isNodeHandle(
int i)
const;
221 bool isNodeLeftHandle(
int i)
const;
222 bool isNodeRightHandle(
int i)
const;
224 void moveNode(
int i,
fpreal pos);
229 int load(
const char *pathname);
232 int save(
const char *pathname)
const;
233 int save(std::ostream &os)
const;
248 int order = 0)
const;
249 void rampLookupNoInterp(
fpreal pos,
float values[4])
const;
251 int ns,
int order = 0)
const;
255 template <
typename ARCHIVER_T>
256 bool serialize(ARCHIVER_T &archiver);
271 bool resolveOpRamp(
const char *op_path,
272 const char *ramp_parm,
273 bool *is_rgb =
nullptr,
274 int *op_id =
nullptr,
275 int *op_version =
nullptr);
285 static void unregisterRamps(
UT_IntArray ®istered);
293 UT_RGBA *sampleColors(
int nsamples,
bool do_interp);
294 UT_BIG_RGBA *sampleColors16(
int nsamples,
bool do_interp);
302 void getColorAndMultiply(
fpreal pos,
bool do_interp,
304 void getColorAndMultiply(
fpreal pos,
bool do_interp,
307 void interpColor(
fpreal pos,
float vals[4],
308 int order = 0)
const;
310 void updateSplineIfNeeded()
const;
312 int i,
float *
val,
int order = 0)
const;
315 template <
typename T>
321 template <
typename T>
329 typedef tbb::spin_mutex SplineLock;
339 mutable bool mySplineUpToDate;
340 mutable SplineLock mySplineLock;
361 virtual bool resolveRampParm(
UT_Ramp &target_ramp,
363 const char *ramp_parm,
364 bool *is_rgb =
nullptr,
365 int *op_id =
nullptr,
366 int *op_version =
nullptr);
GLsizei GLenum const void * indices
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
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
std::size_t SYS_HashType
Define the type for hash values.
JSON reader class which handles parsing of JSON or bJSON files.
bool operator!=(const UT_Ramp &from) const
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)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
const UT_ColorNode * getRamp() const
void setGlobalEnable(bool enable)
HUSD_API const char * raster()
GLdouble GLdouble GLint GLint order
UT_ColorType getColorType() const
GLenum GLsizei GLsizei GLint * values
LeafData & operator=(const LeafData &)=delete
Utility class for containing a color ramp.
SerializableFRGBA old_rgba
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)