26 #include <tbb/spin_mutex.h>
47 struct SerializableFRGBA :
public UT_FRGBA
49 using UT_FRGBA::operator=;
51 template <
typename ARCHIVER_T>
52 bool serialize(ARCHIVER_T &archiver)
54 return archiver.serializeUniformArray(&
r, 4);
62 bool enable_pos_ =
true,
63 bool enable_val_ =
true,
64 bool enable_interp_ =
true)
71 enable_pos = enable_pos_;
72 enable_val = enable_val_;
73 enable_interp = enable_interp_;
76 template <
typename ARCHIVER_T>
77 bool serialize(ARCHIVER_T &archiver);
103 int64 getMemoryUsage(
bool inclusive)
const;
106 { myColorType = color_space; }
108 {
return myColorType; }
110 void clearAndDestroy();
113 void ensureRampIsBuilt();
116 {
return myGlobalEnable; }
118 { myGlobalEnable = enable; }
132 bool do_interp =
true,
142 int getClosestNodeIndex(
fpreal pos)
const;
148 int getCurrentNodeIndex()
const;
149 void setCurrentNodeIndex(
int i,
bool add_to_selection);
152 bool do_interp =
true)
const;
153 void getColor(
fpreal pos,
float fvals[4],
154 bool do_interp =
true)
const;
156 bool do_interp =
true)
const;
160 void setColorAt(
int i,
float fvals[4]);
161 void setColorAt(
int i,
const UT_FRGBA &clr);
162 void setCurrentNodeColor(
fpreal32 fvals[4]);
163 void setCurrentNodeColor(
fpreal64 fvals[4]);
164 void setCurrentNodeColor(
const UT_FRGBA &clr);
169 void setEnable(
int i,
bool enable_pos,
bool enable_val,
171 bool getEnablePos(
int i)
const;
172 bool getEnableVal(
int i)
const;
173 bool getEnableInterp(
int i)
const;
175 bool getStrictOrder()
const;
176 void setStrictOrder(
bool strict);
178 void clearSelection();
179 bool isNodeSelected(
int i)
const;
180 void selectNode(
int i,
bool add);
181 void selectRange(
int first_i,
int last_i,
bool add);
182 void deselectNode(
int i);
183 void toggleSelectNode(
int i);
193 bool current =
true);
196 bool current =
true);
199 bool current =
true);
203 bool current =
true);
206 bool current =
true);
210 void recordNodePositions();
212 bool deleteNode(
fpreal pos);
213 bool deleteNodeAt(
int i);
214 void deleteSelectedNodes();
216 bool isNodeHandle(
int i)
const;
217 bool isNodeLeftHandle(
int i)
const;
218 bool isNodeRightHandle(
int i)
const;
220 void moveNode(
int i,
fpreal pos);
225 int load(
const char *pathname);
228 int save(
const char *pathname)
const;
229 int save(std::ostream &os)
const;
241 int order = 0)
const;
242 void rampLookupNoInterp(
fpreal pos,
float values[4])
const;
244 int ns,
int order = 0)
const;
248 template <
typename ARCHIVER_T>
249 bool serialize(ARCHIVER_T &archiver);
261 bool resolveOpRamp(
const char *op_path,
262 const char *ramp_parm,
263 bool *is_rgb =
nullptr,
264 int *op_id =
nullptr,
265 int *op_version =
nullptr);
271 UT_RGBA *sampleColors(
int nsamples,
bool do_interp);
272 UT_BIG_RGBA *sampleColors16(
int nsamples,
bool do_interp);
280 void getColorAndMultiply(
fpreal pos,
bool do_interp,
282 void getColorAndMultiply(
fpreal pos,
bool do_interp,
285 void interpColor(
fpreal pos,
float vals[4],
286 int order = 0)
const;
288 void updateSplineIfNeeded()
const;
290 int i,
float *
val,
int order = 0)
const;
293 template <
typename T>
299 template <
typename T>
307 typedef tbb::spin_mutex SplineLock;
317 mutable bool mySplineUpToDate;
318 mutable SplineLock mySplineLock;
339 virtual bool resolveRampParm(
UT_Ramp &target_ramp,
341 const char *ramp_parm,
342 bool *is_rgb =
nullptr,
343 int *op_id =
nullptr,
344 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)
JSON reader class which handles parsing of JSON or bJSON files.
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
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)