5 #ifndef INCLUDED_OCIO_OPENCOLORIO_H
6 #define INCLUDED_OCIO_OPENCOLORIO_H
69 #pragma warning( push )
70 #pragma warning( disable : 4275 )
114 #pragma warning( pop )
249 const char * archivePath,
250 const char * destinationDir
402 unsigned int getMajorVersion()
const;
409 void setMajorVersion(
unsigned int major);
412 unsigned int getMinorVersion()
const;
415 void setMinorVersion(
unsigned int minor);
418 void setVersion(
unsigned int major,
unsigned int minor);
421 void upgradeToLatestVersion() noexcept;
430 void validate()
const;
439 const char *
getName()
const noexcept;
440 void setName(
const char *
name) noexcept;
448 char getFamilySeparator()
const;
450 static char GetDefaultFamilySeparator() noexcept;
457 void setFamilySeparator(
char separator);
460 void setDescription(
const char * description);
468 void serialize(std::ostream & os)
const;
481 const char * getCacheID()
const;
492 void addEnvironmentVar(
const char * name,
const char * defaultValue);
493 int getNumEnvironmentVars()
const;
494 const char * getEnvironmentVarNameByIndex(
int index)
const;
495 const char * getEnvironmentVarDefault(
const char * name)
const;
496 void clearEnvironmentVars();
512 void loadEnvironment() noexcept;
514 const char * getSearchPath()
const;
521 void setSearchPath(
const char *
path);
523 int getNumSearchPaths()
const;
530 const char * getSearchPath(
int index)
const;
531 void clearSearchPaths();
540 void addSearchPath(
const char * path);
542 const char * getWorkingDir()
const;
552 void setWorkingDir(
const char * dirname);
597 int getNumColorSpaces()
const;
605 const char * getColorSpaceNameByIndex(
int index)
const;
615 int getIndexForColorSpace(
const char * name)
const;
631 const char * getCanonicalName(
const char * name)
const;
656 void removeColorSpace(
const char * name);
664 bool isColorSpaceUsed(
const char * name)
const noexcept;
673 void clearColorSpaces();
689 void setInactiveColorSpaces(
const char * inactiveColorSpaces);
690 const char * getInactiveColorSpaces()
const;
693 bool isInactiveColorSpace(
const char * colorspace)
const noexcept;
730 bool isColorSpaceLinear(
const char * colorSpace,
ReferenceSpaceType referenceSpaceType)
const;
751 static const char * IdentifyBuiltinColorSpace(
const ConstConfigRcPtr & srcConfig,
753 const char * builtinColorSpaceName);
785 static void IdentifyInterchangeSpace(
const char ** srcInterchangeName,
786 const char ** builtinInterchangeName,
788 const char * srcColorSpaceName,
790 const char * builtinColorSpaceName);
810 void setRole(
const char * role,
const char * colorSpaceName);
811 int getNumRoles()
const;
813 bool hasRole(
const char * role)
const;
820 const char * getRoleName(
int index)
const;
826 const char * getRoleColorSpace(
int index)
const;
832 const char * getRoleColorSpace(
const char * roleName)
const noexcept;
860 bool isViewShared(
const char * dispName,
const char * viewName)
const;
863 void addSharedView(
const char * view,
const char * viewTransformName,
864 const char * colorSpaceName,
const char * looks,
865 const char * ruleName,
const char * description);
867 void removeSharedView(
const char * view);
870 void clearSharedViews();
873 int getNumDisplays()
const;
875 const char * getDisplay(
int index)
const;
880 const char *
getDefaultView(
const char * display,
const char * colorspaceName)
const;
886 int getNumViews(
const char * display)
const;
887 const char * getView(
const char * display,
int index)
const;
893 int getNumViews(
const char * display,
const char * colorspaceName)
const;
894 const char * getView(
const char * display,
const char * colorspaceName,
int index)
const;
910 const char * dispName,
911 const char * viewName);
917 const char * getDisplayViewTransformName(
const char * display,
const char * view)
const;
922 const char * getDisplayViewColorSpaceName(
const char * display,
const char * view)
const;
924 const char * getDisplayViewLooks(
const char * display,
const char * view)
const;
926 const char * getDisplayViewRule(
const char * display,
const char * view)
const noexcept;
928 const char * getDisplayViewDescription(
const char * display,
const char * view)
const noexcept;
939 bool hasView(
const char * dispName,
const char * viewName)
const;
945 void addDisplayView(
const char * display,
const char * view,
946 const char * colorSpaceName,
const char * looks);
960 void addDisplayView(
const char * display,
const char * view,
const char * viewTransformName,
961 const char * colorSpaceName,
const char * looks,
962 const char * ruleName,
const char * description);
973 void addDisplaySharedView(
const char * display,
const char * sharedView);
984 void removeDisplayView(
const char * display,
const char * view);
986 void clearDisplays();
1011 bool hasVirtualView(
const char * viewName)
const;
1014 bool isVirtualViewShared(
const char * viewName)
const;
1016 void addVirtualDisplayView(
const char * view,
1017 const char * viewTransformName,
1018 const char * colorSpaceName,
1020 const char * ruleName,
1021 const char * description);
1023 void addVirtualDisplaySharedView(
const char * sharedView);
1026 int getVirtualDisplayNumViews(
ViewType type)
const noexcept;
1028 const char * getVirtualDisplayView(
ViewType type,
int index)
const noexcept;
1045 const char * viewName);
1047 const char * getVirtualDisplayViewTransformName(
const char * view)
const noexcept;
1048 const char * getVirtualDisplayViewColorSpaceName(
const char * view)
const noexcept;
1049 const char * getVirtualDisplayViewLooks(
const char * view)
const noexcept;
1050 const char * getVirtualDisplayViewRule(
const char * view)
const noexcept;
1051 const char * getVirtualDisplayViewDescription(
const char * view)
const noexcept;
1054 void removeVirtualDisplayView(
const char * view) noexcept;
1057 void clearVirtualDisplay() noexcept;
1084 int instantiateDisplayFromMonitorName(
const char * monitorName);
1096 int instantiateDisplayFromICCProfile(
const char * ICCProfileFilepath);
1120 void setActiveDisplays(
const char * displays);
1125 int getNumActiveDisplays()
const;
1127 const char * getActiveDisplay(
int index)
const;
1130 void addActiveDisplay(
const char * display);
1132 void removeActiveDisplay(
const char * display);
1134 void clearActiveDisplays();
1158 void setActiveViews(
const char * views);
1163 int getNumActiveViews()
const;
1165 const char * getActiveView(
int index)
const;
1168 void addActiveView(
const char * view);
1170 void removeActiveView(
const char * view);
1172 void clearActiveViews();
1175 int getNumDisplaysAll()
const noexcept;
1176 const char * getDisplayAll(
int index)
const noexcept;
1177 int getDisplayAllByName(
const char *)
const noexcept;
1182 bool isDisplayTemporary(
int index)
const noexcept;
1187 void setDisplayTemporary(
int index,
bool isTemporary) noexcept;
1195 int getNumViews(
ViewType type,
const char * display)
const;
1196 const char * getView(
ViewType type,
const char * display,
int index)
const;
1230 void getDefaultLumaCoefs(
double * rgb)
const;
1232 void setDefaultLumaCoefs(
const double * rgb);
1243 int getNumLooks()
const;
1245 const char * getLookNameByIndex(
int index)
const;
1258 int getNumViewTransforms()
const noexcept;
1262 const char * getViewTransformNameByIndex(
int i)
const noexcept;
1284 const char * getDefaultViewTransformName()
const noexcept;
1285 void setDefaultViewTransformName(
const char * defaultName) noexcept;
1288 void clearViewTransforms();
1305 int index)
const noexcept;
1308 int getNumNamedTransforms()
const noexcept;
1311 const char * getNamedTransformNameByIndex(
int index)
const noexcept;
1314 int getIndexForNamedTransform(
const char * name)
const noexcept;
1334 void removeNamedTransform(
const char * name);
1337 void clearNamedTransforms();
1356 const char * getColorSpaceFromFilepath(
const char * filePath)
const;
1364 const char * getColorSpaceFromFilepath(
const char * filePath,
size_t & ruleIndex)
const;
1373 bool filepathOnlyMatchesDefaultRule(
const char * filePath)
const;
1384 OCIO_DEPRECATED(
"This was marked as deprecated starting in v2.0, please use Config::getColorSpaceFromFilepath().")
1387 bool isStrictParsingEnabled()
const;
1388 void setStrictParsingEnabled(
bool enabled);
1413 const char * dstColorSpaceName)
const;
1415 const char * srcColorSpaceName,
1416 const char * dstColorSpaceName)
const;
1421 const char * display,
1426 const char * srcColorSpaceName,
1427 const char * display,
1441 const char * namedTransformName,
1484 const char * srcColorSpaceName,
1485 const char * builtinColorSpaceName);
1493 static ConstProcessorRcPtr GetProcessorFromBuiltinColorSpace(
const char * builtinColorSpaceName,
1495 const char * srcColorSpaceName);
1505 const char * srcColorSpaceName,
1507 const char * dstColorSpaceName);
1510 const char * srcColorSpaceName,
1513 const char * dstColorSpaceName);
1523 const char * srcColorSpaceName,
1524 const char * srcInterchangeName,
1526 const char * dstColorSpaceName,
1527 const char * dstInterchangeName);
1531 const char * srcColorSpaceName,
1532 const char * srcInterchangeName,
1535 const char * dstColorSpaceName,
1536 const char * dstInterchangeName);
1543 const char * srcColorSpaceName,
1545 const char * dstDisplay,
1546 const char * dstView,
1551 const char * srcColorSpaceName,
1554 const char * dstDisplay,
1555 const char * dstView,
1563 const char * srcColorSpaceName,
1564 const char * srcInterchangeName,
1566 const char * dstDisplay,
1567 const char * dstView,
1568 const char * dstInterchangeName,
1573 const char * srcColorSpaceName,
1574 const char * srcInterchangeName,
1577 const char * dstDisplay,
1578 const char * dstView,
1579 const char * dstInterchangeName,
1597 void clearProcessorCache() noexcept;
1627 bool isArchivable()
const;
1653 void archive(std::ostream & ostream)
const;
1664 static void deleter(
Config*
c);
1668 Impl * getImpl() {
return m_impl; }
1669 const Impl * getImpl()
const {
return m_impl; }
1745 size_t getNumEntries() const noexcept;
1748 size_t getIndexForRule(const
char * ruleName) const;
1751 const
char *
getName(
size_t ruleIndex) const;
1754 const
char * getPattern(
size_t ruleIndex) const;
1755 void setPattern(
size_t ruleIndex, const
char *
pattern);
1758 const
char * getExtension(
size_t ruleIndex) const;
1759 void setExtension(
size_t ruleIndex, const
char *
extension);
1762 const
char * getRegex(
size_t ruleIndex) const;
1763 void setRegex(
size_t ruleIndex, const
char * regex);
1766 const
char * getColorSpace(
size_t ruleIndex) const;
1767 void setColorSpace(
size_t ruleIndex, const
char * colorSpace);
1770 size_t getNumCustomKeys(
size_t ruleIndex) const;
1772 const
char * getCustomKeyName(
size_t ruleIndex,
size_t key) const;
1774 const
char * getCustomKeyValue(
size_t ruleIndex,
size_t key) const;
1779 void setCustomKey(
size_t ruleIndex, const
char * key, const
char *
value);
1795 void insertRule(
size_t ruleIndex, const
char *
name, const
char * colorSpace,
1796 const
char * pattern, const
char * extension);
1797 void insertRule(
size_t ruleIndex, const
char * name, const
char * colorSpace,
1798 const
char * regex);
1805 void insertPathSearchRule(
size_t ruleIndex);
1807 void setDefaultRuleColorSpace(const
char * colorSpace);
1816 void removeRule(
size_t ruleIndex);
1819 void increaseRulePriority(
size_t ruleIndex);
1822 void decreaseRulePriority(
size_t ruleIndex);
1839 static
void deleter(FileRules*
c);
1845 Impl * getImpl() {
return m_impl; }
1846 const Impl * getImpl()
const {
return m_impl; }
1884 size_t getNumEntries()
const noexcept;
1890 size_t getIndexForRule(
const char * ruleName)
const;
1893 const char *
getName(
size_t ruleIndex)
const;
1896 size_t getNumColorSpaces(
size_t ruleIndex)
const;
1898 const char * getColorSpace(
size_t ruleIndex,
size_t colorSpaceIndex)
const;
1906 void addColorSpace(
size_t ruleIndex,
const char * colorSpace);
1908 void removeColorSpace(
size_t ruleIndex,
size_t colorSpaceIndex);
1911 size_t getNumEncodings(
size_t ruleIndex)
const;
1913 const char * getEncoding(
size_t ruleIndex,
size_t encodingIndex)
const;
1921 void addEncoding(
size_t ruleIndex,
const char * encoding);
1923 void removeEncoding(
size_t ruleIndex,
size_t encodingIndex);
1926 size_t getNumCustomKeys(
size_t ruleIndex)
const;
1928 const char * getCustomKeyName(
size_t ruleIndex,
size_t keyIndex)
const;
1930 const char * getCustomKeyValue(
size_t ruleIndex,
size_t keyIndex)
const;
1935 void setCustomKey(
size_t ruleIndex,
const char * key,
const char *
value);
1946 void insertRule(
size_t ruleIndex,
const char * ruleName);
1949 void removeRule(
size_t ruleIndex);
1965 Impl * getImpl() {
return m_impl; }
1966 const Impl * getImpl()
const {
return m_impl; }
1993 const char *
getName()
const noexcept;
1995 void setName(
const char *
name) noexcept;
1997 size_t getNumAliases()
const noexcept;
1999 const char * getAlias(
size_t idx)
const noexcept;
2001 bool hasAlias(
const char * alias)
const noexcept;
2009 void addAlias(
const char * alias) noexcept;
2011 void removeAlias(
const char * alias) noexcept;
2012 void clearAliases() noexcept;
2019 const char * getFamily()
const noexcept;
2021 void setFamily(
const char * family);
2030 const char * getEqualityGroup()
const noexcept;
2031 void setEqualityGroup(
const char * equalityGroup);
2034 void setDescription(
const char * description);
2046 const char * getInteropID()
const noexcept;
2047 void setInteropID(
const char * interopID);
2066 const char *getInterchangeAttribute(
const char *attrName)
const;
2067 void setInterchangeAttribute(
const char* attrName,
const char *
value);
2068 std::map<std::string, std::string> getInterchangeAttributes()
const noexcept;
2070 BitDepth getBitDepth()
const noexcept;
2071 void setBitDepth(
BitDepth bitDepth);
2100 bool hasCategory(
const char * category)
const;
2107 void addCategory(
const char * category);
2114 void removeCategory(
const char * category);
2116 int getNumCategories()
const;
2123 const char * getCategory(
int index)
const;
2125 void clearCategories();
2145 const char * getEncoding()
const noexcept;
2146 void setEncoding(
const char * encoding);
2160 bool isData()
const noexcept;
2161 void setIsData(
bool isData) noexcept;
2171 void setAllocation(
Allocation allocation) noexcept;
2186 int getAllocationNumVars()
const;
2188 void setAllocationVars(
int numvars,
const float * vars);
2216 Impl * getImpl() {
return m_impl; }
2217 const Impl * getImpl()
const {
return m_impl; }
2261 int getNumColorSpaces()
const;
2266 const char * getColorSpaceNameByIndex(
int index)
const;
2288 int getColorSpaceIndex(
const char * name)
const;
2299 bool hasColorSpace(
const char * name)
const;
2319 void removeColorSpace(
const char * name);
2323 void clearColorSpaces();
2338 Impl * getImpl() {
return m_impl; }
2339 const Impl * getImpl()
const {
return m_impl; }
2401 void setName(
const char *
name);
2403 const char * getProcessSpace()
const;
2404 void setProcessSpace(
const char * processSpace);
2415 void setDescription(
const char * description);
2429 const char *getInterchangeAttribute(
const char *attrName)
const;
2430 void setInterchangeAttribute(
const char* attrName,
const char *
value);
2431 std::map<std::string, std::string> getInterchangeAttributes()
const noexcept;
2441 static void deleter(
Look*
c);
2445 Impl * getImpl() {
return m_impl; }
2446 const Impl * getImpl()
const {
return m_impl; }
2467 virtual const char *
getName()
const noexcept = 0;
2468 virtual void setName(
const char *
name) noexcept = 0;
2471 virtual size_t getNumAliases()
const noexcept = 0;
2473 virtual const char * getAlias(
size_t idx)
const noexcept = 0;
2475 virtual bool hasAlias(
const char* alias)
const noexcept = 0;
2480 virtual void addAlias(
const char * alias) noexcept = 0;
2482 virtual void removeAlias(
const char * alias) noexcept = 0;
2483 virtual void clearAliases() noexcept = 0;
2486 virtual const char * getFamily()
const noexcept = 0;
2488 virtual void setFamily(
const char * family) noexcept = 0;
2491 virtual void setDescription(
const char * description) noexcept = 0;
2494 virtual bool hasCategory(
const char * category)
const noexcept = 0;
2496 virtual void addCategory(
const char * category) noexcept = 0;
2498 virtual void removeCategory(
const char * category) noexcept = 0;
2500 virtual int getNumCategories()
const noexcept = 0;
2502 virtual const char * getCategory(
int index)
const noexcept = 0;
2504 virtual void clearCategories() noexcept = 0;
2511 virtual const char * getEncoding()
const noexcept = 0;
2512 virtual void setEncoding(
const char * encoding) noexcept = 0;
2557 const char *
getName()
const noexcept;
2558 void setName(
const char *
name) noexcept;
2561 const char * getFamily()
const noexcept;
2563 void setFamily(
const char * family);
2566 void setDescription(
const char * description);
2580 const char *getInterchangeAttribute(
const char *attrName)
const;
2581 void setInterchangeAttribute(
const char* attrName,
const char *
value);
2582 std::map<std::string, std::string> getInterchangeAttributes()
const noexcept;
2585 bool hasCategory(
const char * category)
const;
2587 void addCategory(
const char * category);
2589 void removeCategory(
const char * category);
2591 int getNumCategories()
const;
2593 const char * getCategory(
int index)
const;
2595 void clearCategories();
2624 Impl * getImpl() {
return m_impl; }
2625 const Impl * getImpl()
const {
return m_impl; }
2642 bool isNoOp()
const;
2648 bool hasChannelCrosstalk()
const;
2654 const char * getCacheID()
const;
2673 int getNumTransforms()
const;
2711 bool isDynamic()
const noexcept;
2742 unsigned edgelen)
const;
2798 Impl * getImpl() {
return m_impl; }
2799 const Impl * getImpl()
const {
return m_impl; }
2810 bool isNoOp()
const;
2818 bool hasChannelCrosstalk()
const;
2820 const char * getCacheID()
const;
2825 BitDepth getOutputBitDepth()
const;
2840 bool isDynamic()
const noexcept;
2846 void apply(
const ImageDesc & imgDesc)
const;
2858 void applyRGB(
float * pixel)
const;
2859 void applyRGBA(
float * pixel)
const;
2875 Impl * getImpl() {
return m_impl; }
2876 const Impl * getImpl()
const {
return m_impl; }
2886 bool isNoOp()
const;
2888 bool hasChannelCrosstalk()
const;
2890 const char * getCacheID()
const;
2912 Impl * getImpl() {
return m_impl; }
2913 const Impl * getImpl()
const {
return m_impl; }
2929 int getNumFiles()
const;
2930 const char * getFile(
int index)
const;
2932 int getNumLooks()
const;
2933 const char * getLook(
int index)
const;
2935 void addFile(
const char * fname);
2936 void addLook(
const char * look);
2950 Impl * getImpl() {
return m_impl; }
2951 const Impl * getImpl()
const {
return m_impl; }
2994 const char * getFormat()
const;
2996 void setFormat(
const char * formatName);
3009 const char * getInputSpace()
const;
3011 void setInputSpace(
const char * inputSpace);
3013 const char * getShaperSpace()
const;
3020 void setShaperSpace(
const char * shaperSpace);
3029 void setLooks(
const char * looks);
3031 const char * getTargetSpace()
const;
3033 void setTargetSpace(
const char * targetSpace);
3035 const char * getDisplay()
const;
3036 const char * getView()
const;
3038 void setDisplayView(
const char * display,
const char * view);
3040 int getShaperSize()
const;
3046 void setShaperSize(
int shapersize);
3048 int getCubeSize()
const;
3053 void setCubeSize(
int cubesize);
3056 void bake(std::ostream & os)
const;
3059 static int getNumFormats();
3065 static const char * getFormatNameByIndex(
int index);
3070 static const char * getFormatExtensionByIndex(
int index);
3080 static void deleter(
Baker* o);
3084 Impl * getImpl() {
return m_impl; }
3085 const Impl * getImpl()
const {
return m_impl; }
3107 virtual void * getRData()
const = 0;
3109 virtual void * getGData()
const = 0;
3111 virtual void * getBData()
const = 0;
3116 virtual void * getAData()
const = 0;
3119 virtual BitDepth getBitDepth()
const = 0;
3122 virtual long getWidth()
const = 0;
3124 virtual long getHeight()
const = 0;
3127 virtual ptrdiff_t getXStrideBytes()
const = 0;
3132 virtual ptrdiff_t getYStrideBytes()
const = 0;
3139 virtual bool isRGBAPacked()
const = 0;
3141 virtual bool isFloat()
const = 0;
3182 long width,
long height,
3185 ptrdiff_t chanStrideBytes,
3186 ptrdiff_t xStrideBytes,
3187 ptrdiff_t yStrideBytes);
3190 long width,
long height,
3194 long width,
long height,
3197 ptrdiff_t chanStrideBytes,
3198 ptrdiff_t xStrideBytes,
3199 ptrdiff_t yStrideBytes);
3207 BitDepth getBitDepth()
const override;
3210 void * getData()
const;
3212 void * getRData()
const override;
3213 void * getGData()
const override;
3214 void * getBData()
const override;
3215 void * getAData()
const override;
3217 long getWidth()
const override;
3218 long getHeight()
const override;
3219 long getNumChannels()
const;
3221 ptrdiff_t getChanStrideBytes()
const;
3222 ptrdiff_t getXStrideBytes()
const override;
3223 ptrdiff_t getYStrideBytes()
const override;
3225 bool isRGBAPacked()
const override;
3226 bool isFloat()
const override;
3231 Impl * getImpl() {
return m_impl; }
3232 const Impl * getImpl()
const {
return m_impl; }
3256 PlanarImageDesc(
void * rData,
void * gData,
void * bData,
void * aData,
3266 PlanarImageDesc(
void * rData,
void * gData,
void * bData,
void * aData,
3267 long width,
long height,
3269 ptrdiff_t xStrideBytes,
3270 ptrdiff_t yStrideBytes);
3274 void * getRData()
const override;
3275 void * getGData()
const override;
3276 void * getBData()
const override;
3277 void * getAData()
const override;
3280 BitDepth getBitDepth()
const override;
3282 long getWidth()
const override;
3283 long getHeight()
const override;
3285 ptrdiff_t getXStrideBytes()
const override;
3286 ptrdiff_t getYStrideBytes()
const override;
3288 bool isRGBAPacked()
const override;
3289 bool isFloat()
const override;
3294 Impl * getImpl() {
return m_impl; }
3295 const Impl * getImpl()
const {
return m_impl; }
3367 const char * getUniqueID()
const noexcept;
3368 void setUniqueID(
const char * uid) noexcept;
3374 const char * getFunctionName()
const noexcept;
3376 void setFunctionName(
const char *
name) noexcept;
3378 const char * getPixelName()
const noexcept;
3380 void setPixelName(
const char * name) noexcept;
3389 const char * getResourcePrefix()
const noexcept;
3391 void setResourcePrefix(
const char * prefix) noexcept;
3406 void setDescriptorSetIndex(
unsigned index,
unsigned textureBindingStart = 1);
3407 unsigned getDescriptorSetIndex()
const noexcept;
3408 unsigned getTextureBindingStart()
const noexcept;
3410 virtual const char * getCacheID()
const noexcept;
3413 virtual void begin(
const char * uid);
3418 virtual void setTextureMaxWidth(
unsigned maxWidth) = 0;
3419 virtual unsigned getTextureMaxWidth()
const noexcept = 0;
3422 virtual void setAllowTexture1D(
bool allowed) = 0;
3423 virtual bool getAllowTexture1D()
const = 0;
3429 unsigned getNextResourceIndex() noexcept;
3444 virtual bool addUniform(
const char * name,
3447 virtual bool addUniform(
const char * name,
3450 virtual bool addUniform(
const char * name,
3457 virtual bool addUniform(
const char * name,
3460 const unsigned maxSize) = 0;
3466 virtual bool addUniform(
const char * name,
3469 const unsigned maxSize) = 0;
3475 unsigned getNumDynamicProperties() const noexcept;
3509 virtual unsigned addTexture(
const char * textureName,
3510 const char * samplerName,
3512 TextureType channel,
3513 TextureDimensions dimensions,
3515 const float *
values) = 0;
3528 virtual unsigned add3DTexture(
const char * textureName,
3529 const char * samplerName,
3532 const float *
values) = 0;
3535 virtual void addToParameterDeclareShaderCode(
const char * shaderCode);
3536 virtual void addToTextureDeclareShaderCode(
const char* shaderCode);
3537 virtual void addToHelperShaderCode(
const char * shaderCode);
3538 virtual void addToFunctionHeaderShaderCode(
const char * shaderCode);
3539 virtual void addToFunctionShaderCode(
const char * shaderCode);
3540 virtual void addToFunctionFooterShaderCode(
const char * shaderCode);
3550 virtual void createShaderText(
const char * shaderParameterDeclarations,
3551 const char * shaderTextureDeclarations,
3552 const char * shaderHelperMethods,
3553 const char * shaderFunctionHeader,
3554 const char * shaderFunctionBody,
3555 const char * shaderFunctionFooter);
3557 virtual void finalize();
3749 std::size_t m_bufferOffset{};
3764 virtual unsigned getNumUniforms() const noexcept = 0;
3766 virtual const
char * getUniform(
unsigned index, UniformData &
data) const = 0;
3776 virtual std::
size_t getUniformBufferSize() const noexcept = 0;
3779 virtual
unsigned getNumTextures() const noexcept = 0;
3780 virtual
void getTexture(
unsigned index,
3781 const
char *& textureName,
3782 const
char *& samplerName,
3785 TextureType & channel,
3786 TextureDimensions & dimensions,
3788 virtual
void getTextureValues(
unsigned index, const
float *&
values) const = 0;
3791 virtual
unsigned getNum3DTextures() const noexcept = 0;
3792 virtual
void get3DTexture(
unsigned index,
3793 const
char *& textureName,
3794 const
char *& samplerName,
3797 virtual
void get3DTextureValues(
unsigned index, const
float *&
values) const = 0;
3800 const
char * getShaderText() const noexcept;
3856 const char * getCacheID()
const;
3858 void setSearchPath(
const char *
path);
3859 const char * getSearchPath()
const;
3861 int getNumSearchPaths()
const;
3862 const char * getSearchPath(
int index)
const;
3863 void clearSearchPaths();
3864 void addSearchPath(
const char * path);
3865 void setWorkingDir(
const char * dirname);
3866 const char * getWorkingDir()
const;
3871 void setStringVar(
const char *
name,
const char *
value) noexcept;
3874 const char * getStringVar(
const char * name)
const noexcept;
3876 int getNumStringVars()
const;
3877 const char * getStringVarNameByIndex(
int index)
const;
3879 const char * getStringVarByIndex(
int index)
const;
3881 void clearStringVars();
3891 void loadEnvironment() noexcept;
3896 const char * resolveStringVar(
const char *
string)
const noexcept;
3899 const char * resolveStringVar(
const char *
string,
ContextRcPtr & usedContextVars)
const noexcept;
3911 const char * resolveFileLocation(
const char *
filename)
const;
3914 const char * resolveFileLocation(
const char * filename,
ContextRcPtr & usedContextVars)
const;
3921 Context(
const Context &) =
delete;
3922 Context&
operator= (
const Context &) =
delete;
3929 static void deleter(Context*
c);
3933 Impl * getImpl() {
return m_impl; }
3934 const Impl * getImpl()
const {
return m_impl; }
3957 virtual size_t getNumBuiltins()
const noexcept = 0;
3962 virtual const char * getBuiltinStyle(
size_t index)
const = 0;
3964 virtual const char * getBuiltinDescription(
size_t index)
const = 0;
3987 virtual size_t getNumBuiltinConfigs()
const noexcept = 0;
3991 virtual const char * getBuiltinConfigName(
size_t configIndex)
const = 0;
3995 virtual const char * getBuiltinConfigUIName(
size_t configIndex)
const = 0;
3999 virtual const char * getBuiltinConfig(
size_t configIndex)
const = 0;
4003 virtual const char * getBuiltinConfigByName(
const char * configName)
const = 0;
4017 virtual bool isBuiltinConfigRecommended(
size_t configIndex)
const = 0;
4044 virtual bool isSupported()
const noexcept = 0;
4051 virtual size_t getNumMonitors()
const noexcept = 0;
4060 virtual const char * getMonitorName(
size_t idx)
const = 0;
4062 virtual const char * getProfileFilepath(
size_t idx)
const = 0;
4095 virtual std::vector<uint8_t> getLutData(
const char * filepath)
const = 0;
4102 virtual std::string getConfigData()
const = 0;
4121 virtual std::string getFastLutFileHash(
const char * filepath)
const = 0;
4126 #endif // INCLUDED_OCIO_OPENCOLORIO_H
OCIOEXPORT ConstConfigRcPtr GetCurrentConfig()
Get the current configuration.
EnvironmentMode
Controls which environment variables are loaded into a Context object.
GLuint GLsizei const GLchar * message
OCIO_SHARED_PTR< const ViewTransform > ConstViewTransformRcPtr
static const char * DefaultRuleName
Reserved rule name for the default rule.
class OCIOEXPORT GpuShaderDesc
PXL_API const char * getDescription(const ColorSpace *space)
Return the description of the color space.
GT_API const UT_StringHolder filename
OCIOEXPORT ConstColorSpaceSetRcPtr operator&&(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)
Perform the intersection of two sets.
bool isDefault(const cgltf_texture_view &tv)
PXL_API void getColorSpaces(UT_StringArray &names)
Returns a list of the supported color spaces.
This class holds the GPU-related information needed to build a shader program from a specific process...
std::function< const float *()> VectorFloatGetter
Function returning a float *, used by uniforms.
class OCIOEXPORT ColorSpaceSet
OCIOEXPORT void SetLoggingLevel(LoggingLevel level)
Set the global logging level.
OCIO_SHARED_PTR< ViewingRules > ViewingRulesRcPtr
OCIOEXPORT void SetComputeHashFunction(ComputeHashFunction hashFunction)
Set the Compute Hash Function to use; otherwise, use the default.
OCIO_SHARED_PTR< GpuShaderCreator > GpuShaderCreatorRcPtr
*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
PXL_API void getActiveViews(UT_StringArray &names)
Returns the list of active views.
ChannelOrdering
Used by PackedImageDesc to indicate the channel ordering of the image to process. ...
This is a light-weight wrapper around an image, that provides a context for pixel access...
OCIO_SHARED_PTR< Processor > ProcessorRcPtr
IMF_EXPORT IMATH_NAMESPACE::V3f direction(const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &pixelPosition)
class OCIOEXPORT BuiltinTransformRegistry
GLsizei const GLfloat * value
GLsizei const GLchar *const * path
OptimizationFlags
Provides control over how the ops in a Processor are combined in order to improve performance...
const Impl * getImpl() const
class OCIOEXPORT ViewingRules
OCIO_SHARED_PTR< const Transform > ConstTransformRcPtr
bool isIdentity(const MatType &m)
Determine if a matrix is an identity matrix.
OCIO_SHARED_PTR< FileRules > FileRulesRcPtr
std::function< int()> SizeGetter
Function returning an int, used by uniforms.
An exception class to throw for errors detected at runtime.
OCIO_SHARED_PTR< const BuiltinTransformRegistry > ConstBuiltinTransformRegistryRcPtr
OCIOEXPORT bool operator!=(const GradingRGBM &lhs, const GradingRGBM &rhs)
std::function< const Float3 &()> Float3Getter
Functions returning a Float3, used by uniforms.
OCIO_SHARED_PTR< ConfigIOProxy > ConfigIOProxyRcPtr
Only need a red channel texture.
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
PXL_API const char * getDefaultView(const char *display=NULL)
Returns the current color space name.
DynamicPropertyType
Types for dynamic properties.
GLenum GLenum GLsizei const GLuint GLboolean enabled
OCIOEXPORT void LogMessage(LoggingLevel level, const char *message)
Log a message using the library logging function.
class OCIOEXPORT Exception
OCIOEXPORT int GetVersionHex()
Get the version number for the library, as a single 4-byte hex number (e.g., 0x01050200 for "1...
OCIO_SHARED_PTR< const NamedTransform > ConstNamedTransformRcPtr
static const char * FilePathSearchRuleName
Reserved rule name for the file path search rule.
std::function< const int *()> VectorIntGetter
Function returning an int *, used by uniforms.
OCIOEXPORT void ClearAllCaches()
GpuLanguage
Used when there is a choice of hardware shader language.
ProcessorCacheFlags
cpp:type:: Enum to control the behavior of the internal caches e.g. the processor cache in ...
OCIO_SHARED_PTR< Look > LookRcPtr
OCIO_SHARED_PTR< const ProcessorMetadata > ConstProcessorMetadataRcPtr
class OCIOEXPORT GpuShaderCreator
GLint GLsizei GLsizei height
GLint GLint GLsizei GLint GLenum GLenum type
OCIO_SHARED_PTR< const Context > ConstContextRcPtr
OCIOEXPORT ConstColorSpaceSetRcPtr operator||(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)
Perform the union of two sets.
class OCIOEXPORT CPUProcessor
OCIO_SHARED_PTR< ProcessorMetadata > ProcessorMetadataRcPtr
OCIO_SHARED_PTR< const CPUProcessor > ConstCPUProcessorRcPtr
OCIOEXPORT void SetLoggingFunction(LoggingFunction logFunction)
Set the logging function to use; otherwise, use the default (i.e. std::cerr).
OCIOEXPORT void ResetToDefaultLoggingFunction()
class OCIOEXPORT ViewTransform
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
class OCIOEXPORT ConfigIOProxy
OCIO_SHARED_PTR< Baker > BakerRcPtr
OCIOEXPORT const char * GetEnvVariable(const char *name)
class OCIOEXPORT ProcessorMetadata
A config defines all the color spaces to be available at runtime.
class OCIOEXPORT GPUProcessor
PXL_API bool getAllocationVars(const ColorSpace *space, bool &uniform, fpreal &min, fpreal &max, fpreal &offset)
Return the allocation variable meta data about the color space.
OPENVDB_API void setVersion(std::ios_base &, const VersionId &libraryVersion, uint32_t fileVersion)
Associate specific file format and library version numbers with the given stream. ...
std::function< void(const char *)> LoggingFunction
Define the logging function signature.
std::function< double()> DoubleGetter
Function returning a double, used by uniforms. GPU converts double to float.
OCIOEXPORT void SetEnvVariable(const char *name, const char *value)
OCIO_SHARED_PTR< const Processor > ConstProcessorRcPtr
GLuint const GLchar * name
OCIO_SHARED_PTR< const ColorSpaceSet > ConstColorSpaceSetRcPtr
OCIO_SHARED_PTR< const FileRules > ConstFileRulesRcPtr
#define OCIO_DEPRECATED(msg)
PXL_API const char * getDefaultDisplay()
Returns the current color space name.
GA_API const UT_StringHolder transform
OCIOEXPORT void ResetComputeHashFunction()
PXL_API const char * parseColorSpaceFromString(const char *string)
OCIOEXPORT const char * GetVersion()
Get the version number for the library, as a dot-delimited string (e.g., "1.0.0").
UniformDataType
Types for uniform data.
std::function< std::string(const std::string &)> ComputeHashFunction
Define Compute Hash function signature.
OCIO_SHARED_PTR< const SystemMonitors > ConstSystemMonitorsRcPtr
std::function< bool()> BoolGetter
Function returning a bool, used by uniforms.
OCIO_SHARED_PTR< ColorSpaceSet > ColorSpaceSetRcPtr
OCIO_SHARED_PTR< const Config > ConstConfigRcPtr
OCIO_SHARED_PTR< NamedTransform > NamedTransformRcPtr
OCIO_SHARED_PTR< const Look > ConstLookRcPtr
GLenum GLsizei GLsizei GLint * values
class OCIOEXPORT Processor
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.
OCIOEXPORT bool operator==(const GradingRGBM &lhs, const GradingRGBM &rhs)
class OCIOEXPORT ImageDesc
OCIO_SHARED_PTR< Config > ConfigRcPtr
LeafData & operator=(const LeafData &)=delete
class OCIOEXPORT NamedTransform
OCIO_SHARED_PTR< Context > ContextRcPtr
OCIOEXPORT void SetCurrentConfig(const ConstConfigRcPtr &config)
Set the current configuration. This will then store a copy of the specified config.
OCIOEXPORT void ExtractOCIOZArchive(const char *archivePath, const char *destinationDir)
Extract an OCIO Config archive.
OCIOEXPORT std::ostream & operator<<(std::ostream &, const ColorSpaceMenuParameters &)
OCIO_SHARED_PTR< GpuShaderDesc > GpuShaderDescRcPtr
class OCIOEXPORT FileRules
OCIOEXPORT void UnsetEnvVariable(const char *name)
OCIOEXPORT bool IsEnvVariablePresent(const char *name)
cpp:function::
class OCIOEXPORT SystemMonitors
OCIO_SHARED_PTR< GroupTransform > GroupTransformRcPtr
class OCIOEXPORT ColorSpace
PXL_API void getLooks(UT_StringArray &looks)
Returns a list of looks (color transforms)
const ptrdiff_t AutoStride
OCIO_SHARED_PTR< const ViewingRules > ConstViewingRulesRcPtr
PXL_API void getActiveDisplays(UT_StringArray &names)
Returns the list of active displays.
OCIO_SHARED_PTR< ColorSpace > ColorSpaceRcPtr
OCIOEXPORT const char * ResolveConfigPath(const char *originalPath) noexcept
Make a config path forward-compatible by replacing special built-in config names with the current nam...
OCIOEXPORT LoggingLevel GetLoggingLevel()
Get the global logging level.
An exception class for errors detected at runtime.
OCIO_SHARED_PTR< const ColorSpace > ConstColorSpaceRcPtr
OCIOEXPORT ConstColorSpaceSetRcPtr operator-(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)
Perform the difference of two sets.
OIIO_UTIL_API std::string extension(string_view filepath, bool include_dot=true) noexcept
OCIO_SHARED_PTR< const GPUProcessor > ConstGPUProcessorRcPtr
The File Rules are a set of filepath to color space mappings that are evaluated from first to last...
OCIO_SHARED_PTR< ViewTransform > ViewTransformRcPtr
OCIO_SHARED_PTR< DynamicProperty > DynamicPropertyRcPtr