Skip to content

Commit 9ebb770

Browse files
doug-walkerlarochj
andauthored
Adsk Contrib - Add hue curve transform (#2177)
* Hue Curve Transform GPU (cherry picked from commit 393c0f6) Signed-off-by: Doug Walker <[email protected]> * Review Fixes P1 (cherry picked from commit 5b9ff85) Signed-off-by: Doug Walker <[email protected]> * Review Fixes P2 (cherry picked from commit d1a5d7a) Signed-off-by: Doug Walker <[email protected]> * Review Fixes P3 (cherry picked from commit 83340c5) Signed-off-by: Doug Walker <[email protected]> * Review Fixes P4 (cherry picked from commit b243d1d) Signed-off-by: Doug Walker <[email protected]> * GradingHueCurveOpData_tests (cherry picked from commit 2a96167) Signed-off-by: Doug Walker <[email protected]> * Review Fix, ChannelCrosstalk (cherry picked from commit 0bac401) Signed-off-by: Doug Walker <[email protected]> * Review Fix, missing fixed function enums in switch cases (cherry picked from commit 051bd7d) Signed-off-by: Doug Walker <[email protected]> * Review Fix, Missing comment on unused test parameters (cherry picked from commit 07aca3c) Signed-off-by: Doug Walker <[email protected]> * CI Fix, removing multi-line comment (cherry picked from commit bf78019) Signed-off-by: Doug Walker <[email protected]> * Fixes for Test 2: test_cpu (cherry picked from commit 4a5001e) Signed-off-by: Doug Walker <[email protected]> * Fix Windows CI Towards clean (cherry picked from commit d298681) Signed-off-by: Doug Walker <[email protected]> * Fix for missing slopes on periodic curves (cherry picked from commit 3f393f8) Signed-off-by: Doug Walker <[email protected]> * Remove leftover #include from debuging (cherry picked from commit e7fd3f2) Signed-off-by: Doug Walker <[email protected]> * Enable to draw the curve eval only for a specific hue curve. (#11) (cherry picked from commit d658e70) Signed-off-by: Doug Walker <[email protected]> * RGB to HSY fixed functions using CPU (#17) (cherry picked from commit a25c1c7) Signed-off-by: Doug Walker <[email protected]> * Fix identity hue curve draw only (#20) (cherry picked from commit 4f276e5) Signed-off-by: Doug Walker <[email protected]> * <<Operator upgrade for list of floats (#23) (cherry picked from commit 7e6378f) Signed-off-by: Doug Walker <[email protected]> * Fix unit tests Signed-off-by: Doug Walker <[email protected]> (cherry picked from commit a9e51c8) Signed-off-by: Doug Walker <[email protected]> * Fix hue curve unit tests Signed-off-by: Doug Walker <[email protected]> (cherry picked from commit 6c233c8) Signed-off-by: Doug Walker <[email protected]> * Comment out OSL tests Signed-off-by: Doug Walker <[email protected]> (cherry picked from commit cf7744e) Signed-off-by: Doug Walker <[email protected]> * Finish the implementation Signed-off-by: Doug Walker <[email protected]> * Improve interface, add tests Signed-off-by: Doug Walker <[email protected]> * Minor clean-up Signed-off-by: Doug Walker <[email protected]> * Op<< should contain slopes Signed-off-by: Doug Walker <[email protected]> * Fix python doc line Signed-off-by: Doug Walker <[email protected]> * Improve validation of control points Signed-off-by: Doug Walker <[email protected]> * Update API calls based on Vulkan PR Signed-off-by: Doug Walker <[email protected]> * Saturation robustness Signed-off-by: Doug Walker <[email protected]> * HSY transform setter adjustment Signed-off-by: Doug Walker <[email protected]> --------- Signed-off-by: Doug Walker <[email protected]> Co-authored-by: Jonathan Laroche <[email protected]> Co-authored-by: larochj <[email protected]>
1 parent f30f2c8 commit 9ebb770

File tree

97 files changed

+8830
-489
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+8830
-489
lines changed

include/OpenColorIO/OpenColorTransforms.h

Lines changed: 191 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,15 @@ class OCIOEXPORT GradingBSplineCurve
513513
public:
514514
/// Create a BSpline curve with a specified number of control points.
515515
static GradingBSplineCurveRcPtr Create(size_t size);
516+
static GradingBSplineCurveRcPtr Create(size_t size, BSplineType splineType);
517+
static GradingBSplineCurveRcPtr Create(size_t size, HueCurveType curveType);
516518
/// Create a BSpline curve with a list of control points.
517519
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);
518522

519523
virtual GradingBSplineCurveRcPtr createEditableCopy() const = 0;
524+
/// Get the number of ControlPoint objects (and the number of slopes).
520525
virtual size_t getNumControlPoints() const noexcept = 0;
521526
virtual void setNumControlPoints(size_t size) = 0;
522527
virtual const GradingControlPoint & getControlPoint(size_t index) const = 0;
@@ -525,6 +530,8 @@ class OCIOEXPORT GradingBSplineCurve
525530
virtual void setSlope(size_t index, float slope) = 0;
526531
virtual bool slopesAreDefault() const = 0;
527532
virtual void validate() const = 0;
533+
virtual BSplineType getSplineType() const = 0;
534+
virtual void setSplineType(BSplineType splineType) = 0;
528535

529536
GradingBSplineCurve(const GradingBSplineCurve &) = delete;
530537
GradingBSplineCurve & operator= (const GradingBSplineCurve &) = delete;
@@ -547,6 +554,8 @@ extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingBSpline
547554
class OCIOEXPORT GradingRGBCurve
548555
{
549556
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.)
550559
static GradingRGBCurveRcPtr Create(GradingStyle style);
551560
static GradingRGBCurveRcPtr Create(const ConstGradingRGBCurveRcPtr & rhs);
552561
static GradingRGBCurveRcPtr Create(const ConstGradingBSplineCurveRcPtr & red,
@@ -571,6 +580,58 @@ extern OCIOEXPORT bool operator==(const GradingRGBCurve & lhs, const GradingRGBC
571580
extern OCIOEXPORT bool operator!=(const GradingRGBCurve & lhs, const GradingRGBCurve & rhs);
572581
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingRGBCurve &);
573582

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+
*/
587+
class OCIOEXPORT GradingHueCurve
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(
595+
ConstGradingBSplineCurveRcPtr hueHue,
596+
ConstGradingBSplineCurveRcPtr hueSat,
597+
ConstGradingBSplineCurveRcPtr hueLum,
598+
ConstGradingBSplineCurveRcPtr lumSat,
599+
ConstGradingBSplineCurveRcPtr satSat,
600+
ConstGradingBSplineCurveRcPtr lumLum,
601+
ConstGradingBSplineCurveRcPtr satLum,
602+
ConstGradingBSplineCurveRcPtr hueFx);
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+
574635
/**
575636
* Used by the grading tone transforms to hold the red, green, blue, master, start,
576637
* and width components of a single parameter. The master component affects all three channels
@@ -734,6 +795,11 @@ extern OCIOEXPORT DynamicPropertyGradingPrimaryRcPtr AsGradingPrimary(DynamicPro
734795
* value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_RGBCURVE.
735796
*/
736797
extern OCIOEXPORT DynamicPropertyGradingRGBCurveRcPtr AsGradingRGBCurve(DynamicPropertyRcPtr & prop);
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+
*/
802+
extern OCIOEXPORT DynamicPropertyGradingHueCurveRcPtr AsGradingHueCurve(DynamicPropertyRcPtr & prop);
737803
/**
738804
* Get the property as DynamicPropertyGradingToneRcPtr to access the GradingTone value. Will throw
739805
* if property type is not DYNAMIC_PROPERTY_GRADING_TONE.
@@ -791,6 +857,23 @@ class OCIOEXPORT DynamicPropertyGradingRGBCurve
791857
DynamicPropertyGradingRGBCurve() = default;
792858
};
793859

860+
/// Interface used to access dynamic property ConstGradingHueCurveRcPtr value.
861+
class OCIOEXPORT DynamicPropertyGradingHueCurve
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+
868+
DynamicPropertyGradingHueCurve(const DynamicPropertyGradingHueCurve &) = delete;
869+
DynamicPropertyGradingHueCurve & operator=(const DynamicPropertyGradingHueCurve &) = delete;
870+
/// Do not use (needed only for pybind11).
871+
virtual ~DynamicPropertyGradingHueCurve() = default;
872+
873+
protected:
874+
DynamicPropertyGradingHueCurve() = default;
875+
};
876+
794877
/// Interface used to access dynamic property GradingTone value.
795878
class OCIOEXPORT DynamicPropertyGradingTone
796879
{
@@ -1196,13 +1279,120 @@ class OCIOEXPORT GradingPrimaryTransform : public Transform
11961279

11971280
extern OCIOEXPORT std::ostream & operator<<(std::ostream &, const GradingPrimaryTransform &) noexcept;
11981281

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+
*/
1325+
class OCIOEXPORT GradingHueCurveTransform : public Transform
1326+
{
1327+
public:
1328+
/// Creates an instance of GradingHueCurveTransform.
1329+
static GradingHueCurveTransformRcPtr Create(GradingStyle style);
1330+
1331+
TransformType getTransformType() const noexcept override { return TRANSFORM_TYPE_GRADING_HUE_CURVE; }
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+
1378+
GradingHueCurveTransform(const GradingHueCurveTransform &) = delete;
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;
11991389

12001390
/**
12011391
* RGB curve color correction controls.
12021392
*
12031393
* This transform allows for modifying tone reproduction via B-spline curves.
12041394
*
1205-
* There is an R, G, and B curve along with a Master curve (that applies to R, G, and B). Each
1395+
* There is an R, G, and B curve followed by a Master curve (that applies to R, G, and B). Each
12061396
* curve is specified via the x and y coordinates of its control points. A monotonic spline is
12071397
* fit to the control points. The x coordinates must be non-decreasing. When the grading style
12081398
* is linear, the units for the control points are photographic stops relative to 0.18.

include/OpenColorIO/OpenColorTypes.h

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ class OCIOEXPORT GradingRGBCurve;
114114
typedef OCIO_SHARED_PTR<const GradingRGBCurve> ConstGradingRGBCurveRcPtr;
115115
typedef OCIO_SHARED_PTR<GradingRGBCurve> GradingRGBCurveRcPtr;
116116

117+
class OCIOEXPORT GradingHueCurve;
118+
typedef OCIO_SHARED_PTR<const GradingHueCurve> ConstGradingHueCurveRcPtr;
119+
typedef OCIO_SHARED_PTR<GradingHueCurve> GradingHueCurveRcPtr;
120+
117121
class OCIOEXPORT ConfigIOProxy;
118122
typedef OCIO_SHARED_PTR<const ConfigIOProxy> ConstConfigIOProxyRcPtr;
119123
typedef OCIO_SHARED_PTR<ConfigIOProxy> ConfigIOProxyRcPtr;
@@ -163,6 +167,10 @@ class OCIOEXPORT DynamicPropertyGradingRGBCurve;
163167
typedef OCIO_SHARED_PTR<const DynamicPropertyGradingRGBCurve> ConstDynamicPropertyGradingRGBCurveRcPtr;
164168
typedef OCIO_SHARED_PTR<DynamicPropertyGradingRGBCurve> DynamicPropertyGradingRGBCurveRcPtr;
165169

170+
class OCIOEXPORT DynamicPropertyGradingHueCurve;
171+
typedef OCIO_SHARED_PTR<const DynamicPropertyGradingHueCurve> ConstDynamicPropertyGradingHueCurveRcPtr;
172+
typedef OCIO_SHARED_PTR<DynamicPropertyGradingHueCurve> DynamicPropertyGradingHueCurveRcPtr;
173+
166174
class OCIOEXPORT DynamicPropertyGradingTone;
167175
typedef OCIO_SHARED_PTR<const DynamicPropertyGradingTone> ConstDynamicPropertyGradingToneRcPtr;
168176
typedef OCIO_SHARED_PTR<DynamicPropertyGradingTone> DynamicPropertyGradingToneRcPtr;
@@ -191,6 +199,10 @@ class OCIOEXPORT GradingPrimaryTransform;
191199
typedef OCIO_SHARED_PTR<const GradingPrimaryTransform> ConstGradingPrimaryTransformRcPtr;
192200
typedef OCIO_SHARED_PTR<GradingPrimaryTransform> GradingPrimaryTransformRcPtr;
193201

202+
class OCIOEXPORT GradingHueCurveTransform;
203+
typedef OCIO_SHARED_PTR<const GradingHueCurveTransform> ConstGradingHueCurveTransformRcPtr;
204+
typedef OCIO_SHARED_PTR<GradingHueCurveTransform> GradingHueCurveTransformRcPtr;
205+
194206
class OCIOEXPORT GradingRGBCurveTransform;
195207
typedef OCIO_SHARED_PTR<const GradingRGBCurveTransform> ConstGradingRGBCurveTransformRcPtr;
196208
typedef OCIO_SHARED_PTR<GradingRGBCurveTransform> GradingRGBCurveTransformRcPtr;
@@ -351,6 +363,7 @@ enum TransformType
351363
TRANSFORM_TYPE_EXPOSURE_CONTRAST,
352364
TRANSFORM_TYPE_FILE,
353365
TRANSFORM_TYPE_FIXED_FUNCTION,
366+
TRANSFORM_TYPE_GRADING_HUE_CURVE,
354367
TRANSFORM_TYPE_GRADING_PRIMARY,
355368
TRANSFORM_TYPE_GRADING_RGB_CURVE,
356369
TRANSFORM_TYPE_GRADING_TONE,
@@ -497,7 +510,10 @@ enum FixedFunctionStyle
497510
FIXED_FUNCTION_ACES_OUTPUT_TRANSFORM_20, ///< ACES 2.0 Display Rendering -- EXPERIMENTAL
498511
FIXED_FUNCTION_ACES_RGB_TO_JMH_20, ///< ACES 2.0 RGB to JMh -- EXPERIMENTAL
499512
FIXED_FUNCTION_ACES_TONESCALE_COMPRESS_20, ///< ACES 2.0 Tonescale and chroma compression -- EXPERIMENTAL
500-
FIXED_FUNCTION_ACES_GAMUT_COMPRESS_20 ///< ACES 2.0 Gamut compression -- EXPERIMENTAL
513+
FIXED_FUNCTION_ACES_GAMUT_COMPRESS_20, ///< ACES 2.0 Gamut compression -- EXPERIMENTAL
514+
FIXED_FUNCTION_RGB_TO_HSY_LIN, ///< RGB to HSY (Hue, Saturation, Luminance) for linear spaces
515+
FIXED_FUNCTION_RGB_TO_HSY_LOG, ///< RGB to HSY (Hue, Saturation, Luma) for log spaces
516+
FIXED_FUNCTION_RGB_TO_HSY_VID, ///< RGB to HSY (Hue, Saturation, Luma) for video spaces
501517
};
502518

503519
/// Enumeration of the :cpp:class:`ExposureContrastTransform` transform algorithms.
@@ -550,7 +566,8 @@ enum DynamicPropertyType
550566
DYNAMIC_PROPERTY_GAMMA, ///< Image gamma value (double floating point value)
551567
DYNAMIC_PROPERTY_GRADING_PRIMARY, ///< Used by GradingPrimaryTransform
552568
DYNAMIC_PROPERTY_GRADING_RGBCURVE, ///< Used by GradingRGBCurveTransform
553-
DYNAMIC_PROPERTY_GRADING_TONE ///< Used by GradingToneTransform
569+
DYNAMIC_PROPERTY_GRADING_TONE, ///< Used by GradingToneTransform
570+
DYNAMIC_PROPERTY_GRADING_HUECURVE ///< Used by GradingHueCurveTransform
554571
};
555572

556573
/// Types for GradingRGBCurve.
@@ -563,6 +580,38 @@ enum RGBCurveType
563580
RGB_NUM_CURVES
564581
};
565582

583+
/// Types for GradingHueCurve.
584+
enum HueCurveType
585+
{
586+
HUE_HUE = 0, //!< Map input hue to output hue (where a diagonal line is the identity).
587+
HUE_SAT, //!< Adjust saturation as a function of hue (a value of 1.0 is the identity).
588+
HUE_LUM, //!< Adjust luma as a function of hue (a value of 1.0 is the identity).
589+
LUM_SAT, //!< Adjust saturation as a function of luma (a value of 1.0 is the identity).
590+
SAT_SAT, //!< Adjust saturation as a function of saturation (a diagonal is the identity).
591+
LUM_LUM, //!< Adjust luma as a function of luma, maintaining hue & sat (diagonal is identity).
592+
SAT_LUM, //!< Adjust luma as a function of saturation (a value of 1.0 is the identity).
593+
HUE_FX, //!< Map input hue to delta output hue (a value of 0.0 is the identity).
594+
HUE_NUM_CURVES
595+
};
596+
597+
/// Types for GradingHueCurve.
598+
enum HSYTransformStyle
599+
{
600+
HSY_TRANSFORM_NONE = 0, //!< No RGB to HSY conversion (use an outboard conversion).
601+
HSY_TRANSFORM_1 //!< Default RGB to Hue, Saturation, Luma conversion.
602+
};
603+
604+
/// Types for GradingBSplineCurve.
605+
enum BSplineType
606+
{
607+
B_SPLINE = 0, //!< Monotonic quadratic B-spline used for the RGBM curves.
608+
DIAGONAL_B_SPLINE, //!< Monotonic quadratic B-spline for the sat-sat and lum-lum curves.
609+
HUE_HUE_B_SPLINE, //!< Monotonic and periodic B-spline used for the hue-hue curve.
610+
PERIODIC_1_B_SPLINE, //!< Periodic, horizontal (at 1) B-spline for hue-sat and hue-lum curves.
611+
PERIODIC_0_B_SPLINE, //!< Periodic, horizontal (at 0) B-spline used for the hue-fx curve.
612+
HORIZONTAL1_B_SPLINE, //!< Horizontal (at 1) B-spline used for the lum-sat and sat-lum curves.
613+
};
614+
566615
/// Types for uniform data.
567616
enum UniformDataType
568617
{

src/OpenColorIO/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ set(SOURCES
9494
ops/gamma/GammaOpGPU.cpp
9595
ops/gamma/GammaOpUtils.cpp
9696
ops/gamma/GammaOp.cpp
97+
ops/gradinghuecurve/GradingHueCurve.cpp
98+
ops/gradinghuecurve/GradingHueCurveOpCPU.cpp
99+
ops/gradinghuecurve/GradingHueCurveOpData.cpp
100+
ops/gradinghuecurve/GradingHueCurveOpGPU.cpp
101+
ops/gradinghuecurve/GradingHueCurveOp.cpp
97102
ops/gradingprimary/GradingPrimary.cpp
98103
ops/gradingprimary/GradingPrimaryOpCPU.cpp
99104
ops/gradingprimary/GradingPrimaryOpData.cpp
@@ -169,6 +174,7 @@ set(SOURCES
169174
transforms/ExposureContrastTransform.cpp
170175
transforms/FileTransform.cpp
171176
transforms/FixedFunctionTransform.cpp
177+
transforms/GradingHueCurveTransform.cpp
172178
transforms/GradingPrimaryTransform.cpp
173179
transforms/GradingRGBCurveTransform.cpp
174180
transforms/GradingToneTransform.cpp

0 commit comments

Comments
 (0)