ImageDesc¶
- class PyOpenColorIO.ImageDesc¶
This is a light-weight wrapper around an image, that provides a context for pixel access. This does NOT claim ownership of the pixels or copy image data.
- ImageDesc() None ¶
- getBitDepth() PyOpenColorIO.BitDepth ¶
Get the bit-depth.
- getHeight() int ¶
Get the height to process (where y position starts at 0 and ends at height-1).
- getWidth() int ¶
Get the width to process (where x position starts at 0 and ends at width-1).
- getXStrideBytes() int ¶
Get the step in bytes to find the same color channel of the next pixel.
- getYStrideBytes() int ¶
Get the step in bytes to find the same color channel of the pixel at the same position in the next line.
- isFloat() bool ¶
Is the image buffer 32-bit float?
- isRGBAPacked() bool ¶
Is the image buffer in packed mode with the 4 color channels? (“Packed” here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any PackedImageDesc.)
- PyOpenColorIO.AutoStride: int¶
-
class ImageDesc¶
This is a light-weight wrapper around an image, that provides a context for pixel access. This does NOT claim ownership of the pixels or copy image data.
Subclassed by PackedImageDesc, PlanarImageDesc
Public Functions
-
ImageDesc()¶
-
virtual ~ImageDesc()¶
-
virtual void *getRData() const = 0¶
Get a pointer to the red channel of the first pixel.
-
virtual void *getGData() const = 0¶
Get a pointer to the green channel of the first pixel.
-
virtual void *getBData() const = 0¶
Get a pointer to the blue channel of the first pixel.
-
virtual void *getAData() const = 0¶
Get a pointer to the alpha channel of the first pixel or null as alpha channel is optional.
-
virtual long getWidth() const = 0¶
Get the width to process (where x position starts at 0 and ends at width-1).
-
virtual long getHeight() const = 0¶
Get the height to process (where y position starts at 0 and ends at height-1).
-
virtual ptrdiff_t getXStrideBytes() const = 0¶
Get the step in bytes to find the same color channel of the next pixel.
-
virtual ptrdiff_t getYStrideBytes() const = 0¶
Get the step in bytes to find the same color channel of the pixel at the same position in the next line.
-
virtual bool isRGBAPacked() const = 0¶
Is the image buffer in packed mode with the 4 color channels? (“Packed” here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any PackedImageDesc.)
-
virtual bool isFloat() const = 0¶
Is the image buffer 32-bit float?
-
ImageDesc()¶
-
const ptrdiff_t OpenColorIO_v2_2::AutoStride = std::numeric_limits<ptrdiff_t>::min()¶
PackedImageDesc¶
- class PyOpenColorIO.PackedImageDesc¶
All the constructors expect a pointer to packed image data (such as rgbrgbrgb or rgbargbargba) starting at the first color channel of the first pixel to process (which does not need to be the first pixel of the image). The number of channels must be greater than or equal to 3. If a 4th channel is specified, it is assumed to be alpha information. Channels > 4 will be ignored.
Note
The methods assume the CPUProcessor bit-depth type for the data pointer.
- PackedImageDesc(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PackedImageDesc, data: buffer, width: int, height: int, numChannels: int) -> None
Note
numChannels must be 3 (RGB) or 4 (RGBA).
__init__(self: PyOpenColorIO.PackedImageDesc, data: buffer, width: int, height: int, numChannels: int, bitDepth: PyOpenColorIO.BitDepth, chanStrideBytes: int, xStrideBytes: int, yStrideBytes: int) -> None
Note
numChannels must be 3 (RGB) or 4 (RGBA).
__init__(self: PyOpenColorIO.PackedImageDesc, data: buffer, width: int, height: int, chanOrder: PyOpenColorIO.ChannelOrdering) -> None
__init__(self: PyOpenColorIO.PackedImageDesc, data: buffer, width: int, height: int, chanOrder: PyOpenColorIO.ChannelOrdering, bitDepth: PyOpenColorIO.BitDepth, chanStrideBytes: int, xStrideBytes: int, yStrideBytes: int) -> None
- getBitDepth() PyOpenColorIO.BitDepth ¶
Get the bit-depth.
- getChanStrideBytes() int ¶
- getChannelOrder() PyOpenColorIO.ChannelOrdering ¶
Get the channel ordering of all the pixels.
- getData() numpy.ndarray ¶
Get a pointer to the first color channel of the first pixel.
- getHeight() int ¶
Get the height to process (where y position starts at 0 and ends at height-1).
- getNumChannels() int ¶
- getWidth() int ¶
Get the width to process (where x position starts at 0 and ends at width-1).
- getXStrideBytes() int ¶
Get the step in bytes to find the same color channel of the next pixel.
- getYStrideBytes() int ¶
Get the step in bytes to find the same color channel of the pixel at the same position in the next line.
- isFloat() bool ¶
Is the image buffer 32-bit float?
- isRGBAPacked() bool ¶
Is the image buffer in packed mode with the 4 color channels? (“Packed” here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any PackedImageDesc.)
-
class PackedImageDesc : public ImageDesc¶
All the constructors expect a pointer to packed image data (such as rgbrgbrgb or rgbargbargba) starting at the first color channel of the first pixel to process (which does not need to be the first pixel of the image). The number of channels must be greater than or equal to 3. If a 4th channel is specified, it is assumed to be alpha information. Channels > 4 will be ignored.
Note
The methods assume the CPUProcessor bit-depth type for the data pointer.
Public Functions
-
PackedImageDesc(void *data, long width, long height, long numChannels)¶
Note
numChannels must be 3 (RGB) or 4 (RGBA).
-
PackedImageDesc(void *data, long width, long height, long numChannels, BitDepth bitDepth, ptrdiff_t chanStrideBytes, ptrdiff_t xStrideBytes, ptrdiff_t yStrideBytes)¶
Note
numChannels must be 3 (RGB) or 4 (RGBA).
-
PackedImageDesc(void *data, long width, long height, ChannelOrdering chanOrder)¶
-
PackedImageDesc(void *data, long width, long height, ChannelOrdering chanOrder, BitDepth bitDepth, ptrdiff_t chanStrideBytes, ptrdiff_t xStrideBytes, ptrdiff_t yStrideBytes)¶
-
virtual ~PackedImageDesc()¶
-
ChannelOrdering getChannelOrder() const¶
Get the channel ordering of all the pixels.
-
void *getData() const¶
Get a pointer to the first color channel of the first pixel.
-
virtual void *getRData() const override¶
Get a pointer to the red channel of the first pixel.
-
virtual void *getGData() const override¶
Get a pointer to the green channel of the first pixel.
-
virtual void *getBData() const override¶
Get a pointer to the blue channel of the first pixel.
-
virtual void *getAData() const override¶
Get a pointer to the alpha channel of the first pixel or null as alpha channel is optional.
-
virtual long getWidth() const override¶
Get the width to process (where x position starts at 0 and ends at width-1).
-
virtual long getHeight() const override¶
Get the height to process (where y position starts at 0 and ends at height-1).
-
long getNumChannels() const¶
-
ptrdiff_t getChanStrideBytes() const¶
-
virtual ptrdiff_t getXStrideBytes() const override¶
Get the step in bytes to find the same color channel of the next pixel.
-
virtual ptrdiff_t getYStrideBytes() const override¶
Get the step in bytes to find the same color channel of the pixel at the same position in the next line.
-
virtual bool isRGBAPacked() const override¶
Is the image buffer in packed mode with the 4 color channels? (“Packed” here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any PackedImageDesc.)
-
virtual bool isFloat() const override¶
Is the image buffer 32-bit float?
-
PackedImageDesc(void *data, long width, long height, long numChannels)¶
PlanarImageDesc¶
- class PyOpenColorIO.PlanarImageDesc¶
All the constructors expect pointers to the specified image planes (i.e. rrrr gggg bbbb) starting at the first color channel of the first pixel to process (which need not be the first pixel of the image). Pass NULL for aData if no alpha exists (r/g/bData must not be NULL).
Note
The methods assume the CPUProcessor bit-depth type for the R/G/B/A data pointers.
- PlanarImageDesc(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, width: int, height: int) -> None
__init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, aData: buffer, width: int, height: int) -> None
Note that although PlanarImageDesc is powerful enough to also describe all PackedImageDesc scenarios, it is recommended to use a PackedImageDesc where possible since that allows for additional optimizations.
__init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, width: int, height: int, bitDepth: PyOpenColorIO.BitDepth, xStrideBytes: int, yStrideBytes: int) -> None
__init__(self: PyOpenColorIO.PlanarImageDesc, rData: buffer, gData: buffer, bData: buffer, aData: buffer, width: int, height: int, bitDepth: PyOpenColorIO.BitDepth, xStrideBytes: int, yStrideBytes: int) -> None
- getAData() numpy.ndarray ¶
Get a pointer to the alpha channel of the first pixel or null as alpha channel is optional.
- getBData() numpy.ndarray ¶
Get a pointer to the blue channel of the first pixel.
- getBitDepth() PyOpenColorIO.BitDepth ¶
Get the bit-depth.
- getGData() numpy.ndarray ¶
Get a pointer to the green channel of the first pixel.
- getHeight() int ¶
Get the height to process (where y position starts at 0 and ends at height-1).
- getRData() numpy.ndarray ¶
Get a pointer to the red channel of the first pixel.
- getWidth() int ¶
Get the width to process (where x position starts at 0 and ends at width-1).
- getXStrideBytes() int ¶
Get the step in bytes to find the same color channel of the next pixel.
- getYStrideBytes() int ¶
Get the step in bytes to find the same color channel of the pixel at the same position in the next line.
- isFloat() bool ¶
Is the image buffer 32-bit float?
- isRGBAPacked() bool ¶
Is the image buffer in packed mode with the 4 color channels? (“Packed” here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any PackedImageDesc.)
-
class PlanarImageDesc : public ImageDesc¶
All the constructors expect pointers to the specified image planes (i.e. rrrr gggg bbbb) starting at the first color channel of the first pixel to process (which need not be the first pixel of the image). Pass NULL for aData if no alpha exists (r/g/bData must not be NULL).
Note
The methods assume the CPUProcessor bit-depth type for the R/G/B/A data pointers.
Public Functions
-
PlanarImageDesc(void *rData, void *gData, void *bData, void *aData, long width, long height)¶
-
PlanarImageDesc(void *rData, void *gData, void *bData, void *aData, long width, long height, BitDepth bitDepth, ptrdiff_t xStrideBytes, ptrdiff_t yStrideBytes)¶
Note that although PlanarImageDesc is powerful enough to also describe all PackedImageDesc scenarios, it is recommended to use a PackedImageDesc where possible since that allows for additional optimizations.
-
virtual ~PlanarImageDesc()¶
-
virtual void *getRData() const override¶
Get a pointer to the red channel of the first pixel.
-
virtual void *getGData() const override¶
Get a pointer to the green channel of the first pixel.
-
virtual void *getBData() const override¶
Get a pointer to the blue channel of the first pixel.
-
virtual void *getAData() const override¶
Get a pointer to the alpha channel of the first pixel or null as alpha channel is optional.
-
virtual long getWidth() const override¶
Get the width to process (where x position starts at 0 and ends at width-1).
-
virtual long getHeight() const override¶
Get the height to process (where y position starts at 0 and ends at height-1).
-
virtual ptrdiff_t getXStrideBytes() const override¶
Get the step in bytes to find the same color channel of the next pixel.
-
virtual ptrdiff_t getYStrideBytes() const override¶
Get the step in bytes to find the same color channel of the pixel at the same position in the next line.
-
virtual bool isRGBAPacked() const override¶
Is the image buffer in packed mode with the 4 color channels? (“Packed” here means that XStrideBytes is 4x the bytes per channel, so it is more specific than simply any PackedImageDesc.)
-
virtual bool isFloat() const override¶
Is the image buffer 32-bit float?
-
PlanarImageDesc(void *rData, void *gData, void *bData, void *aData, long width, long height)¶