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)
67 enable_pos = enable_pos_;
68 enable_val = enable_val_;
69 enable_interp = enable_interp_;
72 template <
typename ARCHIVER_T>
73 bool serialize(ARCHIVER_T &archiver);
98 int64 getMemoryUsage(
bool inclusive)
const;
101 { myColorType = color_space; }
103 {
return myColorType; }
105 void clearAndDestroy();
108 void ensureRampIsBuilt();
111 {
return myGlobalEnable; }
113 { myGlobalEnable = enable; }
127 bool do_interp =
true,
137 int getClosestNodeIndex(
fpreal pos)
const;
143 int getCurrentNodeIndex()
const;
144 void setCurrentNodeIndex(
int i,
bool add_to_selection);
147 bool do_interp =
true)
const;
148 void getColor(
fpreal pos,
float fvals[4],
149 bool do_interp =
true)
const;
151 bool do_interp =
true)
const;
155 void setColorAt(
int i,
float fvals[4]);
156 void setColorAt(
int i,
const UT_FRGBA &clr);
157 void setCurrentNodeColor(
fpreal32 fvals[4]);
158 void setCurrentNodeColor(
fpreal64 fvals[4]);
159 void setCurrentNodeColor(
const UT_FRGBA &clr);
164 void setEnable(
int i,
bool enable_pos,
bool enable_val,
166 bool getEnablePos(
int i)
const;
167 bool getEnableVal(
int i)
const;
168 bool getEnableInterp(
int i)
const;
170 bool getStrictOrder()
const;
171 void setStrictOrder(
bool strict);
173 void clearSelection();
174 bool isNodeSelected(
int i)
const;
175 void selectNode(
int i,
bool add);
176 void selectRange(
int first_i,
int last_i,
bool add);
177 void deselectNode(
int i);
178 void toggleSelectNode(
int i);
188 bool current =
true);
191 bool current =
true);
194 bool current =
true);
198 bool current =
true);
201 bool current =
true);
205 void recordNodePositions();
207 bool deleteNode(
fpreal pos);
208 bool deleteNodeAt(
int i);
209 void deleteSelectedNodes();
211 bool isNodeHandle(
int i)
const;
212 bool isNodeLeftHandle(
int i)
const;
213 bool isNodeRightHandle(
int i)
const;
215 void moveNode(
int i,
fpreal pos);
220 int load(
const char *pathname);
223 int save(
const char *pathname)
const;
224 int save(std::ostream &os)
const;
236 int order = 0)
const;
237 void rampLookupNoInterp(
fpreal pos,
float values[4])
const;
239 int ns,
int order = 0)
const;
243 template <
typename ARCHIVER_T>
244 bool serialize(ARCHIVER_T &archiver);
256 bool resolveOpRamp(
const char *op_path,
257 const char *ramp_parm,
258 bool *is_rgb =
nullptr,
259 int *op_id =
nullptr,
260 int *op_version =
nullptr);
266 UT_RGBA *sampleColors(
int nsamples,
bool do_interp);
267 UT_BIG_RGBA *sampleColors16(
int nsamples,
bool do_interp);
275 void getColorAndMultiply(
fpreal pos,
bool do_interp,
277 void getColorAndMultiply(
fpreal pos,
bool do_interp,
280 void interpColor(
fpreal pos,
float vals[4],
281 int order = 0)
const;
283 void updateSplineIfNeeded()
const;
285 int i,
float *
val,
int order = 0)
const;
288 template <
typename T>
294 template <
typename T>
302 typedef tbb::spin_mutex SplineLock;
312 mutable bool mySplineUpToDate;
313 mutable SplineLock mySplineLock;
334 virtual bool resolveRampParm(
UT_Ramp &target_ramp,
336 const char *ramp_parm,
337 bool *is_rgb =
nullptr,
338 int *op_id =
nullptr,
339 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
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)