TuttleOFX  1
dpx::Reader Class Reference

DPX Image Reader class. More...

#include <DPX.h>

Collaboration diagram for dpx::Reader:

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

InStreamfd
Codeccodex [MAX_ELEMENTS]
ElementReadStreamrio

Detailed Description

DPX Image Reader class.

Definition at line 177 of file DPX.h.


Constructor & Destructor Documentation

dpx::Reader::Reader ( )

Constructor.

Definition at line 48 of file Reader.cpp.

References codex, and MAX_ELEMENTS.

dpx::Reader::~Reader ( ) [virtual]

Destructor.

Definition at line 56 of file Reader.cpp.


Member Function Documentation

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.

Parameters:
elementelement (0-7)
databuffer
blockimage area to read
Returns:
success true/false

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.

Parameters:
databuffer
sizesize of the buffer component
blockimage area to read
descelement description type
Returns:
success true/false

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.

Here is the call graph for this function:

bool dpx::Reader::ReadHeader ( )

Read the dpx header into the header member.

Returns:
success true/false

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

Parameters:
elementelement (0-7)
databuffer
Returns:
success true/false

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.

Parameters:
databuffer
sizesize of the buffer component
descelement description type
Returns:
success true/false

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.

Parameters:
databuffer
Returns:
success true/false

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.

Parameters:
streamObject to use for low level reads

Definition at line 83 of file Reader.cpp.


Field Documentation

Codec* dpx::Reader::codex[MAX_ELEMENTS] [protected]

Definition at line 281 of file DPX.h.

Referenced by Reader().

InStream* dpx::Reader::fd [protected]

Definition at line 279 of file DPX.h.

DPX header.

Definition at line 185 of file DPX.h.

Definition at line 282 of file DPX.h.


The documentation for this class was generated from the following files: