5 #ifndef INCLUDED_OCIO_OPENCOLORTRANSFORMS_H
6 #define INCLUDED_OCIO_OPENCOLORTRANSFORMS_H
8 #include <initializer_list>
13 #ifndef OCIO_NAMESPACE
14 #error This header cannot be used directly. Use <OpenColorIO/OpenColorIO.h> instead.
47 virtual const char * getElementName()
const noexcept = 0;
49 virtual void setElementName(
const char *) = 0;
51 virtual const char * getElementValue()
const noexcept = 0;
52 virtual void setElementValue(
const char *) = 0;
54 virtual int getNumAttributes()
const noexcept = 0;
56 virtual const char * getAttributeName(
int i)
const noexcept = 0;
58 virtual const char * getAttributeValue(
int i)
const noexcept = 0;
60 virtual const char * getAttributeValue(
const char *
name)
const noexcept = 0;
65 virtual void addAttribute(
const char * name,
const char *
value) = 0;
67 virtual int getNumChildrenElements()
const noexcept = 0;
87 virtual void addChildElement(
const char * name,
const char * value) = 0;
90 virtual void clear() noexcept = 0;
99 virtual const char *
getName()
const noexcept = 0;
100 virtual void setName(
const char * name) noexcept = 0;
106 virtual const char * getID()
const noexcept = 0;
107 virtual void setID(
const char *
id) noexcept = 0;
133 virtual void validate()
const;
165 void validate()
const override;
170 int getNumVars()
const;
171 void getVars(
float * vars)
const;
172 void setVars(
int numvars,
const float * vars);
186 Impl * getImpl() {
return m_impl; }
187 const Impl * getImpl()
const {
return m_impl; }
205 virtual const char * getStyle()
const noexcept = 0;
211 virtual
void setStyle(
const char * style) = 0;
284 virtual
void setStyle(
CDLStyle style) = 0;
286 virtual
void getSlope(
double * rgb) const = 0;
287 virtual
void setSlope(const
double * rgb) = 0;
289 virtual
void getOffset(
double * rgb) const = 0;
290 virtual
void setOffset(const
double * rgb) = 0;
292 virtual
void getPower(
double * rgb) const = 0;
293 virtual
void setPower(const
double * rgb) = 0;
295 virtual
void getSOP(
double * vec9) const = 0;
296 virtual
void setSOP(const
double * vec9) = 0;
298 virtual
double getSat() const = 0;
299 virtual
void setSat(
double sat) = 0;
302 virtual
void getSatLumaCoefs(
double * rgb) const = 0;
308 virtual const
char * getID() const = 0;
309 virtual
void setID(const
char *
id) = 0;
318 virtual const
char * getFirstSOPDescription() const = 0;
319 virtual
void setFirstSOPDescription(const
char * description) = 0;
345 void validate()
const override;
347 const char * getSrc()
const;
348 void setSrc(
const char * src);
350 const char * getDst()
const;
351 void setDst(
const char *
dst);
354 bool getDataBypass() const noexcept;
355 void setDataBypass(
bool enabled) noexcept;
362 ColorSpaceTransform();
363 ColorSpaceTransform(const ColorSpaceTransform &);
365 static
void deleter(ColorSpaceTransform *
t);
369 Impl * getImpl() {
return m_impl; }
370 const Impl * getImpl()
const {
return m_impl; }
389 void validate()
const override;
391 const char * getSrc()
const;
393 void setSrc(
const char *
name);
395 const char * getDisplay()
const;
397 void setDisplay(
const char * display);
399 const char * getView()
const;
401 void setView(
const char *
view);
403 bool getLooksBypass()
const;
405 void setLooksBypass(
bool bypass);
407 bool getDataBypass()
const noexcept;
409 void setDataBypass(
bool bypass) noexcept;
415 DisplayViewTransform();
416 DisplayViewTransform(
const DisplayViewTransform &) = delete;
417 DisplayViewTransform & operator=(
const DisplayViewTransform &) = delete;
419 static
void deleter(DisplayViewTransform *
t);
423 Impl * getImpl() {
return m_impl; }
424 const Impl * getImpl()
const {
return m_impl; }
451 double m_green{ 0. };
453 double m_master{ 0. };
464 , m_clampBlack(NoClampBlack())
465 , m_clampWhite(NoClampWhite())
477 double m_saturation{ 1.0 };
479 double m_pivotBlack{ 0.0 };
480 double m_pivotWhite{ 1.0 };
487 static double NoClampBlack();
488 static double NoClampWhite();
514 virtual size_t getNumControlPoints()
const noexcept = 0;
515 virtual void setNumControlPoints(
size_t size) = 0;
518 virtual float getSlope(
size_t index)
const = 0;
519 virtual void setSlope(
size_t index,
float slope) = 0;
520 virtual bool slopesAreDefault()
const = 0;
521 virtual void validate()
const = 0;
550 virtual void validate()
const = 0;
585 , m_green (rgbmsw[1])
587 , m_master(rgbmsw[3])
588 , m_start (rgbmsw[4])
589 , m_width (rgbmsw[5])
598 double m_green { 1. };
599 double m_blue { 1. };
600 double m_master{ 1. };
601 double m_start { 0. };
602 double m_width { 1. };
634 void validate()
const;
641 double m_scontrast{ 1.0 };
706 namespace DynamicPropertyValue
734 virtual double getValue()
const = 0;
735 virtual void setValue(
double value) = 0;
818 virtual
void getValue(
double(&vec4)[4])
const noexcept = 0;
819 virtual
void setValue(
const double(&vec4)[4]) noexcept = 0;
862 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
868 virtual
void getGamma(
double(&
values)[4]) const noexcept = 0;
876 virtual
void setGamma(const
double(&
values)[4]) noexcept = 0;
878 virtual
void getOffset(
double(&
values)[4]) const noexcept = 0;
885 virtual
void setOffset(const
double(&
values)[4]) noexcept = 0;
920 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
930 virtual
double getExposure() const = 0;
935 virtual
void setExposure(
double exposure) = 0;
940 virtual
bool isExposureDynamic() const = 0;
941 virtual
void makeExposureDynamic() = 0;
942 virtual
void makeExposureNonDynamic() = 0;
944 virtual
double getContrast() const = 0;
951 virtual
void setContrast(
double contrast) = 0;
956 virtual
bool isContrastDynamic() const = 0;
957 virtual
void makeContrastDynamic() = 0;
958 virtual
void makeContrastNonDynamic() = 0;
960 virtual
double getGamma() const = 0;
961 virtual
void setGamma(
double gamma) = 0;
966 virtual
bool isGammaDynamic() const = 0;
967 virtual
void makeGammaDynamic() = 0;
968 virtual
void makeGammaNonDynamic() = 0;
970 virtual
double getPivot() const = 0;
977 virtual
void setPivot(
double pivot) = 0;
979 virtual
double getLogExposureStep() const = 0;
986 virtual
void setLogExposureStep(
double logExposureStep) = 0;
988 virtual
double getLogMidGray() const = 0;
995 virtual
void setLogMidGray(
double logMidGray) = 0;
1008 extern
OCIOEXPORT std::ostream & operator<<(std::ostream &,
1025 void validate()
const override;
1027 const char * getSrc()
const;
1028 void setSrc(
const char * src);
1034 const char * getCCCId()
const;
1035 void setCCCId(
const char *
id);
1054 static int GetNumFormats();
1056 static const char * GetFormatNameByIndex(
int index);
1058 static const char * GetFormatExtensionByIndex(
int index);
1072 Impl * getImpl() {
return m_impl; }
1073 const Impl * getImpl()
const {
return m_impl; }
1093 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1103 virtual
size_t getNumParams() const = 0;
1104 virtual
void getParams(
double * params) const = 0;
1106 virtual
void setParams(const
double * params,
size_t num) = 0;
1144 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1153 virtual
void setStyle(
GradingStyle style) noexcept = 0;
1163 virtual
bool isDynamic() const noexcept = 0;
1164 virtual
void makeDynamic() noexcept = 0;
1165 virtual
void makeNonDynamic() noexcept = 0;
1200 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1209 virtual
void setStyle(
GradingStyle style) noexcept = 0;
1225 virtual
bool slopesAreDefault(
RGBCurveType c) const = 0;
1232 virtual
bool getBypassLinToLog() const = 0;
1233 virtual
void setBypassLinToLog(
bool bypass) = 0;
1239 virtual
bool isDynamic() const noexcept = 0;
1240 virtual
void makeDynamic() noexcept = 0;
1241 virtual
void makeNonDynamic() noexcept = 0;
1286 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1294 virtual
void setStyle(
GradingStyle style) noexcept = 0;
1297 virtual
void setValue(const
GradingTone & values) = 0;
1303 virtual
bool isDynamic() const noexcept = 0;
1304 virtual
void makeDynamic() noexcept = 0;
1305 virtual
void makeNonDynamic() noexcept = 0;
1324 virtual const FormatMetadata & getFormatMetadata()
const noexcept = 0;
1334 virtual int getNumTransforms()
const noexcept = 0;
1338 virtual void prependTransform(
TransformRcPtr transform) noexcept = 0;
1361 const char * formatName,
1362 std::ostream & os)
const = 0;
1365 static int GetNumWriteFormats() noexcept;
1368 static const char * GetFormatNameByIndex(
int index) noexcept;
1369 static const char * GetFormatExtensionByIndex(
int index) noexcept;
1400 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1406 virtual
double getBase() const noexcept = 0;
1407 virtual
void setBase(
double base) noexcept = 0;
1411 virtual
void getLogSideSlopeValue(
double(&values)[3]) const noexcept = 0;
1412 virtual
void setLogSideSlopeValue(const
double(&values)[3]) noexcept = 0;
1413 virtual
void getLogSideOffsetValue(
double(&values)[3]) const noexcept = 0;
1414 virtual
void setLogSideOffsetValue(const
double(&values)[3]) noexcept = 0;
1415 virtual
void getLinSideSlopeValue(
double(&values)[3]) const noexcept = 0;
1416 virtual
void setLinSideSlopeValue(const
double(&values)[3]) noexcept = 0;
1417 virtual
void getLinSideOffsetValue(
double(&values)[3]) const noexcept = 0;
1418 virtual
void setLinSideOffsetValue(const
double(&values)[3]) noexcept = 0;
1449 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1455 virtual
double getBase() const noexcept = 0;
1456 virtual
void setBase(
double base) noexcept = 0;
1459 virtual
void getLogSideSlopeValue(
double(&values)[3]) const noexcept = 0;
1460 virtual
void setLogSideSlopeValue(const
double(&values)[3]) noexcept = 0;
1461 virtual
void getLogSideOffsetValue(
double(&values)[3]) const noexcept = 0;
1462 virtual
void setLogSideOffsetValue(const
double(&values)[3]) noexcept = 0;
1463 virtual
void getLinSideSlopeValue(
double(&values)[3]) const noexcept = 0;
1464 virtual
void setLinSideSlopeValue(const
double(&values)[3]) noexcept = 0;
1465 virtual
void getLinSideOffsetValue(
double(&values)[3]) const noexcept = 0;
1466 virtual
void setLinSideOffsetValue(const
double(&values)[3]) noexcept = 0;
1467 virtual
void getLinSideBreakValue(
double(&values)[3]) const noexcept = 0;
1468 virtual
void setLinSideBreakValue(const
double(&values)[3]) noexcept = 0;
1471 virtual
bool getLinearSlopeValue(
double(&values)[3]) const = 0;
1478 virtual
void setLinearSlopeValue(const
double(&values)[3]) = 0;
1480 virtual
void unsetLinearSlopeValue() = 0;
1508 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1512 virtual
bool equals(const
LogTransform & other) const noexcept = 0;
1514 virtual
double getBase() const noexcept = 0;
1515 virtual
void setBase(
double val) noexcept = 0;
1542 void validate()
const override;
1544 const char * getSrc()
const;
1545 void setSrc(
const char * src);
1547 const char * getDst()
const;
1548 void setDst(
const char *
dst);
1557 void setLooks(
const char * looks);
1559 bool getSkipColorSpaceConversion()
const;
1560 void setSkipColorSpaceConversion(
bool skip);
1568 static const char * GetLooksResultColorSpace(
const ConstConfigRcPtr & config,
1570 const char * looks);
1584 Impl * getImpl() {
return m_impl; }
1585 const Impl * getImpl()
const {
return m_impl; }
1607 virtual BitDepth getFileOutputBitDepth() const noexcept = 0;
1615 virtual
void setFileOutputBitDepth(
BitDepth bitDepth) noexcept = 0;
1617 virtual const
FormatMetadata & getFormatMetadata() const noexcept = 0;
1621 virtual
bool equals(const
Lut1DTransform & other) const noexcept = 0;
1623 virtual
unsigned long getLength() const = 0;
1628 virtual
void setLength(
unsigned long length) = 0;
1630 virtual
void getValue(
unsigned long index,
float &
r,
float &
g,
float &
b) const = 0;
1647 virtual
void setValue(
unsigned long index,
float r,
float g,
float b) = 0;
1649 virtual
bool getInputHalfDomain() const noexcept = 0;
1656 virtual
void setInputHalfDomain(
bool isHalfDomain) noexcept = 0;
1658 virtual
bool getOutputRawHalfs() const noexcept = 0;
1670 virtual
void setOutputRawHalfs(
bool isRawHalfs) noexcept = 0;
1710 virtual BitDepth getFileOutputBitDepth() const noexcept = 0;
1718 virtual
void setFileOutputBitDepth(
BitDepth bitDepth) noexcept = 0;
1720 virtual const
FormatMetadata & getFormatMetadata() const noexcept = 0;
1724 virtual
bool equals(const
Lut3DTransform & other) const noexcept = 0;
1726 virtual
unsigned long getGridSize() const = 0;
1731 virtual
void setGridSize(
unsigned long gridSize) = 0;
1733 virtual
void getValue(
unsigned long indexR,
1734 unsigned long indexG,
1735 unsigned long indexB,
1736 float & r,
float & g,
float & b) const = 0;
1749 virtual
void setValue(
unsigned long indexR,
1750 unsigned long indexG,
1751 unsigned long indexB,
1752 float r,
float g,
float b) = 0;
1781 virtual const FormatMetadata & getFormatMetadata() const noexcept = 0;
1785 virtual
bool equals(const
MatrixTransform & other) const noexcept = 0;
1787 virtual
void getMatrix(
double * m44) const = 0;
1802 virtual
void setMatrix(const
double * m44) = 0;
1804 virtual
void getOffset(
double * offset4) const = 0;
1815 virtual
void setOffset(const
double * offset4) = 0;
1828 virtual
BitDepth getFileInputBitDepth() const noexcept = 0;
1829 virtual
void setFileInputBitDepth(
BitDepth bitDepth) noexcept = 0;
1830 virtual
BitDepth getFileOutputBitDepth() const noexcept = 0;
1831 virtual
void setFileOutputBitDepth(
BitDepth bitDepth) noexcept = 0;
1841 static
void Fit(
double * m44,
double* offset4,
1842 const
double * oldmin4, const
double * oldmax4,
1843 const
double * newmin4, const
double * newmax4);
1845 static
void Identity(
double * m44,
double * offset4);
1847 static
void Sat(
double * m44,
double * offset4,
1848 double sat, const
double * lumaCoef3);
1850 static
void Scale(
double * m44,
double * offset4,
1851 const
double * scale4);
1853 static
void View(
double * m44,
double * offset4,
1855 const
double * lumaCoef3);
1896 virtual RangeStyle getStyle() const noexcept = 0;
1898 virtual
void setStyle(
RangeStyle style) noexcept = 0;
1900 virtual const
FormatMetadata & getFormatMetadata() const noexcept = 0;
1904 virtual
bool equals(const
RangeTransform & other) const noexcept = 0;
1919 virtual
BitDepth getFileInputBitDepth() const noexcept = 0;
1920 virtual
void setFileInputBitDepth(
BitDepth bitDepth) noexcept = 0;
1921 virtual
BitDepth getFileOutputBitDepth() const noexcept = 0;
1922 virtual
void setFileOutputBitDepth(
BitDepth bitDepth) noexcept = 0;
1936 virtual
double getMinInValue() const noexcept = 0;
1938 virtual
void setMinInValue(
double val) noexcept = 0;
1940 virtual
bool hasMinInValue() const noexcept = 0;
1942 virtual
void unsetMinInValue() noexcept = 0;
1945 virtual
void setMaxInValue(
double val) noexcept = 0;
1947 virtual
double getMaxInValue() const noexcept = 0;
1949 virtual
bool hasMaxInValue() const noexcept = 0;
1951 virtual
void unsetMaxInValue() noexcept = 0;
1954 virtual
void setMinOutValue(
double val) noexcept = 0;
1956 virtual
double getMinOutValue() const noexcept = 0;
1958 virtual
bool hasMinOutValue() const noexcept = 0;
1960 virtual
void unsetMinOutValue() noexcept = 0;
1963 virtual
void setMaxOutValue(
double val) noexcept = 0;
1965 virtual
double getMaxOutValue() const noexcept = 0;
1967 virtual
bool hasMaxOutValue() const noexcept = 0;
1969 virtual
void unsetMaxOutValue() noexcept = 0;
OCIO_SHARED_PTR< DisplayViewTransform > DisplayViewTransformRcPtr
2D control point used by GradingBSplineCurve.
PXL_API const char * getDescription(const ColorSpace *space)
Return the description of the color space.
OCIO_SHARED_PTR< LookTransform > LookTransformRcPtr
GradingControlPoint(float x, float y)
*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
RangeStyle
A RangeTransform may be set to clamp the values, or not.
Algorithms for Scene Linear color spaces.
OCIO_SHARED_PTR< ExponentTransform > ExponentTransformRcPtr
GradingRGBMSW(const double(&rgbmsw)[6])
OCIO_SHARED_PTR< DynamicPropertyGradingTone > DynamicPropertyGradingToneRcPtr
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.
GradingRGBM(const double(&rgbm)[4])
GLuint GLsizei GLsizei * length
OCIO_SHARED_PTR< Lut1DTransform > Lut1DTransformRcPtr
OCIO_SHARED_PTR< LogCameraTransform > LogCameraTransformRcPtr
GradingRGBMSW m_highlights
DynamicPropertyType
Types for dynamic properties.
GradingRGBM(double red, double green, double blue, double master)
GLenum GLenum GLsizei const GLuint GLboolean enabled
Interface used to access dynamic property GradingTone value.
GradingRGBMSW(double start, double width)
class OCIOEXPORT DynamicProperty
GLenum const GLfloat * params
OCIO_SHARED_PTR< FixedFunctionTransform > FixedFunctionTransformRcPtr
OCIOEXPORT DynamicPropertyGradingPrimaryRcPtr AsGradingPrimary(DynamicPropertyRcPtr &prop)
OCIO_SHARED_PTR< DynamicPropertyGradingRGBCurve > DynamicPropertyGradingRGBCurveRcPtr
OCIO_SHARED_PTR< ExponentWithLinearTransform > ExponentWithLinearTransformRcPtr
class OCIOEXPORT LookTransform
OCIO_SHARED_PTR< ColorSpaceTransform > ColorSpaceTransformRcPtr
OCIO_SHARED_PTR< const Context > ConstContextRcPtr
Interface used to access dynamic property ConstGradingRGBCurveRcPtr value.
Algorithms for Logarithmic color spaces.
OCIO_SHARED_PTR< DynamicPropertyDouble > DynamicPropertyDoubleRcPtr
OCIO_SHARED_PTR< Lut3DTransform > Lut3DTransformRcPtr
OCIOEXPORT DynamicPropertyGradingRGBCurveRcPtr AsGradingRGBCurve(DynamicPropertyRcPtr &prop)
OCIO_SHARED_PTR< ExposureContrastTransform > ExposureContrastTransformRcPtr
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
OCIO_SHARED_PTR< LogTransform > LogTransformRcPtr
class OCIOEXPORT GroupTransform
class OCIOEXPORT GradingBSplineCurve
class OCIOEXPORT Transform
OCIO_SHARED_PTR< GradingPrimaryTransform > GradingPrimaryTransformRcPtr
OCIO_SHARED_PTR< GradingBSplineCurve > GradingBSplineCurveRcPtr
GLuint const GLchar * name
GradingTone(GradingStyle style)
class OCIOEXPORT GradingRGBCurve
GLboolean GLboolean GLboolean b
GradingPrimary(GradingStyle style)
GA_API const UT_StringHolder transform
OCIO_SHARED_PTR< GradingRGBCurve > GradingRGBCurveRcPtr
OCIO_SHARED_PTR< MatrixTransform > MatrixTransformRcPtr
OCIO_SHARED_PTR< Transform > TransformRcPtr
GradingStyle
Styles for grading transforms.
class OCIOEXPORT DynamicPropertyGradingPrimary
OCIO_SHARED_PTR< const Config > ConstConfigRcPtr
OCIO_SHARED_PTR< RangeTransform > RangeTransformRcPtr
OCIO_SHARED_PTR< GradingToneTransform > GradingToneTransformRcPtr
OCIO_SHARED_PTR< DynamicPropertyGradingPrimary > DynamicPropertyGradingPrimaryRcPtr
GLenum GLsizei GLsizei GLint * values
Interface used to access dynamic property GradingPrimary value.
OCIO_SHARED_PTR< BuiltinTransform > BuiltinTransformRcPtr
OCIO_SHARED_PTR< FileTransform > FileTransformRcPtr
GA_API const UT_StringHolder pivot
Lut1DHueAdjust
Used by :cpp:classLut1DTransform to control optional hue restoration algorithm.
OCIO_SHARED_PTR< const GradingBSplineCurve > ConstGradingBSplineCurveRcPtr
class OCIOEXPORT AllocationTransform
OCIO_SHARED_PTR< LogAffineTransform > LogAffineTransformRcPtr
OCIOEXPORT std::ostream & operator<<(std::ostream &, const ColorSpaceMenuParameters &)
FixedFunctionStyle
Enumeration of the :cpp:class:FixedFunctionTransform transform algorithms.
OCIO_SHARED_PTR< GroupTransform > GroupTransformRcPtr
OCIOEXPORT DynamicPropertyDoubleRcPtr AsDouble(DynamicPropertyRcPtr &prop)
class OCIOEXPORT FileTransform
PXL_API void getLooks(UT_StringArray &looks)
Returns a list of looks (color transforms)
GradingRGBMSW(double red, double green, double blue, double master, double start, double width)
OCIO_SHARED_PTR< CDLTransform > CDLTransformRcPtr
class OCIOEXPORT DynamicPropertyGradingTone
void write(T &out, bool v)
OCIO_SHARED_PTR< GradingRGBCurveTransform > GradingRGBCurveTransformRcPtr
A BSpline curve defined with GradingControlPoint.
class OCIOEXPORT DisplayViewTransform
png_structrp int png_fixed_point red
OCIO_SHARED_PTR< const GradingRGBCurve > ConstGradingRGBCurveRcPtr
RGBCurveType
Types for GradingRGBCurve.
class OCIOEXPORT DynamicPropertyDouble
OCIOEXPORT DynamicPropertyGradingToneRcPtr AsGradingTone(DynamicPropertyRcPtr &prop)
ExposureContrastStyle
Enumeration of the :cpp:class:ExposureContrastTransform transform algorithms.
OCIO_SHARED_PTR< DynamicProperty > DynamicPropertyRcPtr
class OCIOEXPORT DynamicPropertyGradingRGBCurve