TuttleOFX
1
|
DPX Image Reader class. More...
#include <DPX.h>
Public Member Functions | |
Reader () | |
Constructor. | |
virtual | ~Reader () |
Destructor. | |
void | SetInStream (InStream *stream) |
Set the InStream object to be used to read images. | |
void | Reset () |
clear any caching or memory allocated specific to an image | |
bool | ReadHeader () |
Read the dpx header into the header member. | |
bool | ReadImage (const int element, void *data) |
Read an image element into a buffer. | |
bool | ReadImage (void *data, const DataSize size=kWord, const Descriptor desc=kRGB) |
Read an image element into a buffer that matches the image description type. | |
bool | ReadBlock (const int element, unsigned char *data, Block &block) |
Read a rectangular image block into a buffer from the specified image element. | |
bool | ReadBlock (void *data, const DataSize size, Block &block, const Descriptor desc=kRGB) |
Read a rectangular image block into a buffer from the image element specified by the Descriptor type. | |
bool | ReadUserData (unsigned char *data) |
Read the user data into a buffer. | |
Data Fields | |
Header | header |
DPX header. | |
Protected Attributes | |
InStream * | fd |
Codec * | codex [MAX_ELEMENTS] |
ElementReadStream * | rio |
dpx::Reader::Reader | ( | ) |
dpx::Reader::~Reader | ( | ) | [virtual] |
Destructor.
Definition at line 56 of file Reader.cpp.
bool dpx::Reader::ReadBlock | ( | const int | element, |
unsigned char * | data, | ||
Block & | block | ||
) |
Read a rectangular image block into a buffer from the specified image element.
element | element (0-7) |
data | buffer |
block | image area to read |
block - this contains the square block of data to read in. The data elements in this structure need to be normalized Left to Right, Top to Bottom.
Definition at line 124 of file Reader.cpp.
References dpx::kUndefinedDescriptor, and MAX_ELEMENTS.
bool dpx::Reader::ReadBlock | ( | void * | data, |
const DataSize | size, | ||
Block & | block, | ||
const Descriptor | desc = kRGB |
||
) |
Read a rectangular image block into a buffer from the image element specified by the Descriptor type.
data | buffer |
size | size of the buffer component |
block | image area to read |
desc | element description type |
Definition at line 148 of file Reader.cpp.
References dpx::Block::Check(), dpx::EndianSwapImageBuffer(), dpx::kByte, dpx::kDouble, dpx::kFloat, dpx::kRLE, InStream::kStart, dpx::kWord, MAX_ELEMENTS, tuttle::ofx::imageEffect::numberOfComponents(), dpx::Codec::Read(), dpx::Block::x1, dpx::Block::x2, dpx::Block::y1, and dpx::Block::y2.
bool dpx::Reader::ReadHeader | ( | ) |
Read the dpx header into the header member.
Definition at line 90 of file Reader.cpp.
bool dpx::Reader::ReadImage | ( | const int | element, |
void * | data | ||
) |
Read an image element into a buffer.
the size of the buffer must be large enough simple calculation would be: width * height * num_of_components * size_of_component
element | element (0-7) |
data | buffer |
Definition at line 96 of file Reader.cpp.
References dpx::kUndefinedDescriptor, and MAX_ELEMENTS.
bool dpx::Reader::ReadImage | ( | void * | data, |
const DataSize | size = kWord , |
||
const Descriptor | desc = kRGB |
||
) |
Read an image element into a buffer that matches the image description type.
The DataSize allows the user to specific the buffer DataSize which can differ from the image element. It is possible, for example, to read an 8-bit per component (3 components per pixel for RGB) into 16-bits.
data | buffer |
size | size of the buffer component |
desc | element description type |
Definition at line 110 of file Reader.cpp.
bool dpx::Reader::ReadUserData | ( | unsigned char * | data | ) |
Read the user data into a buffer.
Buffer must be large enough to hold the user data.
data | buffer |
Definition at line 225 of file Reader.cpp.
References InStream::kStart.
void dpx::Reader::Reset | ( | ) |
clear any caching or memory allocated specific to an image
Definition at line 62 of file Reader.cpp.
References MAX_ELEMENTS.
void dpx::Reader::SetInStream | ( | InStream * | stream | ) |
Set the InStream object to be used to read images.
stream | Object to use for low level reads |
Definition at line 83 of file Reader.cpp.
Codec* dpx::Reader::codex[MAX_ELEMENTS] [protected] |
InStream* dpx::Reader::fd [protected] |
ElementReadStream* dpx::Reader::rio [protected] |