ColorSpace

Caution

API Docs are a work in progress, expect them to improve over time.

The ColorSpace is the state of an image with respect to colorimetry and color encoding. Transforming images between different ColorSpaces is the primary motivation for this library.

While a complete discussion of color spaces is beyond the scope of header documentation, traditional uses would be to have ColorSpaces corresponding to: physical capture devices (known cameras, scanners), and internal ‘convenience’ spaces (such as scene linear, logarithmic).

ColorSpaces are specific to a particular image precision (float32, uint8, etc.), and the set of ColorSpaces that provide equivalent mappings (at different precisions) are referred to as a ‘family’.

class ColorSpace

ColorSpaceRcPtr createEditableCopy() const
const char *getName() const noexcept
void setName(const char *name)
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)
BitDepth getBitDepth() const noexcept
void setBitDepth(BitDepth bitDepth)
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

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()

-[ Public Static Functions ]-

ColorSpaceRcPtr Create()
ColorSpaceRcPtr Create(ReferenceSpaceType referenceSpace)
class PyOpenColorIO.ColorSpace
class ColorSpaceCategoryIterator
addCategory(self: PyOpenColorIO.ColorSpace, category: str) → None
clearCategories(self: PyOpenColorIO.ColorSpace) → None
getAllocation(self: PyOpenColorIO.ColorSpace)PyOpenColorIO.Allocation
getAllocationVars(self: PyOpenColorIO.ColorSpace) → List[float]
getBitDepth(self: PyOpenColorIO.ColorSpace)PyOpenColorIO.BitDepth
getCategories(self: PyOpenColorIO.ColorSpace) → OpenColorIO_v2_0dev::PyIterator<std::shared_ptr<OpenColorIO_v2_0dev::ColorSpace>, 0>
getDescription(self: PyOpenColorIO.ColorSpace) → str
getEncoding(self: PyOpenColorIO.ColorSpace) → str
getEqualityGroup(self: PyOpenColorIO.ColorSpace) → str
getFamily(self: PyOpenColorIO.ColorSpace) → str
getName(self: PyOpenColorIO.ColorSpace) → str
getReferenceSpaceType(self: PyOpenColorIO.ColorSpace)PyOpenColorIO.ReferenceSpaceType
getTransform(self: PyOpenColorIO.ColorSpace, direction: PyOpenColorIO.ColorSpaceDirection) → PyOpenColorIO.Transform
hasCategory(self: PyOpenColorIO.ColorSpace, category: str) → bool
isData(self: PyOpenColorIO.ColorSpace) → bool
removeCategory(self: PyOpenColorIO.ColorSpace, category: str) → None
setAllocation(self: PyOpenColorIO.ColorSpace, allocation: PyOpenColorIO.Allocation) → None
setAllocationVars(self: PyOpenColorIO.ColorSpace, vars: List[float]) → None
setBitDepth(self: PyOpenColorIO.ColorSpace, bitDepth: PyOpenColorIO.BitDepth) → None
setDescription(self: PyOpenColorIO.ColorSpace, description: str) → None
setEncoding(self: PyOpenColorIO.ColorSpace, encoding: str) → None
setEqualityGroup(self: PyOpenColorIO.ColorSpace, equalityGroup: str) → None
setFamily(self: PyOpenColorIO.ColorSpace, family: str) → None
setIsData(self: PyOpenColorIO.ColorSpace, isData: bool) → None
setName(self: PyOpenColorIO.ColorSpace, name: str) → None
setTransform(self: PyOpenColorIO.ColorSpace, transform: PyOpenColorIO.Transform, direction: PyOpenColorIO.ColorSpaceDirection) → None