HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpenColorTransforms.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 // Copyright Contributors to the OpenColorIO Project.
3 
4 
5 #ifndef INCLUDED_OCIO_OPENCOLORTRANSFORMS_H
6 #define INCLUDED_OCIO_OPENCOLORTRANSFORMS_H
7 
8 #include <initializer_list>
9 #include <limits>
10 
11 #include "OpenColorTypes.h"
12 
13 #ifndef OCIO_NAMESPACE
14 #error This header cannot be used directly. Use <OpenColorIO/OpenColorIO.h> instead.
15 #endif
16 
17 /**
18  * C++ Transforms
19  * ==============
20  *
21  * Typically only needed when creating and/or manipulating configurations
22  */
23 
24 namespace OCIO_NAMESPACE
25 {
26 
27 
28 
29 /**
30  * The FormatMetadata class is intended to be a generic container to hold metadata from various
31  * file formats.
32  *
33  * This class provides a hierarchical metadata container. A metadata object is similar to an
34  * element in XML. The top level element is named "ROOT" and can't be renamed. Several transforms
35  * have a FormatMetadata.
36  * The root element and all of the sub-elements may contain:
37  * * A name string (e.g. "ROOT", "Description"...). Name can't be empty.
38  * * A value string (e.g. "updated viewing LUT"). Value can be empty.
39  * * A list of attributes (name, value) string pairs (e.g. "version", "1.5"). There are helper
40  * functions to get and set "id" and "name" attributes. Attribute names are unique.
41  * * And a list of child sub-elements, which are also objects implementing FormatMetadata. There
42  * can be several sub-elements with the same name.
43  */
45 {
46 public:
47  virtual const char * getElementName() const noexcept = 0;
48  /// Name has to be a non-empty string. Top-level element can't be renamed. 'ROOT' is reserved.
49  virtual void setElementName(const char *) = 0;
50 
51  virtual const char * getElementValue() const noexcept = 0;
52  virtual void setElementValue(const char *) = 0;
53 
54  virtual int getNumAttributes() const noexcept = 0;
55  /// Get the name of a attribute ("" if attribute does not exist).
56  virtual const char * getAttributeName(int i) const noexcept = 0;
57  /// Get the value of a attribute ("" if attribute does not exist).
58  virtual const char * getAttributeValue(int i) const noexcept = 0;
59  /// Get the value of a attribute of a given name ("" if attribute does not exist).
60  virtual const char * getAttributeValue(const char * name) const noexcept = 0;
61  /**
62  * Add an attribute with a given name and value. If an attribute with the same name already
63  * exists, its value is replaced. Throw if name is NULL or empty.
64  */
65  virtual void addAttribute(const char * name, const char * value) = 0;
66 
67  virtual int getNumChildrenElements() const noexcept = 0;
68  /**
69  * Access a child element.
70  *
71  * \note
72  * Adding siblings might cause a reallocation of the container and thus might make the
73  * reference unusable.
74  * Index i has to be positive and less than getNumChildrenElements() or the function will
75  * throw.
76  */
77  virtual const FormatMetadata & getChildElement(int i) const = 0;
78  virtual FormatMetadata & getChildElement(int i) = 0;
79 
80  /**
81  * Add a child element with a given name and value.
82  *
83  * Name has to be non-empty. Value may be empty, particularly if this element will have
84  * children. Element is added after all existing children. Use
85  * getChildElement(getNumChildrenElements()-1) to access the added element.
86  */
87  virtual void addChildElement(const char * name, const char * value) = 0;
88 
89  /// Remove all children, all attributes and the value.
90  virtual void clear() noexcept = 0;
91 
92  virtual FormatMetadata & operator=(const FormatMetadata & rhs) = 0;
93 
94  /**
95  * Convenience method to easily get/set the 'name' attribute. This corresponds to the
96  * ProcessNode name attribute from a CLF / CTF file or the name key of a transform in the
97  * config YAML.
98  */
99  virtual const char * getName() const noexcept = 0;
100  virtual void setName(const char * name) noexcept = 0;
101  /**
102  * Convenience method to easily get/set the 'id' attribute. This corresponds to the
103  * ProcessNode id attribute from a CLF/CTF file or the ColorCorrection id attribute from a
104  * CC/CCC/CDL file.
105  */
106  virtual const char * getID() const noexcept = 0;
107  virtual void setID(const char * id) noexcept = 0;
108 
109  FormatMetadata(const FormatMetadata & rhs) = delete;
110  /// Do not use (needed only for pybind11).
111  virtual ~FormatMetadata() = default;
112 
113 protected:
114  FormatMetadata() = default;
115 };
116 
117 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const FormatMetadata &);
118 
119 
120 /// Base class for all the transform classes
122 {
123 public:
124  virtual TransformRcPtr createEditableCopy() const = 0;
125 
126  virtual TransformDirection getDirection() const noexcept = 0;
127  /// Note that this only affects the evaluation and not the values stored in the object.
128  virtual void setDirection(TransformDirection dir) noexcept = 0;
129 
130  virtual TransformType getTransformType() const noexcept = 0;
131 
132  /// Will throw if data is not valid.
133  virtual void validate() const;
134 
135  Transform(const Transform &) = delete;
136  Transform & operator= (const Transform &) = delete;
137  /// Do not use (needed only for pybind11).
138  virtual ~Transform() = default;
139 
140 protected:
141  Transform() = default;
142 };
143 
144 extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Transform&);
145 
146 
147 
148 /**
149  * Forward direction wraps the 'expanded' range into the
150  * specified, often compressed, range.
151  */
153 {
154 public:
155  static AllocationTransformRcPtr Create();
156 
157  TransformRcPtr createEditableCopy() const override;
158 
159  TransformDirection getDirection() const noexcept override;
160  void setDirection(TransformDirection dir) noexcept override;
161 
162  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_ALLOCATION; }
163 
164  /// Will throw if data is not valid.
165  void validate() const override;
166 
167  Allocation getAllocation() const;
168  void setAllocation(Allocation allocation);
169 
170  int getNumVars() const;
171  void getVars(float * vars) const;
172  void setVars(int numvars, const float * vars);
173 
175  /// Do not use (needed only for pybind11).
176  virtual ~AllocationTransform();
177 
178 private:
181 
182  static void deleter(AllocationTransform * t);
183 
184  class Impl;
185  Impl * m_impl;
186  Impl * getImpl() { return m_impl; }
187  const Impl * getImpl() const { return m_impl; }
188 };
189 
190 extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const AllocationTransform&);
191 
192 
193 /**
194  * A built-in transform is similar to a FileTransform, but without the file.
195  * OCIO knows how to build a set of commonly used transforms on-demand, thus avoiding the need
196  * for external files and simplifying config authoring.
197  */
199 {
200 public:
201  static BuiltinTransformRcPtr Create();
202 
203  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_BUILTIN; }
204 
205  virtual const char * getStyle() const noexcept = 0;
206  /**
207  * Select an existing built-in transform style from the list accessible
208  * through :cpp:class:`BuiltinTransformRegistry`. The style is the ID string that identifies
209  * which transform to apply.
210  */
211  virtual void setStyle(const char * style) = 0;
212 
213  virtual const char * getDescription() const noexcept = 0;
214 
215  /// Do not use (needed only for pybind11).
216  virtual ~BuiltinTransform() = default;
217 
218 protected:
219  BuiltinTransform() = default;
220 
221 private:
222  BuiltinTransform(const BuiltinTransform &) = delete;
223  BuiltinTransform & operator= (const BuiltinTransform &) = delete;
224 };
225 
226 //
227 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const BuiltinTransform &) noexcept;
228 
229 
230 /**
231  * \brief
232  * An implementation of the ASC Color Decision List (CDL), based on the ASC v1.2
233  * specification.
234  *
235  * **ASC_SOP**
236  *
237  * Slope, offset, power::
238  * out = clamp( (in * slope) + offset ) ^ power
239  *
240  * \note​
241  * If the config version is 1, negative values are clamped if the power is not 1.0.
242  * For config version 2 and higher, the negative handling is controlled by the CDL style.
243  */
245 {
246 public:
247  static CDLTransformRcPtr Create();
248 
249  /**
250  * \brief Load the CDL from the src .cdl, .cc, or .ccc file.
251  *
252  * \note
253  * The cccid can be the ID of a CDL or the index of the CDL (as string). If cccid is NULL or
254  * empty the first CDL is returned. The cccid is case-sensitive. The src must be an
255  * absolute path reference, no relative directory or envvar resolution is performed. Throws
256  * if file does not contain any CDL or if the specified cccid is not found.
257  */
258  static CDLTransformRcPtr CreateFromFile(const char * src, const char * cccid);
259 
260  /**
261  * \brief Load all of the CDLs in a .cdl or .ccc file into a single GroupTransform.
262  *
263  * \note
264  * This may be useful as a quicker way for applications to check the contents of each of
265  * the CDLs. The src must be an absolute path reference, no relative directory or envvar
266  * resolution is performed.
267  */
268  static GroupTransformRcPtr CreateGroupFromFile(const char * src);
269 
270  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_CDL; }
271 
272  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
273  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
274 
275  virtual bool equals(const CDLTransform & other) const noexcept = 0;
276 
277  virtual CDLStyle getStyle() const = 0;
278  /**
279  * Use CDL_ASC to clamp values to [0,1] per the ASC spec. Use NO_CLAMP to
280  * never clamp values (regardless of whether power is 1.0). The NO_CLAMP option passes
281  * negatives through unchanged (like the NEGATIVE_PASS_THRU style of ExponentTransform).
282  * The default style is CDL_NO_CLAMP.
283  */
284  virtual void setStyle(CDLStyle style) = 0;
285 
286  virtual void getSlope(double * rgb) const = 0;
287  virtual void setSlope(const double * rgb) = 0;
288 
289  virtual void getOffset(double * rgb) const = 0;
290  virtual void setOffset(const double * rgb) = 0;
291 
292  virtual void getPower(double * rgb) const = 0;
293  virtual void setPower(const double * rgb) = 0;
294 
295  virtual void getSOP(double * vec9) const = 0;
296  virtual void setSOP(const double * vec9) = 0;
297 
298  virtual double getSat() const = 0;
299  virtual void setSat(double sat) = 0;
300 
301  /// These are hard-coded, by spec, to r709.
302  virtual void getSatLumaCoefs(double * rgb) const = 0;
303 
304  /**
305  * The get/setID methods are now deprecated. The preferred way of interacting with the ID is
306  * now via the transform's formatMetadata.
307  */
308  virtual const char * getID() const = 0;
309  virtual void setID(const char * id) = 0;
310 
311  /* Get/Set the first Description element under the SOPNode.
312  * Note: These emulate the get/setDescription methods from OCIO v1.
313  *
314  * Use the FormatMetadata interface for access to other Description elements in the CDL.
315  * The Description children of the SOPNode element in the CDL XML are named 'SOPDescription'
316  * in the FormatMetadata. NULL or empty string removes the first SOPDescription element.
317  */
318  virtual const char * getFirstSOPDescription() const = 0;
319  virtual void setFirstSOPDescription(const char * description) = 0;
320 
321  CDLTransform(const CDLTransform &) = delete;
322  CDLTransform & operator= (const CDLTransform &) = delete;
323  /// Do not use (needed only for pybind11).
324  virtual ~CDLTransform() = default;
325 
326 protected:
327  CDLTransform() = default;
328 };
329 
330 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const CDLTransform &);
331 
332 
334 {
335 public:
336  static ColorSpaceTransformRcPtr Create();
337 
338  TransformRcPtr createEditableCopy() const override;
339 
340  TransformDirection getDirection() const noexcept override;
341  void setDirection(TransformDirection dir) noexcept override;
342 
343  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_COLORSPACE; }
344 
345  void validate() const override;
346 
347  const char * getSrc() const;
348  void setSrc(const char * src);
349 
350  const char * getDst() const;
351  void setDst(const char * dst);
352 
353  /// Data color spaces do not get processed when true (which is the default).
354  bool getDataBypass() const noexcept;
355  void setDataBypass(bool enabled) noexcept;
356 
357  ColorSpaceTransform & operator=(const ColorSpaceTransform &) = delete;
358  /// Do not use (needed only for pybind11).
359  virtual ~ColorSpaceTransform();
360 
361 private:
362  ColorSpaceTransform();
363  ColorSpaceTransform(const ColorSpaceTransform &);
364 
365  static void deleter(ColorSpaceTransform * t);
366 
367  class Impl;
368  Impl * m_impl;
369  Impl * getImpl() { return m_impl; }
370  const Impl * getImpl() const { return m_impl; }
371 };
372 
373 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const ColorSpaceTransform &);
374 
375 
376 class OCIOEXPORT DisplayViewTransform : public Transform
377 {
378 public:
379  static DisplayViewTransformRcPtr Create();
380 
381  TransformRcPtr createEditableCopy() const override;
382 
383  TransformDirection getDirection() const noexcept override;
384  void setDirection(TransformDirection dir) noexcept override;
385 
386  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_DISPLAY_VIEW; }
387 
388  /// Will throw if data is not valid.
389  void validate() const override;
390 
391  const char * getSrc() const;
392  /// Specify the incoming color space.
393  void setSrc(const char * name);
394 
395  const char * getDisplay() const;
396  /// Specify which display to use.
397  void setDisplay(const char * display);
398 
399  const char * getView() const;
400  /// Specify which view transform to use.
401  void setView(const char * view);
402 
403  bool getLooksBypass() const;
404  /// Looks will be bypassed when true (the default is false).
405  void setLooksBypass(bool bypass);
406 
407  bool getDataBypass() const noexcept;
408  /// Data color spaces do not get processed when true (which is the default).
409  void setDataBypass(bool bypass) noexcept;
410 
411  /// Do not use (needed only for pybind11).
412  virtual ~DisplayViewTransform();
413 
414 private:
415  DisplayViewTransform();
416  DisplayViewTransform(const DisplayViewTransform &) = delete;
417  DisplayViewTransform & operator=(const DisplayViewTransform &) = delete;
418 
419  static void deleter(DisplayViewTransform * t);
420 
421  class Impl;
422  Impl * m_impl;
423  Impl * getImpl() { return m_impl; }
424  const Impl * getImpl() const { return m_impl; }
425 };
426 
427 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const DisplayViewTransform &);
428 
429 /**
430  * Used by the grading transforms to hold the red, green, blue, and master components
431  * of a single parameter. The master component affects all three channels (RGB).
432  */
434 {
435  GradingRGBM() = default;
436  GradingRGBM(double red, double green, double blue, double master)
437  : m_red(red)
438  , m_green(green)
439  , m_blue(blue)
440  , m_master(master)
441  {
442  }
443  GradingRGBM(const double(&rgbm)[4])
444  : m_red(rgbm[0])
445  , m_green(rgbm[1])
446  , m_blue(rgbm[2])
447  , m_master(rgbm[3])
448  {
449  }
450  double m_red{ 0. };
451  double m_green{ 0. };
452  double m_blue{ 0. };
453  double m_master{ 0. };
454 };
455 
456 extern OCIOEXPORT bool operator==(const GradingRGBM & lhs, const GradingRGBM & rhs);
457 extern OCIOEXPORT bool operator!=(const GradingRGBM & lhs, const GradingRGBM & rhs);
458 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBM &);
459 
460 /// Grading primary values.
462 {
463  GradingPrimary() = delete;
464  explicit GradingPrimary(GradingStyle style)
465  : m_pivot(style == GRADING_LOG ? -0.2 : 0.18)
466  , m_clampBlack(NoClampBlack())
467  , m_clampWhite(NoClampWhite())
468  {
469  }
470 
471  GradingRGBM m_brightness{ 0.0, 0.0, 0.0, 0.0 };
472  GradingRGBM m_contrast { 1.0, 1.0, 1.0, 1.0 };
473  GradingRGBM m_gamma { 1.0, 1.0, 1.0, 1.0 };
474  GradingRGBM m_offset { 0.0, 0.0, 0.0, 0.0 };
475  GradingRGBM m_exposure { 0.0, 0.0, 0.0, 0.0 };
476  GradingRGBM m_lift { 0.0, 0.0, 0.0, 0.0 };
477  GradingRGBM m_gain { 1.0, 1.0, 1.0, 1.0 };
478 
479  double m_saturation{ 1.0 };
480  double m_pivot; // For LOG default is -0.2. LIN default is 0.18.
481  double m_pivotBlack{ 0.0 };
482  double m_pivotWhite{ 1.0 };
483  double m_clampBlack;
484  double m_clampWhite;
485 
486  /// The valid range for each parameter varies.
487  void validate(GradingStyle style) const;
488 
489  static double NoClampBlack();
490  static double NoClampWhite();
491 };
492 
493 extern OCIOEXPORT bool operator==(const GradingPrimary & lhs, const GradingPrimary & rhs);
494 extern OCIOEXPORT bool operator!=(const GradingPrimary & lhs, const GradingPrimary & rhs);
495 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingPrimary &);
496 
497 /// 2D control point used by \ref GradingBSplineCurve.
499 {
500  GradingControlPoint() = default;
501  GradingControlPoint(float x, float y) : m_x(x), m_y(y) {}
502  float m_x{ 0.f };
503  float m_y{ 0.f };
504 };
505 
506 extern OCIOEXPORT bool operator==(const GradingControlPoint & lhs, const GradingControlPoint & rhs);
507 extern OCIOEXPORT bool operator!=(const GradingControlPoint & lhs, const GradingControlPoint & rhs);
508 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingControlPoint &);
509 
510 /// A BSpline curve defined with \ref GradingControlPoint.
512 {
513 public:
514  /// Create a BSpline curve with a specified number of control points.
515  static GradingBSplineCurveRcPtr Create(size_t size);
516  static GradingBSplineCurveRcPtr Create(size_t size, BSplineType splineType);
517  static GradingBSplineCurveRcPtr Create(size_t size, HueCurveType curveType);
518  /// Create a BSpline curve with a list of control points.
519  static GradingBSplineCurveRcPtr Create(std::initializer_list<GradingControlPoint> values);
520  static GradingBSplineCurveRcPtr Create(std::initializer_list<GradingControlPoint> values, BSplineType splineType);
521  static GradingBSplineCurveRcPtr Create(std::initializer_list<GradingControlPoint> values, HueCurveType curveType);
522 
523  virtual GradingBSplineCurveRcPtr createEditableCopy() const = 0;
524  /// Get the number of ControlPoint objects (and the number of slopes).
525  virtual size_t getNumControlPoints() const noexcept = 0;
526  virtual void setNumControlPoints(size_t size) = 0;
527  virtual const GradingControlPoint & getControlPoint(size_t index) const = 0;
528  virtual GradingControlPoint & getControlPoint(size_t index) = 0;
529  virtual float getSlope(size_t index) const = 0;
530  virtual void setSlope(size_t index, float slope) = 0;
531  virtual bool slopesAreDefault() const = 0;
532  virtual void validate() const = 0;
533  virtual BSplineType getSplineType() const = 0;
534  virtual void setSplineType(BSplineType splineType) = 0;
535 
536  GradingBSplineCurve(const GradingBSplineCurve &) = delete;
538 
539  /// Do not use (needed only for pybind11).
540  virtual ~GradingBSplineCurve() = default;
541 
542 protected:
543  GradingBSplineCurve() = default;
544 };
545 
546 extern OCIOEXPORT bool operator==(const GradingBSplineCurve & lhs, const GradingBSplineCurve & rhs);
547 extern OCIOEXPORT bool operator!=(const GradingBSplineCurve & lhs, const GradingBSplineCurve & rhs);
548 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingBSplineCurve &);
549 
550 /**
551  * A set of red, green, blue and master curves. It is used by RGBCurveTransform and can be used as
552  * a dynamic property (see \ref DynamicPropertyGradingRGBCurve).
553  */
555 {
556 public:
557  /// Create a GradingRGBCurve. (The style argument is not part of the object, it is simply
558  /// used to initialize the proper default curves.)
559  static GradingRGBCurveRcPtr Create(GradingStyle style);
560  static GradingRGBCurveRcPtr Create(const ConstGradingRGBCurveRcPtr & rhs);
564  const ConstGradingBSplineCurveRcPtr & master);
565 
566  virtual GradingRGBCurveRcPtr createEditableCopy() const = 0;
567  virtual void validate() const = 0;
568  virtual bool isIdentity() const = 0;
569  virtual ConstGradingBSplineCurveRcPtr getCurve(RGBCurveType c) const = 0;
570  virtual GradingBSplineCurveRcPtr getCurve(RGBCurveType c) = 0;
571 
572  /// Do not use (needed only for pybind11).
573  virtual ~GradingRGBCurve() = default;
574 
575 protected:
576  GradingRGBCurve() = default;
577 };
578 
579 extern OCIOEXPORT bool operator==(const GradingRGBCurve & lhs, const GradingRGBCurve & rhs);
580 extern OCIOEXPORT bool operator!=(const GradingRGBCurve & lhs, const GradingRGBCurve & rhs);
581 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBCurve &);
582 
583 /**
584  * A set of HUE/SAT/LUM curves. It is used by GradingHueCurveTransform and can be used as
585  * a dynamic property (see \ref DynamicPropertyGradingHueCurve).
586  */
588 {
589 public:
590  /// Create a GradingHueCurve. (The style argument is not part of the object, it is simply
591  /// used to initialize the proper default curves.)
592  static GradingHueCurveRcPtr Create(GradingStyle style);
593  static GradingHueCurveRcPtr Create(const ConstGradingHueCurveRcPtr & rhs);
594  static GradingHueCurveRcPtr Create(
603 
604  static BSplineType GetBSplineTypeForHueCurveType(HueCurveType curveType);
605 
606  virtual GradingHueCurveRcPtr createEditableCopy() const = 0;
607  virtual void validate() const = 0;
608  virtual bool isIdentity() const = 0;
609  /**
610  * Enable drawCurveOnly mode to return the output value of a spline curve without any of the
611  * other associated processing of the RGB values. This is useful when the curves need to be
612  * graphed independently in a user interface. To use this, set the curve parameters on the
613  * Hue-Sat curve. The R, G, and B values will be sent through that curve with the interpretation
614  * that they are the input axis to the curve (which would be hue, sat, or luma) rather than RGB.
615  * This mode does not apply the RGB-to-HSY or Lin-to-Log, so for scene-linear curves the luma
616  * values are interpreted as already being in the logarithmic (f-stop) space. The forward curve
617  * evaluation is done regardless of the transform direction.
618  */
619  virtual bool getDrawCurveOnly() const = 0;
620  virtual void setDrawCurveOnly(bool drawCurveOnly) = 0;
621  virtual ConstGradingBSplineCurveRcPtr getCurve(HueCurveType c) const = 0;
622  virtual GradingBSplineCurveRcPtr getCurve(HueCurveType c) = 0;
623 
624  /// Do not use (needed only for pybind11).
625  virtual ~GradingHueCurve() = default;
626 
627 protected:
628  GradingHueCurve() = default;
629 };
630 
631 extern OCIOEXPORT bool operator==(const GradingHueCurve & lhs, const GradingHueCurve & rhs);
632 extern OCIOEXPORT bool operator!=(const GradingHueCurve & lhs, const GradingHueCurve & rhs);
633 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingHueCurve &);
634 
635 /**
636  * Used by the grading tone transforms to hold the red, green, blue, master, start,
637  * and width components of a single parameter. The master component affects all three channels
638  * (RGB). The start and width components control the range of tones affected. Although this
639  * struct simply uses "start" and "width" for all the range values, the actual user-facing name
640  * changes based on the parameter.
641  */
643 {
644  GradingRGBMSW() = default;
645  GradingRGBMSW(double red, double green, double blue, double master, double start, double width)
646  : m_red (red)
647  , m_green (green)
648  , m_blue (blue)
649  , m_master(master)
650  , m_start (start)
651  , m_width (width)
652  {
653  }
654  GradingRGBMSW(const double(&rgbmsw)[6])
655  : m_red (rgbmsw[0])
656  , m_green (rgbmsw[1])
657  , m_blue (rgbmsw[2])
658  , m_master(rgbmsw[3])
659  , m_start (rgbmsw[4])
660  , m_width (rgbmsw[5])
661  {
662  }
663  GradingRGBMSW(double start, double width)
664  : m_start(start)
665  , m_width(width)
666  {
667  }
668  double m_red { 1. };
669  double m_green { 1. };
670  double m_blue { 1. };
671  double m_master{ 1. };
672  double m_start { 0. }; // Or center for midtones.
673  double m_width { 1. }; // Or pivot for shadows and highlights.
674 };
675 
676 extern OCIOEXPORT bool operator==(const GradingRGBMSW & lhs, const GradingRGBMSW & rhs);
677 extern OCIOEXPORT bool operator!=(const GradingRGBMSW & lhs, const GradingRGBMSW & rhs);
678 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBMSW &);
679 
680 /// Grading tone values.
682 {
683  GradingTone() = delete;
684  explicit GradingTone(GradingStyle style)
685  : m_blacks(style == GRADING_LIN ? GradingRGBMSW(0., 4.) :
686  (style == GRADING_LOG ? GradingRGBMSW(0.4, 0.4) :
687  GradingRGBMSW(0.4, 0.4)))
688  , m_shadows(style == GRADING_LIN ? GradingRGBMSW(2., -7.) :
689  (style == GRADING_LOG ? GradingRGBMSW(0.5, 0.) :
690  GradingRGBMSW(0.6, 0.)))
691  , m_midtones(style == GRADING_LIN ? GradingRGBMSW(0., 8.) :
692  (style == GRADING_LOG ? GradingRGBMSW(0.4, 0.6) :
693  GradingRGBMSW(0.4, 0.7)))
694  , m_highlights(style == GRADING_LIN ? GradingRGBMSW(-2., 9.) :
695  (style == GRADING_LOG ? GradingRGBMSW(0.3, 1.) :
696  GradingRGBMSW(0.2, 1.)))
697  , m_whites(style == GRADING_LIN ? GradingRGBMSW(0., 8.) :
698  (style == GRADING_LOG ? GradingRGBMSW(0.4, 0.5) :
699  GradingRGBMSW(0.5, 0.5)))
700  {
701  }
702 
703  /**
704  * The valid range for each parameter varies. The client is expected to enforce
705  * these bounds in the UI.
706  */
707  void validate() const;
708 
714  double m_scontrast{ 1.0 };
715 };
716 
717 extern OCIOEXPORT bool operator==(const GradingTone & lhs, const GradingTone & rhs);
718 extern OCIOEXPORT bool operator!=(const GradingTone & lhs, const GradingTone & rhs);
719 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingTone &);
720 
721 /**
722  * Allows transform parameter values to be set on-the-fly (after finalization). For
723  * example, to modify the exposure in a viewport. Dynamic properties can be accessed from the
724  * `CPUProcessor` or `GpuShaderCreator` to change values between processing.
725  *
726  * \code{.cpp}
727  *
728  * OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
729  * OCIO::ConstProcessorRcPtr processor = config->getProcessor(colorSpace1, colorSpace2);
730  * OCIO::ConstCPUProcessorRcPtr cpuProcessor = processor->getDefaultCPUProcessor();
731  *
732  * if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_EXPOSURE))
733  * {
734  * // Get the in-memory implementation of the dynamic property.
735  * OCIO::DynamicPropertyRcPtr dynProp =
736  * cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_EXPOSURE);
737  * // Get the interface used to change the double value.
738  * OCIO::DynamicPropertyDoubleRcPtr exposure =
739  * OCIO::DynamicPropertyValue::AsDouble(dynProp);
740  * // Update of the dynamic property instance with the new value.
741  * exposure->setValue(1.1f);
742  * }
743  * if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_PRIMARY))
744  * {
745  * OCIO::DynamicPropertyRcPtr dynProp =
746  * cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_PRIMARY);
747  * OCIO::DynamicPropertyGradingPrimaryRcPtr primaryProp =
748  * OCIO::DynamicPropertyValue::AsGradingPrimary(dynProp);
749  * OCIO::GradingPrimary primary = primaryProp->getValue();
750  * primary.m_saturation += 0.1f;
751  * primaryProp->setValue(primary);
752  * }
753  * if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE))
754  * {
755  * OCIO::DynamicPropertyRcPtr dynProp =
756  * cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE);
757  * OCIO::DynamicPropertyGradingRGBCurveRcPtr rgbCurveProp =
758  * OCIO::DynamicPropertyValue::AsGradingRGBCurve(dynProp);
759  * OCIO::ConstGradingRGBCurveRcPtr rgbCurve = rgbCurveProp->getValue()->createEditableCopy();
760  * OCIO::GradingBSplineCurveRcPtr rCurve = rgbCurve->getCurve(OCIO::RGB_RED);
761  * rCurve->getControlPoint(1).m_y += 0.1f;
762  * rgbCurveProp->setValue(rgbCurve);
763  * }
764  * \endcode
765  */
767 {
768 public:
769  virtual DynamicPropertyType getType() const noexcept = 0;
770 
771  DynamicProperty & operator=(const DynamicProperty &) = delete;
772  DynamicProperty(const DynamicProperty &) = delete;
773 
774  /// Do not use (needed only for pybind11).
775  virtual ~DynamicProperty() = default;
776 
777 protected:
778  DynamicProperty() = default;
779 };
780 
781 namespace DynamicPropertyValue
782 {
783 /**
784  * Get the property as DynamicPropertyDoubleRcPtr to access the double value. Will throw if
785  * property type is not a type that holds a double such as DYNAMIC_PROPERTY_EXPOSURE.
786  */
788 /**
789  * Get the property as DynamicPropertyGradingPrimaryRcPtr to access the GradingPrimary value. Will
790  * throw if property type is not DYNAMIC_PROPERTY_GRADING_PRIMARY.
791  */
793 /**
794  * Get the property as DynamicPropertyGradingRGBCurveRcPtr to access the GradingRGBCurveRcPtr
795  * value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_RGBCURVE.
796  */
798 /**
799  * Get the property as DynamicPropertyGradingHueCurveRcPtr to access the GradingHueCurveRcPtr
800  * value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_HUECURVE.
801  */
803 /**
804  * Get the property as DynamicPropertyGradingToneRcPtr to access the GradingTone value. Will throw
805  * if property type is not DYNAMIC_PROPERTY_GRADING_TONE.
806  */
808 }
809 
810 /// Interface used to access dynamic property double value.
812 {
813 public:
814  virtual double getValue() const = 0;
815  virtual void setValue(double value) = 0;
816 
819  /// Do not use (needed only for pybind11).
820  virtual ~DynamicPropertyDouble() = default;
821 
822 protected:
823  DynamicPropertyDouble() = default;
824 };
825 
826 /// Interface used to access dynamic property GradingPrimary value.
828 {
829 public:
830  virtual const GradingPrimary & getValue() const = 0;
831  /// Will throw if value is not valid.
832  virtual void setValue(const GradingPrimary & value) = 0;
833 
836  /// Do not use (needed only for pybind11).
837  virtual ~DynamicPropertyGradingPrimary() = default;
838 
839 protected:
840  DynamicPropertyGradingPrimary() = default;
841 };
842 
843 /// Interface used to access dynamic property ConstGradingRGBCurveRcPtr value.
845 {
846 public:
847  virtual const ConstGradingRGBCurveRcPtr & getValue() const = 0;
848  /// Will throw if value is not valid.
849  virtual void setValue(const ConstGradingRGBCurveRcPtr & value) = 0;
850 
853  /// Do not use (needed only for pybind11).
854  virtual ~DynamicPropertyGradingRGBCurve() = default;
855 
856 protected:
857  DynamicPropertyGradingRGBCurve() = default;
858 };
859 
860 /// Interface used to access dynamic property ConstGradingHueCurveRcPtr value.
862 {
863 public:
864  virtual const ConstGradingHueCurveRcPtr & getValue() const = 0;
865  /// Will throw if value is not valid.
866  virtual void setValue(const ConstGradingHueCurveRcPtr & value) = 0;
867 
870  /// Do not use (needed only for pybind11).
871  virtual ~DynamicPropertyGradingHueCurve() = default;
872 
873 protected:
874  DynamicPropertyGradingHueCurve() = default;
875 };
876 
877 /// Interface used to access dynamic property GradingTone value.
879 {
880 public:
881  virtual const GradingTone & getValue() const = 0;
882  /// Will throw if value is not valid.
883  virtual void setValue(const GradingTone & value) = 0;
884 
887  /// Do not use (needed only for pybind11).
888  virtual ~DynamicPropertyGradingTone() = default;
889 
890 protected:
891  DynamicPropertyGradingTone() = default;
892 };
893 
894 
895 /**
896  * \brief Represents exponent transform: pow( clamp(color), value ).
897  *
898  * \note For configs with version == 1: Negative style is ignored and if the exponent is 1.0,
899  * this will not clamp. Otherwise, the input color will be clamped between [0.0, inf].
900  * For configs with version > 1: Negative value handling may be specified via setNegativeStyle.
901  */
902 class OCIOEXPORT ExponentTransform : public Transform
903 {
904 public:
905  static ExponentTransformRcPtr Create();
906 
907  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_EXPONENT; }
908 
909  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
910  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
911 
912  /// Checks if this exactly equals other.
913  virtual bool equals(const ExponentTransform & other) const noexcept = 0;
914 
915  virtual void getValue(double(&vec4)[4]) const noexcept = 0;
916  virtual void setValue(const double(&vec4)[4]) noexcept = 0;
917 
918  /**
919  * Specifies how negative values are handled. Legal values:
920  *
921  * * NEGATIVE_CLAMP -- Clamp negative values (default).
922  * * NEGATIVE_MIRROR -- Positive curve is rotated 180 degrees around the origin to
923  * handle negatives.
924  * * NEGATIVE_PASS_THRU -- Negative values are passed through unchanged.
925  */
926  virtual NegativeStyle getNegativeStyle() const = 0;
927  virtual void setNegativeStyle(NegativeStyle style) = 0;
928 
929  ExponentTransform(const ExponentTransform &) = delete;
930  ExponentTransform & operator= (const ExponentTransform &) = delete;
931  /// Do not use (needed only for pybind11).
932  virtual ~ExponentTransform() = default;
933 
934 protected:
935  ExponentTransform() = default;
936 };
937 
938 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const ExponentTransform &);
939 
940 
941 /**
942  * Represents power functions with a linear section in the shadows
943  * such as sRGB and L*.
944  *
945  * The basic formula is::
946  *
947  * pow( (x + offset)/(1 + offset), gamma )
948  * with the breakpoint at offset/(gamma - 1).
949  *
950  * Negative values are never clamped.
951  */
953 {
954 public:
955  static ExponentWithLinearTransformRcPtr Create();
956 
958 
959  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
960  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
961 
962  /// Checks if this exactly equals other.
963  virtual bool equals(const ExponentWithLinearTransform & other) const noexcept = 0;
964 
965  virtual void getGamma(double(&values)[4]) const noexcept = 0;
966  /**
967  * Set the exponent value for the power function for R, G, B, A.
968  *
969  * \note
970  * The gamma values must be in the range of [1, 10]. Set the transform direction
971  * to inverse to obtain the effect of values less than 1.
972  */
973  virtual void setGamma(const double(&values)[4]) noexcept = 0;
974 
975  virtual void getOffset(double(&values)[4]) const noexcept = 0;
976  /**
977  * Set the offset value for the power function for R, G, B, A.
978  *
979  * \note
980  * The offset values must be in the range [0, 0.9].
981  */
982  virtual void setOffset(const double(&values)[4]) noexcept = 0;
983 
984  /**
985  * Specifies how negative values are handled. Legal values:
986  *
987  * * NEGATIVE_LINEAR -- Linear segment continues into negatives (default).
988  * * NEGATIVE_MIRROR -- Positive curve is rotated 180 degrees around the origin to
989  * handle negatives.
990  */
991  virtual NegativeStyle getNegativeStyle() const = 0;
992  virtual void setNegativeStyle(NegativeStyle style) = 0;
993 
995  ExponentWithLinearTransform & operator= (const ExponentWithLinearTransform &) = delete;
996  /// Do not use (needed only for pybind11).
997  virtual ~ExponentWithLinearTransform() = default;
998 
999 protected:
1000  ExponentWithLinearTransform() = default;
1001 };
1002 
1003 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const ExponentWithLinearTransform &);
1004 
1005 /**
1006  * Applies exposure, gamma, and pivoted contrast adjustments.
1007  * Adjusts the math to be appropriate for linear, logarithmic, or video
1008  * color spaces.
1009  */
1011 {
1012 public:
1013  static ExposureContrastTransformRcPtr Create();
1014 
1016 
1017  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1018  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1019 
1020  /// Checks if this exactly equals other.
1021  virtual bool equals(const ExposureContrastTransform & other) const noexcept = 0;
1022 
1023  virtual ExposureContrastStyle getStyle() const = 0;
1024  /// Select the algorithm for linear, video or log color spaces.
1025  virtual void setStyle(ExposureContrastStyle style) = 0;
1026 
1027  virtual double getExposure() const = 0;
1028  /**
1029  * Applies an exposure adjustment. The value is in units of stops (regardless of style), for
1030  * example, a value of -1 would be equivalent to reducing the lighting by one half.
1031  */
1032  virtual void setExposure(double exposure) = 0;
1033  /**
1034  * Exposure can be made dynamic so the value can be changed through the CPU or GPU processor,
1035  * but if there are several ExposureContrastTransform only one can have a dynamic exposure.
1036  */
1037  virtual bool isExposureDynamic() const = 0;
1038  virtual void makeExposureDynamic() = 0;
1039  virtual void makeExposureNonDynamic() = 0;
1040 
1041  virtual double getContrast() const = 0;
1042  /**
1043  * Applies a contrast/gamma adjustment around a pivot point. The contrast and gamma are
1044  * mathematically the same, but two controls are provided to enable the use of separate
1045  * dynamic parameters. Contrast is usually a scene-referred adjustment that pivots around
1046  * gray whereas gamma is usually a display-referred adjustment that pivots around white.
1047  */
1048  virtual void setContrast(double contrast) = 0;
1049  /**
1050  * Contrast can be made dynamic so the value can be changed through the CPU or GPU processor,
1051  * but if there are several ExposureContrastTransform only one can have a dynamic contrast.
1052  */
1053  virtual bool isContrastDynamic() const = 0;
1054  virtual void makeContrastDynamic() = 0;
1055  virtual void makeContrastNonDynamic() = 0;
1056 
1057  virtual double getGamma() const = 0;
1058  virtual void setGamma(double gamma) = 0;
1059  /**
1060  * Gamma can be made dynamic so the value can be changed through the CPU or GPU processor,
1061  * but if there are several ExposureContrastTransform only one can have a dynamic gamma.
1062  */
1063  virtual bool isGammaDynamic() const = 0;
1064  virtual void makeGammaDynamic() = 0;
1065  virtual void makeGammaNonDynamic() = 0;
1066 
1067  virtual double getPivot() const = 0;
1068  /**
1069  * Set the pivot point around which the contrast
1070  * and gamma controls will work. Regardless of whether
1071  * linear/video/log-style is being used, the pivot is always expressed
1072  * in linear. In other words, a pivot of 0.18 is always mid-gray.
1073  */
1074  virtual void setPivot(double pivot) = 0;
1075 
1076  virtual double getLogExposureStep() const = 0;
1077  /**
1078  * Set the increment needed to move one stop for
1079  * the log-style algorithm. For example, ACEScct is 0.057, LogC is
1080  * roughly 0.074, and Cineon is roughly 90/1023 = 0.088.
1081  * The default value is 0.088.
1082  */
1083  virtual void setLogExposureStep(double logExposureStep) = 0;
1084 
1085  virtual double getLogMidGray() const = 0;
1086  /**
1087  * Set the position of 18% gray for use by the
1088  * log-style algorithm. For example, ACEScct is about 0.41, LogC is
1089  * about 0.39, and ADX10 is 445/1023 = 0.435.
1090  * The default value is 0.435.
1091  */
1092  virtual void setLogMidGray(double logMidGray) = 0;
1093 
1094  /// Do not use (needed only for pybind11).
1095  virtual ~ExposureContrastTransform() = default;
1096 
1097 protected:
1098  ExposureContrastTransform() = default;
1099 
1100 private:
1102  ExposureContrastTransform & operator= (const ExposureContrastTransform &) = delete;
1103 };
1104 
1105 extern OCIOEXPORT std::ostream & operator<<(std::ostream &,
1106  const ExposureContrastTransform &);
1107 
1108 
1109 class OCIOEXPORT FileTransform : public Transform
1110 {
1111 public:
1112  static FileTransformRcPtr Create();
1113 
1114  TransformRcPtr createEditableCopy() const override;
1115 
1116  TransformDirection getDirection() const noexcept override;
1117  void setDirection(TransformDirection dir) noexcept override;
1118 
1119  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_FILE; }
1120 
1121  /// Will throw if data is not valid.
1122  void validate() const override;
1123 
1124  const char * getSrc() const;
1125  void setSrc(const char * src);
1126 
1127  /**
1128  * The cccid can be the ID of a CDL or the index of the CDL (as string). If cccid is NULL or
1129  * empty the first CDL is returned. The cccid is case-sensitive.
1130  */
1131  const char * getCCCId() const;
1132  void setCCCId(const char * id);
1133 
1134  CDLStyle getCDLStyle() const;
1135  /**
1136  * Can be used with CDL, CC & CCC formats to specify the clamping behavior of
1137  * the CDLTransform. Default is CDL_NO_CLAMP.
1138  */
1139  void setCDLStyle(CDLStyle);
1140 
1141  /**
1142  * The file parsers that care about interpolation (LUTs) will try to make use of the requested
1143  * interpolation method when loading the file. In these cases, if the requested method could
1144  * not be used, a warning is logged. If no method is provided, or a method cannot be used,
1145  * INTERP_DEFAULT is used.
1146  */
1147  Interpolation getInterpolation() const;
1148  void setInterpolation(Interpolation interp);
1149 
1150  /// Get the number of LUT readers.
1151  static int GetNumFormats();
1152  /// Get the LUT readers at index, return empty string if an invalid index is specified.
1153  static const char * GetFormatNameByIndex(int index);
1154  /// Get the LUT reader extension at index, return empty string if an invalid index is specified.
1155  static const char * GetFormatExtensionByIndex(int index);
1156  /// Returns true if the extension corresponds to a format supported by FileTransform.
1157  /// The argument is case-insensitive, and a leading dot, if present, is ignored.
1158  /// Note that FileTransform will attempt all format readers on a given file until it is
1159  /// successful, even files that contain an unsupported extension or no extension.
1160  /// However, this function is useful for applications that want to know which files are likely
1161  /// to be LUT files, based on their extension.
1162  static bool IsFormatExtensionSupported(const char * extension);
1163 
1164  FileTransform & operator=(const FileTransform &) = delete;
1165  /// Do not use (needed only for pybind11).
1166  virtual ~FileTransform();
1167 
1168 private:
1169  FileTransform();
1170  FileTransform(const FileTransform &);
1171 
1172  static void deleter(FileTransform * t);
1173 
1174  class Impl;
1175  Impl * m_impl;
1176  Impl * getImpl() { return m_impl; }
1177  const Impl * getImpl() const { return m_impl; }
1178 };
1179 
1180 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const FileTransform &);
1181 
1182 
1183 /**
1184  * Provides a set of hard-coded algorithmic building blocks
1185  * that are needed to accurately implement various common color transformations.
1186  */
1187 class OCIOEXPORT FixedFunctionTransform : public Transform
1188 {
1189 public:
1190  static FixedFunctionTransformRcPtr Create(FixedFunctionStyle style);
1191  static FixedFunctionTransformRcPtr Create(FixedFunctionStyle style,
1192  const double * params,
1193  size_t num);
1194 
1195  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_FIXED_FUNCTION; }
1196 
1197  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1198  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1199 
1200  /// Checks if this exactly equals other.
1201  virtual bool equals(const FixedFunctionTransform & other) const noexcept = 0;
1202 
1203  virtual FixedFunctionStyle getStyle() const = 0;
1204  /// Select which algorithm to use.
1205  virtual void setStyle(FixedFunctionStyle style) = 0;
1206 
1207  virtual size_t getNumParams() const = 0;
1208  virtual void getParams(double * params) const = 0;
1209  /// Set the parameters (for functions that require them).
1210  virtual void setParams(const double * params, size_t num) = 0;
1211 
1213  FixedFunctionTransform & operator= (const FixedFunctionTransform &) = delete;
1214  /// Do not use (needed only for pybind11).
1215  virtual ~FixedFunctionTransform() = default;
1216 
1217 protected:
1218  FixedFunctionTransform() = default;
1219 };
1220 
1221 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const FixedFunctionTransform &);
1222 
1223 
1224 /**
1225  * Primary color correction controls.
1226  *
1227  * This transform is for making basic color correction adjustments to an image such as brightness,
1228  * contrast, or saturation.
1229  *
1230  * The controls are customized for linear, logarithmic, and video color encodings.
1231  * * Linear controls: Exposure, Contrast, Pivot, Offset, Saturation, Black Clip, White Clip.
1232  * * Log controls: Brightness, Contrast, Pivot, Log Gamma, Saturation, Black Clip, White Clip,
1233  * Black Pivot White Pivot.
1234  * * Video controls : Lift, Gamma, Gain, Offset, Saturation, Black Clip, White Clip,
1235  * Black Pivot White Pivot.
1236  *
1237  * The controls are dynamic, so they may be adjusted even after the Transform has been included
1238  * in a Processor.
1239  */
1241 {
1242 public:
1243  /// Creates an instance of GradingPrimaryTransform.
1244  static GradingPrimaryTransformRcPtr Create(GradingStyle style);
1245 
1246  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_GRADING_PRIMARY; }
1247 
1248  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1249  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1250 
1251  /// Checks if this equals other.
1252  virtual bool equals(const GradingPrimaryTransform & other) const noexcept = 0;
1253 
1254  /// Adjusts the behavior of the transform for log, linear, or video color space encodings.
1255  virtual GradingStyle getStyle() const noexcept = 0;
1256  /// Will reset value to style's defaults if style is not the current style.
1257  virtual void setStyle(GradingStyle style) noexcept = 0;
1258 
1259  virtual const GradingPrimary & getValue() const = 0;
1260  /// Throws if value is not valid.
1261  virtual void setValue(const GradingPrimary & values) = 0;
1262 
1263  /**
1264  * Parameters can be made dynamic so the values can be changed through the CPU or GPU processor,
1265  * but if there are several GradingPrimaryTransform only one can have dynamic parameters.
1266  */
1267  virtual bool isDynamic() const noexcept = 0;
1268  virtual void makeDynamic() noexcept = 0;
1269  virtual void makeNonDynamic() noexcept = 0;
1270 
1272  GradingPrimaryTransform & operator= (const GradingPrimaryTransform &) = delete;
1273  /// Do not use (needed only for pybind11).
1274  virtual ~GradingPrimaryTransform() = default;
1275 
1276 protected:
1277  GradingPrimaryTransform() = default;
1278 };
1279 
1280 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingPrimaryTransform &) noexcept;
1281 
1282 /**
1283  * Hue curve color correction controls.
1284  *
1285  * This transform provides eight spline curves to make the following adjustments:
1286  *
1287  * - Hue-Hue: Map input hue to output hue (where a diagonal line is the identity).
1288  * - Hue-Sat: Adjust saturation as a function of hue (a value of 1.0 is the identity).
1289  * - Hue-Lum: Adjust luma as a function of hue (a value of 1.0 is the identity).
1290  * - Lum-Sat: Adjust saturation as a function of luma (a value of 1.0 is the identity).
1291  * - Sat-Sat: Adjust saturation as a function of saturation (a diagonal is the identity).
1292  * - Lum-Lum: Adjust luma as a function of luma, maintaining hue & sat (diagonal is identity).
1293  * - Sat-Lum: Adjust luma as a function of saturation (a value of 1.0 is the identity).
1294  * - Hue-FX : Map input hue to delta output hue (a value of 0.0 is the identity).
1295  *
1296  * The algorithm is different for scene-linear, logarithmic, and video color spaces, so
1297  * initialize the style argument appropriately before setting the curves.
1298  *
1299  * An RGB-to-HSY FixedFunction is used to convert RGB into a hue, saturation, luma color
1300  * space. However, there is an option to bypass that conversion to use an outboard transform.
1301  *
1302  * Like the GradingRGBCurveTransform, the curves are defined by the x and y coordinates of a
1303  * set of control points. A spline will be fit to the control points. Monotonicity is preserved
1304  * for curves where the diagonal is the identity. For curves that take luma as input, if the
1305  * style is scene-linear, the units are in photographic stops relative to 0.18. For log and
1306  * video, the luma is scaled the same as the input RGB.
1307  *
1308  * The hue variable is [0,1] and is periodic. For example, -0.2, 0.8, and 1.8 are equivalent.
1309  * The domain of the curves is [0,1] and control points outside that domain are mapped into it.
1310  * A hue of 0 or 1 corresponds to a magenta hue.
1311  *
1312  * The control points are dynamic, so they may be adjusted even after the Transform is included
1313  * in a Processor. However, creating a curve or setting the parameters will call the
1314  * GradingBSplineCurveImpl::validate function, which will throw an exception if the control
1315  * points do not meet certain requirements, for example that the X-coordinates are non-decreasing
1316  * Please review that function for details on the validation. Applications that provide a UI to
1317  * edit curves must ensure that they prevent users from creating control points that are not valid.
1318  *
1319  * The transform is invertible as long as the curves allow it. For example, if saturation is
1320  * mapped to zero, obviously that cannot be resaturated. Care should be taken with the Hue-FX
1321  * curve because it is possible to fold hues over on themselves, which also cannot be inverted.
1322  * In most cases the Hue-FX curve is not necessary since the Hue-Hue curve provides similar
1323  * functionality with the added benefit of being strictly invertible.
1324  */
1326 {
1327 public:
1328  /// Creates an instance of GradingHueCurveTransform.
1329  static GradingHueCurveTransformRcPtr Create(GradingStyle style);
1330 
1332 
1333  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1334  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1335 
1336  /// Checks if this equals other.
1337  virtual bool equals(const GradingHueCurveTransform & other) const noexcept = 0;
1338 
1339  /// Adjusts the behavior of the transform for log, linear, or video color space encodings.
1340  virtual GradingStyle getStyle() const noexcept = 0;
1341 
1342  /// Will reset value to style's defaults if style is not the current style.
1343  virtual void setStyle(GradingStyle style) noexcept = 0;
1344 
1345  virtual const ConstGradingHueCurveRcPtr getValue() const = 0;
1346 
1347  /// Throws if value is not valid.
1348  virtual void setValue(const ConstGradingHueCurveRcPtr & value) = 0;
1349 
1350  /**
1351  * It is possible to provide a desired slope value for each control point. The number of slopes is
1352  * always the same as the number of control points and so the control points must be set before
1353  * setting the slopes. The slopes are primarily intended for use by config authors looking to match
1354  * a specific shape with as few control points as possible, they are not intended to be exposed to
1355  * a user interface for direct manipulation. When a curve is being generated for creative purposes
1356  * it is better to let OCIO calculate the slopes automatically.
1357  */
1358  virtual float getSlope(HueCurveType c, size_t index) const = 0;
1359  virtual void setSlope(HueCurveType c, size_t index, float slope) = 0;
1360  virtual bool slopesAreDefault(HueCurveType c) const = 0;
1361 
1362  /**
1363  * By default, the input is transformed into HSY space to apply the hue curves and then the result is
1364  * transformed back to RGB. However, this may be set to HSY_TRANSFORM_NONE to bypass this in order to
1365  * use other hue/sat/luma type transforms applied separately before and after this transform.
1366  */
1367  virtual HSYTransformStyle getRGBToHSY() const = 0;
1368  virtual void setRGBToHSY(HSYTransformStyle style) = 0;
1369 
1370  ///**
1371  // * Parameters can be made dynamic so the values can be changed through the CPU or GPU processor,
1372  // * but if there are several GradingHueCurveTransform only one can have dynamic parameters.
1373  // */
1374  virtual bool isDynamic() const noexcept = 0;
1375  virtual void makeDynamic() noexcept = 0;
1376  virtual void makeNonDynamic() noexcept = 0;
1377 
1379  GradingHueCurveTransform & operator= (const GradingHueCurveTransform &) = delete;
1380 
1381  /// Do not use (needed only for pybind11).
1382  virtual ~GradingHueCurveTransform() = default;
1383 
1384 protected:
1385  GradingHueCurveTransform() = default;
1386 };
1387 
1388 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingHueCurveTransform &) noexcept;
1389 
1390 /**
1391  * RGB curve color correction controls.
1392  *
1393  * This transform allows for modifying tone reproduction via B-spline curves.
1394  *
1395  * There is an R, G, and B curve followed by a Master curve (that applies to R, G, and B). Each
1396  * curve is specified via the x and y coordinates of its control points. A monotonic spline is
1397  * fit to the control points. The x coordinates must be non-decreasing. When the grading style
1398  * is linear, the units for the control points are photographic stops relative to 0.18.
1399  *
1400  * The control points are dynamic, so they may be adjusted even after the Transform is included
1401  * in a Processor.
1402  */
1404 {
1405 public:
1406  /// Creates an instance of GradingPrimaryTransform.
1407  static GradingRGBCurveTransformRcPtr Create(GradingStyle style);
1408 
1410 
1411  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1412  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1413 
1414  /// Checks if this equals other.
1415  virtual bool equals(const GradingRGBCurveTransform & other) const noexcept = 0;
1416 
1417  /// Adjusts the behavior of the transform for log, linear, or video color space encodings.
1418  virtual GradingStyle getStyle() const noexcept = 0;
1419  /// Will reset value to style's defaults if style is not the current style.
1420  virtual void setStyle(GradingStyle style) noexcept = 0;
1421 
1422  virtual const ConstGradingRGBCurveRcPtr getValue() const = 0;
1423  /// Throws if value is not valid.
1424  virtual void setValue(const ConstGradingRGBCurveRcPtr & values) = 0;
1425 
1426  /**
1427  * It is possible to provide a desired slope value for each control point. The number of slopes is
1428  * always the same as the number of control points and so the control points must be set before
1429  * setting the slopes. The slopes are primarily intended for use by config authors looking to match
1430  * a specific shape with as few control points as possible, they are not intended to be exposed to
1431  * a user interface for direct manipulation. When a curve is being generated for creative purposes
1432  * it is better to let OCIO calculate the slopes automatically.
1433  */
1434  virtual float getSlope(RGBCurveType c, size_t index) const = 0;
1435  virtual void setSlope(RGBCurveType c, size_t index, float slope) = 0;
1436  virtual bool slopesAreDefault(RGBCurveType c) const = 0;
1437 
1438  /**
1439  * The scene-linear grading style applies a lin-to-log transform to the pixel
1440  * values before going through the curve. However, in some cases (e.g. drawing curves in a UI)
1441  * it may be useful to bypass the lin-to-log. Default value is false.
1442  */
1443  virtual bool getBypassLinToLog() const = 0;
1444  virtual void setBypassLinToLog(bool bypass) = 0;
1445 
1446  /**
1447  * Parameters can be made dynamic so the values can be changed through the CPU or GPU processor,
1448  * but if there are several GradingRGBCurveTransform only one can have dynamic parameters.
1449  */
1450  virtual bool isDynamic() const noexcept = 0;
1451  virtual void makeDynamic() noexcept = 0;
1452  virtual void makeNonDynamic() noexcept = 0;
1453 
1455  GradingRGBCurveTransform & operator= (const GradingRGBCurveTransform &) = delete;
1456  /// Do not use (needed only for pybind11).
1457  virtual ~GradingRGBCurveTransform() = default;
1458 
1459 protected:
1460  GradingRGBCurveTransform() = default;
1461 };
1462 
1463 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBCurveTransform &) noexcept;
1464 
1465 
1466 /**
1467  * Tonal color correction controls.
1468  *
1469  * This transform is for making fine adjustments to tone reproduction in specific tonal ranges.
1470  *
1471  * There are five tonal controls and each one has two parameters to control its range:
1472  * * Blacks (start, width)
1473  * * Shadows(start, pivot)
1474  * * Midtones(center, width)
1475  * * Highlights(start, pivot)
1476  * * Whites(start, width)
1477  *
1478  * The transform has three styles that adjust the response and default ranges for linear,
1479  * logarithimic, and video color encodings. The defaults vary based on the style. When the
1480  * style is linear, the units for start/width/etc. are photographic stops relative to 0.18.
1481  *
1482  * Each control allows R, G, B adjustments and a Master adjustment.
1483  *
1484  * There is also an S-contrast control for imparting an S-shape curve.
1485  *
1486  * The controls are dynamic, so they may be adjusted even after the Transform has been included
1487  * in a Processor.
1488  */
1490 {
1491 public:
1492  /// Creates an instance of GradingToneTransform.
1493  static GradingToneTransformRcPtr Create(GradingStyle style);
1494 
1495  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_GRADING_TONE; }
1496 
1497  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1498  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1499 
1500  virtual bool equals(const GradingToneTransform & other) const noexcept = 0;
1501 
1502  /// Adjusts the behavior of the transform for log, linear, or video color space encodings.
1503  virtual GradingStyle getStyle() const noexcept = 0;
1504  /// Will reset value to style's defaults if style is not the current style.
1505  virtual void setStyle(GradingStyle style) noexcept = 0;
1506 
1507  virtual const GradingTone & getValue() const = 0;
1508  virtual void setValue(const GradingTone & values) = 0;
1509 
1510  /**
1511  * Parameters can be made dynamic so the values can be changed through the CPU or GPU processor,
1512  * but if there are several GradingToneTransform only one can have dynamic parameters.
1513  */
1514  virtual bool isDynamic() const noexcept = 0;
1515  virtual void makeDynamic() noexcept = 0;
1516  virtual void makeNonDynamic() noexcept = 0;
1517 
1518  GradingToneTransform(const GradingToneTransform &) = delete;
1519  GradingToneTransform & operator= (const GradingToneTransform &) = delete;
1520  /// Do not use (needed only for pybind11).
1521  virtual ~GradingToneTransform() = default;
1522 
1523 protected:
1524  GradingToneTransform() = default;
1525 };
1526 
1527 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingToneTransform &) noexcept;
1528 
1529 
1530 class OCIOEXPORT GroupTransform : public Transform
1531 {
1532 public:
1533  static GroupTransformRcPtr Create();
1534 
1535  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1536  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1537 
1538  /// Throws if index is not allowed.
1539  virtual ConstTransformRcPtr getTransform(int index) const = 0;
1540 
1541  /// Throws if index is not allowed.
1542  virtual TransformRcPtr & getTransform(int index) = 0;
1543 
1544  /// Return number of transforms.
1545  virtual int getNumTransforms() const noexcept = 0;
1546  /// Adds a transform to the end of the group.
1547  virtual void appendTransform(TransformRcPtr transform) noexcept = 0;
1548  /// Add a transform at the beginning of the group.
1549  virtual void prependTransform(TransformRcPtr transform) noexcept = 0;
1550 
1551  /**
1552  * \brief Write the transforms comprising the group to the stream.
1553  *
1554  * Writing (as opposed to Baking) is a lossless process. An exception is thrown if the
1555  * processor cannot be losslessly written to the specified file format. Transforms such as
1556  * FileTransform or ColorSpaceTransform are resolved into write-able simple transforms using
1557  * the config and context. Supported formats include CTF, CLF, and CDL. All available formats
1558  * can be listed with the following:
1559  * \code{.cpp}
1560  * // What are the allowed writing output formats?
1561  * std::ostringstream formats;
1562  * formats << "Formats to write to: ";
1563  * for (int i = 0; i < GroupTransform::GetNumWriteFormats(); ++i)
1564  * {
1565  * if (i != 0) formats << ", ";
1566  * formats << GroupTransform::GetFormatNameByIndex(i);
1567  * formats << " (." << GroupTransform::GetFormatExtensionByIndex(i) << ")";
1568  * }
1569  * \endcode
1570  */
1571  virtual void write(const ConstConfigRcPtr & config,
1572  const char * formatName,
1573  std::ostream & os) const = 0;
1574 
1575  /// Get the number of writers.
1576  static int GetNumWriteFormats() noexcept;
1577 
1578  /// Get the writer at index, return empty string if an invalid index is specified.
1579  static const char * GetFormatNameByIndex(int index) noexcept;
1580  static const char * GetFormatExtensionByIndex(int index) noexcept;
1581 
1582  GroupTransform(const GroupTransform &) = delete;
1583  GroupTransform & operator=(const GroupTransform &) = delete;
1584  /// Do not use (needed only for pybind11).
1585  virtual ~GroupTransform() = default;
1586 
1587 protected:
1588  GroupTransform() = default;
1589 };
1590 
1591 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GroupTransform &);
1592 
1593 
1594 
1595 /**
1596  * Applies a logarithm with an affine transform before and after.
1597  * Represents the Cineon lin-to-log type transforms::
1598  *
1599  * logSideSlope * log( linSideSlope * color + linSideOffset, base) + logSideOffset
1600  *
1601  * * Default values are: 1. * log( 1. * color + 0., 2.) + 0.
1602  * * The alpha channel is not affected.
1603  */
1604 class OCIOEXPORT LogAffineTransform : public Transform
1605 {
1606 public:
1607  static LogAffineTransformRcPtr Create();
1608 
1609  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_LOG_AFFINE; }
1610 
1611  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1612  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1613 
1614  /// Checks if this exactly equals other.
1615  virtual bool equals(const LogAffineTransform & other) const noexcept = 0;
1616 
1617  virtual double getBase() const noexcept = 0;
1618  virtual void setBase(double base) noexcept = 0;
1619 
1620  // !rst:: **Get/Set values for the R, G, B components**
1621 
1622  virtual void getLogSideSlopeValue(double(&values)[3]) const noexcept = 0;
1623  virtual void setLogSideSlopeValue(const double(&values)[3]) noexcept = 0;
1624  virtual void getLogSideOffsetValue(double(&values)[3]) const noexcept = 0;
1625  virtual void setLogSideOffsetValue(const double(&values)[3]) noexcept = 0;
1626  virtual void getLinSideSlopeValue(double(&values)[3]) const noexcept = 0;
1627  virtual void setLinSideSlopeValue(const double(&values)[3]) noexcept = 0;
1628  virtual void getLinSideOffsetValue(double(&values)[3]) const noexcept = 0;
1629  virtual void setLinSideOffsetValue(const double(&values)[3]) noexcept = 0;
1630 
1631  LogAffineTransform(const LogAffineTransform &) = delete;
1632  LogAffineTransform & operator= (const LogAffineTransform &) = delete;
1633  /// Do not use (needed only for pybind11).
1634  virtual ~LogAffineTransform() = default;
1635 
1636 protected:
1637  LogAffineTransform() = default;
1638 };
1639 
1640 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const LogAffineTransform &);
1641 
1642 
1643 /**
1644  * Same as LogAffineTransform but with the addition of a linear segment near black. This formula
1645  * is used for many camera logs (e.g., LogC) as well as ACEScct.
1646  *
1647  * * The linSideBreak specifies the point on the linear axis where the log and linear
1648  * segments meet. It must be set (there is no default).
1649  * * The linearSlope specifies the slope of the linear segment of the forward (linToLog)
1650  * transform. By default it is set equal to the slope of the log curve at the break point.
1651  */
1653 {
1654 public:
1655  /// LinSideBreak must be set for the transform to be valid (there is no default).
1656  static LogCameraTransformRcPtr Create(const double(&linSideBreakValues)[3]);
1657 
1658  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_LOG_CAMERA; }
1659 
1660  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1661  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1662 
1663  /// Checks if this exactly equals other.
1664  virtual bool equals(const LogCameraTransform & other) const noexcept = 0;
1665 
1666  virtual double getBase() const noexcept = 0;
1667  virtual void setBase(double base) noexcept = 0;
1668 
1669  /// Get/Set values for the R, G, B components.
1670  virtual void getLogSideSlopeValue(double(&values)[3]) const noexcept = 0;
1671  virtual void setLogSideSlopeValue(const double(&values)[3]) noexcept = 0;
1672  virtual void getLogSideOffsetValue(double(&values)[3]) const noexcept = 0;
1673  virtual void setLogSideOffsetValue(const double(&values)[3]) noexcept = 0;
1674  virtual void getLinSideSlopeValue(double(&values)[3]) const noexcept = 0;
1675  virtual void setLinSideSlopeValue(const double(&values)[3]) noexcept = 0;
1676  virtual void getLinSideOffsetValue(double(&values)[3]) const noexcept = 0;
1677  virtual void setLinSideOffsetValue(const double(&values)[3]) noexcept = 0;
1678  virtual void getLinSideBreakValue(double(&values)[3]) const noexcept = 0;
1679  virtual void setLinSideBreakValue(const double(&values)[3]) noexcept = 0;
1680 
1681  /// Return true if LinearSlope values were set, false if they were not.
1682  virtual bool getLinearSlopeValue(double(&values)[3]) const = 0;
1683  /**
1684  * \brief Set LinearSlope value.
1685  *
1686  * \note
1687  * You must call setLinSideBreakValue before calling this.
1688  */
1689  virtual void setLinearSlopeValue(const double(&values)[3]) = 0;
1690  /// Remove LinearSlope values so that default values are used.
1691  virtual void unsetLinearSlopeValue() = 0;
1692 
1693  LogCameraTransform(const LogCameraTransform &) = delete;
1694  LogCameraTransform & operator= (const LogCameraTransform &) = delete;
1695  /// Do not use (needed only for pybind11).
1696  virtual ~LogCameraTransform() = default;
1697 
1698 protected:
1699  LogCameraTransform() = default;
1700 };
1701 
1702 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const LogCameraTransform &);
1703 
1704 
1705 /**
1706  * Represents log transform: log(color, base)
1707  *
1708  * * The input will be clamped for negative numbers.
1709  * * Default base is 2.0.
1710  * * The alpha channel is not affected.
1711  */
1712 class OCIOEXPORT LogTransform : public Transform
1713 {
1714 public:
1715  static LogTransformRcPtr Create();
1716 
1717  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_LOG; }
1718 
1719  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1720  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1721 
1722  /// Checks if this exactly equals other.
1723  virtual bool equals(const LogTransform & other) const noexcept = 0;
1724 
1725  virtual double getBase() const noexcept = 0;
1726  virtual void setBase(double val) noexcept = 0;
1727 
1728  LogTransform(const LogTransform &) = delete;
1729  LogTransform & operator= (const LogTransform &) = delete;
1730  /// Do not use (needed only for pybind11).
1731  virtual ~LogTransform() = default;
1732 
1733 protected:
1734  LogTransform() = default;
1735 };
1736 
1737 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const LogTransform &);
1738 
1739 
1740 class OCIOEXPORT LookTransform : public Transform
1741 {
1742 public:
1743  static LookTransformRcPtr Create();
1744 
1745  TransformRcPtr createEditableCopy() const override;
1746 
1747  TransformDirection getDirection() const noexcept override;
1748  void setDirection(TransformDirection dir) noexcept override;
1749 
1750  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_LOOK; }
1751 
1752  /// Will throw if data is not valid.
1753  void validate() const override;
1754 
1755  const char * getSrc() const;
1756  void setSrc(const char * src);
1757 
1758  const char * getDst() const;
1759  void setDst(const char * dst);
1760 
1761  const char * getLooks() const;
1762  /**
1763  * Specify looks to apply.
1764  * Looks is a potentially comma (or colon) delimited list of look names,
1765  * Where +/- prefixes are optionally allowed to denote forward/inverse
1766  * look specification. (And forward is assumed in the absence of either)
1767  */
1768  void setLooks(const char * looks);
1769 
1770  bool getSkipColorSpaceConversion() const;
1771  void setSkipColorSpaceConversion(bool skip);
1772 
1773  /**
1774  * Return the name of the color space after applying looks in the forward
1775  * direction but without converting to the destination color space. This is equivalent
1776  * to the process space of the last look in the look sequence (and takes into account that
1777  * a look fall-back may be used).
1778  */
1779  static const char * GetLooksResultColorSpace(const ConstConfigRcPtr & config,
1780  const ConstContextRcPtr & context,
1781  const char * looks);
1782 
1783  LookTransform & operator=(const LookTransform &) = delete;
1784  /// Do not use (needed only for pybind11).
1785  virtual ~LookTransform();
1786 
1787 private:
1788  LookTransform();
1789  LookTransform(const LookTransform &);
1790 
1791  static void deleter(LookTransform * t);
1792 
1793  class Impl;
1794  Impl * m_impl;
1795  Impl * getImpl() { return m_impl; }
1796  const Impl * getImpl() const { return m_impl; }
1797 };
1798 
1799 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const LookTransform &);
1800 
1801 
1802 /// Represents a 1D-LUT transform.
1803 class OCIOEXPORT Lut1DTransform : public Transform
1804 {
1805 public:
1806  /// Create an identity 1D-LUT of length two.
1807  static Lut1DTransformRcPtr Create();
1808 
1809  /**
1810  * Create an identity 1D-LUT with specific length and
1811  * half-domain setting. Will throw for lengths longer than 1024x1024.
1812  */
1813  static Lut1DTransformRcPtr Create(unsigned long length,
1814  bool isHalfDomain);
1815 
1816  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_LUT1D; }
1817 
1818  virtual BitDepth getFileOutputBitDepth() const noexcept = 0;
1819  /**
1820  * Get the bit-depth associated with the LUT values read
1821  * from a file or set the bit-depth of values to be written to a file
1822  * (for file formats such as CLF that support multiple bit-depths).
1823  * However, note that the values stored in the object are always
1824  * normalized.
1825  */
1826  virtual void setFileOutputBitDepth(BitDepth bitDepth) noexcept = 0;
1827 
1828  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1829  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1830 
1831  /// Checks if this exactly equals other.
1832  virtual bool equals(const Lut1DTransform & other) const noexcept = 0;
1833 
1834  virtual unsigned long getLength() const = 0;
1835  /**
1836  * Changing the length will reset the LUT to identity.
1837  * Will throw for lengths longer than 1024x1024.
1838  */
1839  virtual void setLength(unsigned long length) = 0;
1840 
1841  virtual void getValue(unsigned long index, float & r, float & g, float & b) const = 0;
1842  /**
1843  * Set the values of a LUT1D. Will throw if the index
1844  * is outside of the range from 0 to (length-1).
1845  *
1846  * The LUT values are always for the "forward" LUT, regardless of how
1847  * the transform direction is set.
1848  *
1849  * These values are normalized relative to what may be stored in any
1850  * given LUT files. For example in a CLF file using a "10i" output
1851  * depth, a value of 1023 in the file is normalized to 1.0. The
1852  * values here are unclamped and may extend outside [0,1].
1853  *
1854  * LUTs in various file formats may only provide values for one
1855  * channel where R, G, B are the same. Even in that case, you should
1856  * provide three equal values to the setter.
1857  */
1858  virtual void setValue(unsigned long index, float r, float g, float b) = 0;
1859 
1860  virtual bool getInputHalfDomain() const noexcept = 0;
1861  /**
1862  * In a half-domain LUT, the contents of the LUT specify
1863  * the desired value of the function for each half-float value.
1864  * Therefore, the length of the LUT must be 65536 entries or else
1865  * validate() will throw.
1866  */
1867  virtual void setInputHalfDomain(bool isHalfDomain) noexcept = 0;
1868 
1869  virtual bool getOutputRawHalfs() const noexcept = 0;
1870  /**
1871  * Set OutputRawHalfs to true if you want to output the
1872  * LUT contents as 16-bit floating point values expressed as unsigned
1873  * 16-bit integers representing the equivalent bit pattern.
1874  * For example, the value 1.0 would be written as the integer 15360
1875  * because it has the same bit-pattern. Note that this implies the
1876  * values will be quantized to a 16-bit float. Note that this setting
1877  * only controls the output formatting (where supported) and not the
1878  * values for getValue/setValue. The only file formats that currently
1879  * support this are CLF and CTF.
1880  */
1881  virtual void setOutputRawHalfs(bool isRawHalfs) noexcept = 0;
1882 
1883  virtual Lut1DHueAdjust getHueAdjust() const noexcept = 0;
1884  /**
1885  * The 1D-LUT transform optionally supports a hue adjustment
1886  * feature that was used in some versions of ACES. This adjusts the hue
1887  * of the result to approximately match the input.
1888  */
1889  virtual void setHueAdjust(Lut1DHueAdjust algo) = 0;
1890 
1891  virtual Interpolation getInterpolation() const = 0;
1892  virtual void setInterpolation(Interpolation algo) = 0;
1893 
1894  Lut1DTransform(const Lut1DTransform &) = delete;
1895  Lut1DTransform & operator= (const Lut1DTransform &) = delete;
1896  /// Do not use (needed only for pybind11).
1897  virtual ~Lut1DTransform() = default;
1898 
1899 protected:
1900  Lut1DTransform() = default;
1901 };
1902 
1903 extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Lut1DTransform&);
1904 
1905 
1906 /// Represents a 3D-LUT transform.
1907 class OCIOEXPORT Lut3DTransform : public Transform
1908 {
1909 public:
1910  /// Create an identity 3D-LUT of size 2x2x2.
1911  static Lut3DTransformRcPtr Create();
1912 
1913  /**
1914  * Create an identity 3D-LUT with specific grid size.
1915  * Will throw for grid size larger than 129.
1916  */
1917  static Lut3DTransformRcPtr Create(unsigned long gridSize);
1918 
1919  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_LUT3D; }
1920 
1921  virtual BitDepth getFileOutputBitDepth() const noexcept = 0;
1922  /**
1923  * Get the bit-depth associated with the LUT values read
1924  * from a file or set the bit-depth of values to be written to a file
1925  * (for file formats such as CLF that support multiple bit-depths).
1926  * However, note that the values stored in the object are always
1927  * normalized.
1928  */
1929  virtual void setFileOutputBitDepth(BitDepth bitDepth) noexcept = 0;
1930 
1931  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1932  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1933 
1934  /// Checks if this exactly equals other.
1935  virtual bool equals(const Lut3DTransform & other) const noexcept = 0;
1936 
1937  virtual unsigned long getGridSize() const = 0;
1938  /**
1939  * Changing the grid size will reset the LUT to identity.
1940  * Will throw for grid sizes larger than 129.
1941  */
1942  virtual void setGridSize(unsigned long gridSize) = 0;
1943 
1944  virtual void getValue(unsigned long indexR,
1945  unsigned long indexG,
1946  unsigned long indexB,
1947  float & r, float & g, float & b) const = 0;
1948  /**
1949  * Set the values of a 3D-LUT. Will throw if an index is
1950  * outside of the range from 0 to (gridSize-1).
1951  *
1952  * The LUT values are always for the "forward" LUT, regardless of how the
1953  * transform direction is set.
1954  *
1955  * These values are normalized relative to what may be stored in any
1956  * given LUT files. For example in a CLF file using a "10i" output
1957  * depth, a value of 1023 in the file is normalized to 1.0. The values
1958  * here are unclamped and may extend outside [0,1].
1959  */
1960  virtual void setValue(unsigned long indexR,
1961  unsigned long indexG,
1962  unsigned long indexB,
1963  float r, float g, float b) = 0;
1964 
1965  virtual Interpolation getInterpolation() const = 0;
1966  virtual void setInterpolation(Interpolation algo) = 0;
1967 
1968  Lut3DTransform(const Lut3DTransform &) = delete;
1969  Lut3DTransform & operator= (const Lut3DTransform &) = delete;
1970  /// Do not use (needed only for pybind11).
1971  virtual ~Lut3DTransform() = default;
1972 
1973 protected:
1974  Lut3DTransform() = default;
1975 };
1976 
1977 extern OCIOEXPORT std::ostream& operator<< (std::ostream&, const Lut3DTransform&);
1978 
1979 /**
1980  * Represents an MX+B Matrix transform.
1981  *
1982  * \note
1983  * For singular matrices, an inverse direction will throw an exception during finalization.
1984  */
1986 {
1987 public:
1988  static MatrixTransformRcPtr Create();
1989 
1990  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_MATRIX; }
1991 
1992  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1993  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
1994 
1995  /// Checks if this exactly equals other.
1996  virtual bool equals(const MatrixTransform & other) const noexcept = 0;
1997 
1998  virtual void getMatrix(double * m44) const = 0;
1999  /**
2000  * Get or set the values of a Matrix. Expects 16 values,
2001  * where the first four are the coefficients to generate the R output
2002  * channel from R, G, B, A input channels.
2003  *
2004  * The Matrix values are always for the "forward" Matrix, regardless of
2005  * how the transform direction is set.
2006  *
2007  * These values are normalized relative to what may be stored in
2008  * file formats such as CLF. For example in a CLF file using a "32f"
2009  * input depth and "10i" output depth, a value of 1023 in the file
2010  * is normalized to 1.0. The values here are unclamped and may
2011  * extend outside [0,1].
2012  */
2013  virtual void setMatrix(const double * m44) = 0;
2014 
2015  virtual void getOffset(double * offset4) const = 0;
2016  /**
2017  * Get or set the R, G, B, A offsets to be applied
2018  * after the matrix.
2019  *
2020  * These values are normalized relative to what may be stored in
2021  * file formats such as CLF. For example, in a CLF file using a
2022  * "10i" output depth, a value of 1023 in the file is normalized
2023  * to 1.0. The values here are unclamped and may extend
2024  * outside [0,1].
2025  */
2026  virtual void setOffset(const double * offset4) = 0;
2027 
2028  /**
2029  * Get the bit-depths associated with the matrix values read from a
2030  * file or set the bit-depths of values to be written to a file
2031  * (for file formats such as CLF that support multiple bit-depths).
2032  *
2033  * In a format such as CLF, the matrix values are scaled to take
2034  * pixels at the specified inBitDepth to pixels at the specified
2035  * outBitDepth. This complicates the interpretation of the matrix
2036  * values and so this object always holds normalized values and
2037  * scaling is done on the way from or to file formats such as CLF.
2038  */
2039  virtual BitDepth getFileInputBitDepth() const noexcept = 0;
2040  virtual void setFileInputBitDepth(BitDepth bitDepth) noexcept = 0;
2041  virtual BitDepth getFileOutputBitDepth() const noexcept = 0;
2042  virtual void setFileOutputBitDepth(BitDepth bitDepth) noexcept = 0;
2043 
2044 
2045  /// **Convenience functions**
2046  ///
2047  /// Build the matrix and offset corresponding to higher-level concepts.
2048  ///
2049  /// \note
2050  /// These can throw an exception if for any component
2051  /// ``oldmin == oldmax. (divide by 0)``
2052  static void Fit(double * m44, double* offset4,
2053  const double * oldmin4, const double * oldmax4,
2054  const double * newmin4, const double * newmax4);
2055 
2056  static void Identity(double * m44, double * offset4);
2057 
2058  static void Sat(double * m44, double * offset4,
2059  double sat, const double * lumaCoef3);
2060 
2061  static void Scale(double * m44, double * offset4,
2062  const double * scale4);
2063 
2064  static void View(double * m44, double * offset4,
2065  int * channelHot4,
2066  const double * lumaCoef3);
2067 
2068  MatrixTransform(const MatrixTransform &) = delete;
2069  MatrixTransform & operator= (const MatrixTransform &) = delete;
2070  /// Do not use (needed only for pybind11).
2071  virtual ~MatrixTransform() = default;
2072 
2073 protected:
2074  MatrixTransform() = default;
2075 };
2076 
2077 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const MatrixTransform &) noexcept;
2078 
2079 
2080 /**
2081  * Represents a range transform
2082  *
2083  * The Range is used to apply an affine transform (scale & offset) and
2084  * clamps values to min/max bounds on all color components except the alpha.
2085  * The scale and offset values are computed from the input and output bounds.
2086  *
2087  * Refer to section 7.2.4 in specification S-2014-006 "A Common File Format
2088  * for Look-Up Tables" from the Academy of Motion Picture Arts and Sciences
2089  * and the American Society of Cinematographers.
2090  *
2091  * \note
2092  * The "noClamp" style described in the specification S-2014-006 becomes a
2093  * MatrixOp at the processor level.
2094  *
2095  * \note
2096  * Changing the transform direction does not modify the in/out values --
2097  * they are always specified with respect to the "forward" direction.
2098  */
2099 class OCIOEXPORT RangeTransform : public Transform
2100 {
2101 public:
2102  /// Creates an instance of RangeTransform.
2103  static RangeTransformRcPtr Create();
2104 
2105  TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_RANGE; }
2106 
2107  virtual RangeStyle getStyle() const noexcept = 0;
2108  /// Set the Range style to clamp or not input values.
2109  virtual void setStyle(RangeStyle style) noexcept = 0;
2110 
2111  virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
2112  virtual FormatMetadata & getFormatMetadata() noexcept = 0;
2113 
2114  /// Checks if this equals other.
2115  virtual bool equals(const RangeTransform & other) const noexcept = 0;
2116 
2117  /**
2118  * **File bit-depth**
2119  *
2120  * In a format such as CLF, the range values are scaled to take
2121  * pixels at the specified inBitDepth to pixels at the specified
2122  * outBitDepth. This complicates the interpretation of the range
2123  * values and so this object always holds normalized values and
2124  * scaling is done on the way from or to file formats such as CLF.
2125  */
2126 
2127  /// Get the bit-depths associated with the range values read from a file
2128  /// or set the bit-depths of values to be written to a file (for file
2129  /// formats such as CLF that support multiple bit-depths).
2130  virtual BitDepth getFileInputBitDepth() const noexcept = 0;
2131  virtual void setFileInputBitDepth(BitDepth bitDepth) noexcept = 0;
2132  virtual BitDepth getFileOutputBitDepth() const noexcept = 0;
2133  virtual void setFileOutputBitDepth(BitDepth bitDepth) noexcept = 0;
2134 
2135  /**
2136  * **Range values**
2137  *
2138  * These values are normalized relative to what may be stored in file
2139  * formats such as CLF. For example in a CLF file using a "10i" input
2140  * depth, a MaxInValue of 1023 in the file is normalized to 1.0.
2141  * Likewise, for an output depth of "12i", a MaxOutValue of 4095 in the
2142  * file is normalized to 1.0. The values here are unclamped and may
2143  * extend outside [0,1].
2144  */
2145 
2146  /// Get the minimum value for the input.
2147  virtual double getMinInValue() const noexcept = 0;
2148  /// Set the minimum value for the input.
2149  virtual void setMinInValue(double val) noexcept = 0;
2150  /// Is the minimum value for the input set?
2151  virtual bool hasMinInValue() const noexcept = 0;
2152  /// Unset the minimum value for the input
2153  virtual void unsetMinInValue() noexcept = 0;
2154 
2155  /// Set the maximum value for the input.
2156  virtual void setMaxInValue(double val) noexcept = 0;
2157  /// Get the maximum value for the input.
2158  virtual double getMaxInValue() const noexcept = 0;
2159  /// Is the maximum value for the input set?
2160  virtual bool hasMaxInValue() const noexcept = 0;
2161  /// Unset the maximum value for the input.
2162  virtual void unsetMaxInValue() noexcept = 0;
2163 
2164  /// Set the minimum value for the output.
2165  virtual void setMinOutValue(double val) noexcept = 0;
2166  /// Get the minimum value for the output.
2167  virtual double getMinOutValue() const noexcept = 0;
2168  /// Is the minimum value for the output set?
2169  virtual bool hasMinOutValue() const noexcept = 0;
2170  /// Unset the minimum value for the output.
2171  virtual void unsetMinOutValue() noexcept = 0;
2172 
2173  /// Set the maximum value for the output.
2174  virtual void setMaxOutValue(double val) noexcept = 0;
2175  /// Get the maximum value for the output.
2176  virtual double getMaxOutValue() const noexcept = 0;
2177  /// Is the maximum value for the output set?
2178  virtual bool hasMaxOutValue() const noexcept = 0;
2179  /// Unset the maximum value for the output.
2180  virtual void unsetMaxOutValue() noexcept = 0;
2181 
2182  RangeTransform(const RangeTransform &) = delete;
2183  RangeTransform & operator= (const RangeTransform &) = delete;
2184  /// Do not use (needed only for pybind11).
2185  virtual ~RangeTransform() = default;
2186 
2187 protected:
2188  RangeTransform() = default;
2189 };
2190 
2191 extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const RangeTransform &) noexcept;
2192 
2193 } // namespace OCIO_NAMESPACE
2194 
2195 #endif
OCIO_SHARED_PTR< DisplayViewTransform > DisplayViewTransformRcPtr
2D control point used by GradingBSplineCurve.
Represents exponent transform: pow( clamp(color), value ).
TransformType getTransformType() const noexceptoverride
TransformType getTransformType() const noexceptoverride
PXL_API const char * getDescription(const ColorSpace *space)
Return the description of the color space.
TransformType getTransformType() const noexceptoverride
OCIO_SHARED_PTR< LookTransform > LookTransformRcPtr
HueCurveType
Types for GradingHueCurve.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:632
RangeStyle
A RangeTransform may be set to clamp the values, or not.
void skip(T &in, int n)
Definition: ImfXdr.h:613
Algorithms for Scene Linear color spaces.
Represents a 1D-LUT transform.
OCIO_SHARED_PTR< ExponentTransform > ExponentTransformRcPtr
GradingRGBMSW(const double(&rgbmsw)[6])
GLuint start
Definition: glcorearb.h:475
GLsizei const GLfloat * value
Definition: glcorearb.h:824
class OCIOEXPORT DynamicPropertyGradingHueCurve
OCIO_SHARED_PTR< DynamicPropertyGradingTone > DynamicPropertyGradingToneRcPtr
OCIO_SHARED_PTR< GradingHueCurve > GradingHueCurveRcPtr
TransformType getTransformType() const noexceptoverride
GLboolean GLboolean g
Definition: glcorearb.h:1222
Interface used to access dynamic property double value.
OCIO_SHARED_PTR< const Transform > ConstTransformRcPtr
OCIO_SHARED_PTR< AllocationTransform > AllocationTransformRcPtr
bool isIdentity(const MatType &m)
Determine if a matrix is an identity matrix.
Definition: Mat.h:860
GradingRGBM(const double(&rgbm)[4])
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
OCIOEXPORT bool operator!=(const GradingRGBM &lhs, const GradingRGBM &rhs)
OCIO_SHARED_PTR< Lut1DTransform > Lut1DTransformRcPtr
#define OCIO_NAMESPACE
Definition: OpenColorABI.h:8
GLint y
Definition: glcorearb.h:103
OCIO_SHARED_PTR< LogCameraTransform > LogCameraTransformRcPtr
HSYTransformStyle
Types for GradingHueCurve.
DynamicPropertyType
Types for dynamic properties.
GradingRGBM(double red, double green, double blue, double master)
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glcorearb.h:2539
Interface used to access dynamic property GradingTone value.
GradingRGBMSW(double start, double width)
class OCIOEXPORT DynamicProperty
TransformType getTransformType() const noexceptoverride
GLenum const GLfloat * params
Definition: glcorearb.h:105
OCIO_SHARED_PTR< FixedFunctionTransform > FixedFunctionTransformRcPtr
OCIOEXPORT DynamicPropertyGradingPrimaryRcPtr AsGradingPrimary(DynamicPropertyRcPtr &prop)
__hostdev__ float getValue(uint32_t i) const
Definition: NanoVDB.h:5578
OCIO_SHARED_PTR< DynamicPropertyGradingRGBCurve > DynamicPropertyGradingRGBCurveRcPtr
OCIO_SHARED_PTR< ExponentWithLinearTransform > ExponentWithLinearTransformRcPtr
TransformType getTransformType() const noexceptoverride
TransformType getTransformType() const noexceptoverride
class OCIOEXPORT LookTransform
TransformType getTransformType() const noexceptoverride
TransformType getTransformType() const noexceptoverride
OCIO_SHARED_PTR< ColorSpaceTransform > ColorSpaceTransformRcPtr
OCIO_SHARED_PTR< const Context > ConstContextRcPtr
TransformType getTransformType() const noexceptoverride
Interface used to access dynamic property ConstGradingRGBCurveRcPtr value.
Algorithms for Logarithmic color spaces.
OCIO_SHARED_PTR< DynamicPropertyDouble > DynamicPropertyDoubleRcPtr
TransformType getTransformType() const noexceptoverride
OCIO_SHARED_PTR< Lut3DTransform > Lut3DTransformRcPtr
OCIOEXPORT DynamicPropertyGradingRGBCurveRcPtr AsGradingRGBCurve(DynamicPropertyRcPtr &prop)
OCIO_SHARED_PTR< ExposureContrastTransform > ExposureContrastTransformRcPtr
TransformType getTransformType() const noexceptoverride
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
OCIO_SHARED_PTR< LogTransform > LogTransformRcPtr
class OCIOEXPORT GroupTransform
TransformType getTransformType() const noexceptoverride
class OCIOEXPORT GradingBSplineCurve
TransformType getTransformType() const noexceptoverride
GLfloat green
Definition: glcorearb.h:112
TransformType getTransformType() const noexceptoverride
BSplineType
Types for GradingBSplineCurve.
#define OCIOEXPORT
Definition: OpenColorABI.h:67
class OCIOEXPORT Transform
OCIO_SHARED_PTR< GradingPrimaryTransform > GradingPrimaryTransformRcPtr
OCIO_SHARED_PTR< GradingBSplineCurve > GradingBSplineCurveRcPtr
TransformType getTransformType() const noexceptoverride
OCIO_SHARED_PTR< DynamicPropertyGradingHueCurve > DynamicPropertyGradingHueCurveRcPtr
GLuint const GLchar * name
Definition: glcorearb.h:786
class OCIOEXPORT GradingRGBCurve
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
GA_API const UT_StringHolder transform
GLint GLenum GLint x
Definition: glcorearb.h:409
OCIO_SHARED_PTR< GradingRGBCurve > GradingRGBCurveRcPtr
An implementation of the ASC Color Decision List (CDL), based on the ASC v1.2 specification.
Base class for all the transform classes.
TransformType getTransformType() const noexceptoverride
OCIO_SHARED_PTR< MatrixTransform > MatrixTransformRcPtr
GLdouble t
Definition: glad.h:2397
OCIO_SHARED_PTR< Transform > TransformRcPtr
GradingStyle
Styles for grading transforms.
TransformType getTransformType() const noexceptoverride
class OCIOEXPORT DynamicPropertyGradingPrimary
GLsizeiptr size
Definition: glcorearb.h:664
OCIO_SHARED_PTR< const Config > ConstConfigRcPtr
GLenum GLenum dst
Definition: glcorearb.h:1793
OCIO_SHARED_PTR< RangeTransform > RangeTransformRcPtr
OCIO_SHARED_PTR< GradingToneTransform > GradingToneTransformRcPtr
OCIO_SHARED_PTR< DynamicPropertyGradingPrimary > DynamicPropertyGradingPrimaryRcPtr
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
OCIOEXPORT bool operator==(const GradingRGBM &lhs, const GradingRGBM &rhs)
TransformType getTransformType() const noexceptoverride
TransformType getTransformType() const noexceptoverride
Interface used to access dynamic property GradingPrimary value.
LeafData & operator=(const LeafData &)=delete
GLuint index
Definition: glcorearb.h:786
OCIO_SHARED_PTR< BuiltinTransform > BuiltinTransformRcPtr
OCIO_SHARED_PTR< FileTransform > FileTransformRcPtr
OCIO_SHARED_PTR< const GradingHueCurve > ConstGradingHueCurveRcPtr
GLuint GLfloat * val
Definition: glcorearb.h:1608
GA_API const UT_StringHolder pivot
class OCIOEXPORT GradingHueCurve
Lut1DHueAdjust
Used by :cpp:classLut1DTransform to control optional hue restoration algorithm.
OCIO_SHARED_PTR< const GradingBSplineCurve > ConstGradingBSplineCurveRcPtr
class OCIOEXPORT AllocationTransform
OCIOEXPORT DynamicPropertyGradingHueCurveRcPtr AsGradingHueCurve(DynamicPropertyRcPtr &prop)
OCIO_SHARED_PTR< LogAffineTransform > LogAffineTransformRcPtr
GLint GLsizei width
Definition: glcorearb.h:103
OCIOEXPORT std::ostream & operator<<(std::ostream &, const ColorSpaceMenuParameters &)
FixedFunctionStyle
Enumeration of the :cpp:class:FixedFunctionTransform transform algorithms.
OCIO_SHARED_PTR< GroupTransform > GroupTransformRcPtr
Represents a 3D-LUT transform.
OCIOEXPORT DynamicPropertyDoubleRcPtr AsDouble(DynamicPropertyRcPtr &prop)
class OCIOEXPORT FileTransform
PXL_API void getLooks(UT_StringArray &looks)
Returns a list of looks (color transforms)
GLboolean r
Definition: glcorearb.h:1222
GLfloat GLfloat blue
Definition: glcorearb.h:112
GradingRGBMSW(double red, double green, double blue, double master, double start, double width)
OCIO_SHARED_PTR< CDLTransform > CDLTransformRcPtr
class OCIOEXPORT DynamicPropertyGradingTone
OCIO_SHARED_PTR< GradingRGBCurveTransform > GradingRGBCurveTransformRcPtr
A BSpline curve defined with GradingControlPoint.
TransformType getTransformType() const noexceptoverride
class OCIOEXPORT DisplayViewTransform
png_structrp int png_fixed_point red
Definition: png.h:1083
OCIO_SHARED_PTR< const GradingRGBCurve > ConstGradingRGBCurveRcPtr
OCIO_SHARED_PTR< GradingHueCurveTransform > GradingHueCurveTransformRcPtr
Interface used to access dynamic property ConstGradingHueCurveRcPtr value.
RGBCurveType
Types for GradingRGBCurve.
class OCIOEXPORT DynamicPropertyDouble
OIIO_UTIL_API std::string extension(string_view filepath, bool include_dot=true) noexcept
TransformType getTransformType() const noexceptoverride
OCIOEXPORT DynamicPropertyGradingToneRcPtr AsGradingTone(DynamicPropertyRcPtr &prop)
ExposureContrastStyle
Enumeration of the :cpp:class:ExposureContrastTransform transform algorithms.
OCIO_SHARED_PTR< DynamicProperty > DynamicPropertyRcPtr
GLenum src
Definition: glcorearb.h:1793
class OCIOEXPORT DynamicPropertyGradingRGBCurve