ColorSpace¶
-
class
PyOpenColorIO.
ColorSpace
¶ -
ColorSpace
(*args, **kwargs)¶ Overloaded function.
__init__(self: PyOpenColorIO.ColorSpace) -> None
__init__(self: PyOpenColorIO.ColorSpace, referenceSpace: PyOpenColorIO.ReferenceSpaceType) -> None
__init__(self: PyOpenColorIO.ColorSpace, referenceSpace: PyOpenColorIO.ReferenceSpaceType = <ReferenceSpaceType.REFERENCE_SPACE_SCENE: 0>, name: str = ‘’, aliases: List[str] = [], family: str = ‘’, encoding: str = ‘’, equalityGroup: str = ‘’, description: str = ‘’, bitDepth: PyOpenColorIO.BitDepth = <BitDepth.BIT_DEPTH_UNKNOWN: 0>, isData: bool = False, allocation: PyOpenColorIO.Allocation = <Allocation.ALLOCATION_UNIFORM: 1>, allocationVars: List[float] = [], toReference: PyOpenColorIO.Transform = None, fromReference: PyOpenColorIO.Transform = None, categories: List[str] = []) -> None
-
addAlias
(alias: str) → None¶ Add an alias for the color space name (the aliases may be used as a synonym for the name). Nothing will be added if the alias is already the color space name, one of its aliases, or the argument is null. The aliases must not conflict with existing roles, color space names, named transform names, or other aliases. This is verified when adding the color space to the config.
-
addCategory
(category: str) → None¶ Add a single category.
Note
Will do nothing if the category already exists.
-
clearAliases
() → None¶
-
clearCategories
() → None¶ Clear all the categories.
-
getAliases
() → PyOpenColorIO.ColorSpace.ColorSpaceAliasIterator¶
-
getAllocation
() → PyOpenColorIO.Allocation¶
-
getAllocationVars
() → List[float]¶
-
getBitDepth
() → PyOpenColorIO.BitDepth¶
-
getCategories
() → PyOpenColorIO.ColorSpace.ColorSpaceCategoryIterator¶
-
getDescription
() → str¶
-
getEncoding
() → str¶
-
getEqualityGroup
() → str¶ Get the ColorSpace group name (used for equality comparisons) This allows no-op transforms between different colorspaces. If an equalityGroup is not defined (an empty string), it will be considered unique (i.e., it will not compare as equal to other ColorSpaces with an empty equality group). This is often, though not always, set to the same value as ‘family’.
-
getFamily
() → str¶ Get the family, for use in user interfaces (optional) The family string could use a ‘/’ separator to indicate levels to be used by hierarchical menus.
-
getName
() → str¶
-
getReferenceSpaceType
() → PyOpenColorIO.ReferenceSpaceType¶ A display color space will use the display-referred reference space.
-
getTransform
(direction: PyOpenColorIO.ColorSpaceDirection) → PyOpenColorIO.Transform¶ If a transform in the specified direction has been specified, return it. Otherwise return a null ConstTransformRcPtr
-
hasCategory
(category: str) → bool¶ Return true if the category is present.
-
isData
() → bool¶
-
removeAlias
(alias: str) → None¶ Does nothing if alias is not present.
-
removeCategory
(category: str) → None¶ Remove a category.
Note
Will do nothing if the category is missing.
-
setAllocation
(allocation: PyOpenColorIO.Allocation) → None¶
-
setAllocationVars
(vars: List[float]) → None¶
-
setBitDepth
(bitDepth: PyOpenColorIO.BitDepth) → None¶
-
setDescription
(description: str) → None¶
-
setEncoding
(encoding: str) → None¶
-
setEqualityGroup
(equalityGroup: str) → None¶
-
setFamily
(family: str) → None¶ Set the family, for use in user interfaces (optional)
-
setIsData
(isData: bool) → None¶
-
setName
(name: str) → None¶ If the name is already an alias, that alias is removed.
-
setTransform
(transform: PyOpenColorIO.Transform, direction: PyOpenColorIO.ColorSpaceDirection) → None¶ Specify the transform for the appropriate direction. Setting the transform to null will clear it.
-
-
class
OpenColorIO_v2_0
::
ColorSpace
¶ Public Functions
-
ColorSpaceRcPtr
createEditableCopy
() const¶
-
const char *
getName
() const noexcept¶
-
void
setName
(const char *name) noexcept¶ If the name is already an alias, that alias is removed.
-
size_t
getNumAliases
() const noexcept¶
-
const char *
getAlias
(size_t idx) const noexcept¶ Return empty string if idx is out of range.
-
void
addAlias
(const char *alias) noexcept¶ Add an alias for the color space name (the aliases may be used as a synonym for the name). Nothing will be added if the alias is already the color space name, one of its aliases, or the argument is null. The aliases must not conflict with existing roles, color space names, named transform names, or other aliases. This is verified when adding the color space to the config.
-
void
removeAlias
(const char *alias) noexcept¶ Does nothing if alias is not present.
-
void
clearAliases
() noexcept¶
-
const char *
getFamily
() const noexcept¶ Get the family, for use in user interfaces (optional) The family string could use a ‘/’ separator to indicate levels to be used by hierarchical menus.
-
void
setFamily
(const char *family)¶ Set the family, for use in user interfaces (optional)
-
const char *
getEqualityGroup
() const noexcept¶ Get the ColorSpace group name (used for equality comparisons) This allows no-op transforms between different colorspaces. If an equalityGroup is not defined (an empty string), it will be considered unique (i.e., it will not compare as equal to other ColorSpaces with an empty equality group). This is often, though not always, set to the same value as ‘family’.
-
void
setEqualityGroup
(const char *equalityGroup)¶
-
const char *
getDescription
() const noexcept¶
-
void
setDescription
(const char *description)¶
-
ReferenceSpaceType
getReferenceSpaceType
() const noexcept¶ A display color space will use the display-referred reference space.
-
bool
hasCategory
(const char *category) const¶ Return true if the category is present.
-
void
addCategory
(const char *category)¶ Add a single category.
- Note
Will do nothing if the category already exists.
-
void
removeCategory
(const char *category)¶ Remove a category.
- Note
Will do nothing if the category is missing.
-
int
getNumCategories
() const¶ Get the number of categories.
-
const char *
getCategory
(int index) const¶ Return the category name using its index.
- Note
Will be null if the index is invalid.
-
void
clearCategories
()¶ Clear all the categories.
-
const char *
getEncoding
() const noexcept¶
-
void
setEncoding
(const char *encoding)¶
-
bool
isData
() const noexcept¶
-
void
setIsData
(bool isData) noexcept¶
-
Allocation
getAllocation
() const noexcept¶
-
void
setAllocation
(Allocation allocation) noexcept¶
-
int
getAllocationNumVars
() const¶
-
void
getAllocationVars
(float *vars) const¶
-
void
setAllocationVars
(int numvars, const float *vars)¶
-
ConstTransformRcPtr
getTransform
(ColorSpaceDirection dir) const noexcept¶ If a transform in the specified direction has been specified, return it. Otherwise return a null ConstTransformRcPtr
-
void
setTransform
(const ConstTransformRcPtr &transform, ColorSpaceDirection dir)¶ Specify the transform for the appropriate direction. Setting the transform to null will clear it.
-
ColorSpace
(const ColorSpace&) = delete¶
-
ColorSpace &
operator=
(const ColorSpace&) = delete¶
-
~ColorSpace
()¶ Do not use (needed only for pybind11).
Public Static Functions
-
ColorSpaceRcPtr
Create
()¶
-
ColorSpaceRcPtr
Create
(ReferenceSpaceType referenceSpace)¶
-
ColorSpaceRcPtr
-
std::ostream &
OpenColorIO_v2_0
::
operator<<
(std::ostream&, const ColorSpace&)¶
-
typedef std::shared_ptr<const ColorSpace>
OpenColorIO_v2_0
::
ConstColorSpaceRcPtr
¶
-
typedef std::shared_ptr<ColorSpace>
OpenColorIO_v2_0
::
ColorSpaceRcPtr
¶
ColorSpaceSet¶
-
class
PyOpenColorIO.
ColorSpaceSet
¶ The :ref:`ColorSpaceSet` is a set of color spaces (i.e. no color space duplication) which could be the result of
:ref:`Config::getColorSpaces`()
or built from scratch.Note
The color spaces are decoupled from the config ones, i.e., any changes to the set itself or to its color spaces do not affect the original color spaces from the configuration. If needed, use
:ref:`Config::addColorSpace`()
to update the configuration.-
self
&
arg0: PyOpenColorIO.ColorSpaceSet → PyOpenColorIO.ColorSpaceSet¶ Perform the intersection of two sets.
Note
This function provides operations on two color space sets where the result contains copied color spaces and no duplicates.
- Parameters
lcss –
rcss –
-
self
==
arg0: PyOpenColorIO.ColorSpaceSet → bool¶ Return true if the two sets are equal.
Note
The comparison is done on the color space names (not a deep comparison).
-
ColorSpaceSet
() → None¶ Create an empty set of color spaces.
-
self
!=
arg0: PyOpenColorIO.ColorSpaceSet → bool¶ Return true if the two sets are different.
-
self
|
arg0: PyOpenColorIO.ColorSpaceSet → PyOpenColorIO.ColorSpaceSet¶ Perform the union of two sets.
Note
This function provides operations on two color space sets where the result contains copied color spaces and no duplicates.
- Parameters
lcss –
rcss –
-
self
-
arg0: PyOpenColorIO.ColorSpaceSet → PyOpenColorIO.ColorSpaceSet¶ Perform the difference of two sets.
Note
This function provides operations on two color space sets where the result contains copied color spaces and no duplicates.
- Parameters
lcss –
rcss –
-
addColorSpace
(colorSpace: PyOpenColorIO.ColorSpace) → None¶ Add color space(s).
Note
If another color space is already registered with the same name, this will overwrite it. This stores a copy of the specified color space(s). Throws if one of the aliases is already assigned as a name or alias to an existing color space.
-
addColorSpaces
(colorSpaces: PyOpenColorIO.ColorSpaceSet) → None¶
-
clearColorSpaces
() → None¶ Clear all color spaces.
-
getColorSpace
(name: str) → PyOpenColorIO.ColorSpace¶ Note
Only accepts color space names (i.e. no role name).
Will return null if the name is not found.
-
getColorSpaceNames
() → PyOpenColorIO.ColorSpaceSet.ColorSpaceNameIterator¶
-
getColorSpaces
() → PyOpenColorIO.ColorSpaceSet.ColorSpaceIterator¶
-
removeColorSpace
(colorSpace: str) → None¶ Remove color space(s) using color space names (i.e. no role name).
Note
The removal of a missing color space does nothing.
-
removeColorSpaces
(colorSpaces: PyOpenColorIO.ColorSpaceSet) → None¶
-
self
-
class
PyOpenColorIO.ColorSpaceSet.
ColorSpaceNameIterator
¶ -
self
[
arg0: int]
→ str¶
-
iter
(self) → PyOpenColorIO.ColorSpaceSet.ColorSpaceNameIterator¶
-
len
(self) → int¶
-
next
(self) → str¶
-
self
-
class
PyOpenColorIO.ColorSpaceSet.
ColorSpaceIterator
¶ -
self
[
arg0: int]
→ PyOpenColorIO.ColorSpace¶
-
iter
(self) → PyOpenColorIO.ColorSpaceSet.ColorSpaceIterator¶
-
len
(self) → int¶
-
next
(self) → PyOpenColorIO.ColorSpace¶
-
self
-
class
OpenColorIO_v2_0
::
ColorSpaceSet
¶ The ColorSpaceSet is a set of color spaces (i.e. no color space duplication) which could be the result of :cpp:func:
Config::getColorSpaces
or built from scratch.- Note
The color spaces are decoupled from the config ones, i.e., any changes to the set itself or to its color spaces do not affect the original color spaces from the configuration. If needed, use :cpp:func:
Config::addColorSpace
to update the configuration.
Public Functions
-
ColorSpaceSetRcPtr
createEditableCopy
() const¶ Create a set containing a copy of all the color spaces.
-
bool
operator==
(const ColorSpaceSet &css) const¶ Return true if the two sets are equal.
- Note
The comparison is done on the color space names (not a deep comparison).
-
bool
operator!=
(const ColorSpaceSet &css) const¶ Return true if the two sets are different.
-
int
getNumColorSpaces
() const¶ Return the number of color spaces.
-
const char *
getColorSpaceNameByIndex
(int index) const¶ Return the color space name using its index. This will be null if an invalid index is specified.
-
ConstColorSpaceRcPtr
getColorSpaceByIndex
(int index) const¶ Return the color space using its index. This will be empty if an invalid index is specified.
-
ConstColorSpaceRcPtr
getColorSpace
(const char *name) const¶ Will return null if the name is not found.
- Note
Only accepts color space names (i.e. no role name).
-
int
getColorSpaceIndex
(const char *name) const¶ Will return -1 if the name is not found.
- Note
Only accepts color space names (i.e. no role name).
-
bool
hasColorSpace
(const char *name) const¶ - Note
Only accepts color space names (i.e. no role name)
- Return
true
- Return
false
- Parameters
name
:
-
void
addColorSpace
(const ConstColorSpaceRcPtr &cs)¶ Add color space(s).
- Note
If another color space is already registered with the same name, this will overwrite it. This stores a copy of the specified color space(s). Throws if one of the aliases is already assigned as a name or alias to an existing color space.
-
void
addColorSpaces
(const ConstColorSpaceSetRcPtr &cs)¶
-
void
removeColorSpace
(const char *name)¶ Remove color space(s) using color space names (i.e. no role name).
- Note
The removal of a missing color space does nothing.
-
void
removeColorSpaces
(const ConstColorSpaceSetRcPtr &cs)¶
-
void
clearColorSpaces
()¶ Clear all color spaces.
-
~ColorSpaceSet
()¶ Do not use (needed only for pybind11).
Public Static Functions
-
ColorSpaceSetRcPtr
Create
()¶ Create an empty set of color spaces.
-
ConstColorSpaceSetRcPtr
operator||
(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)¶ Perform the union of two sets.
- Note
This function provides operations on two color space sets where the result contains copied color spaces and no duplicates.
- Parameters
lcss
:rcss
:
-
ConstColorSpaceSetRcPtr
operator&&
(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)¶ Perform the intersection of two sets.
- Note
This function provides operations on two color space sets where the result contains copied color spaces and no duplicates.
- Parameters
lcss
:rcss
:
-
ConstColorSpaceSetRcPtr
operator-
(const ConstColorSpaceSetRcPtr &lcss, const ConstColorSpaceSetRcPtr &rcss)¶ Perform the difference of two sets.
- Note
This function provides operations on two color space sets where the result contains copied color spaces and no duplicates.
- Parameters
lcss
:rcss
:
-
typedef std::shared_ptr<const ColorSpaceSet>
OpenColorIO_v2_0
::
ConstColorSpaceSetRcPtr
¶
-
typedef std::shared_ptr<ColorSpaceSet>
OpenColorIO_v2_0
::
ColorSpaceSetRcPtr
¶