# dpx::Reader Class Reference

DPX Image Reader class. More...

`#include <DPX.h>`

Collaboration diagram for dpx::Reader:
[legend]

List of all members.

## 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.
## Public Attributes
Header | header
| DPX header.
## Protected Attributes
InStream * | fd
Codec * | codex [MAX_ELEMENTS]
ElementReadStream * | rio

## Detailed Description

DPX Image Reader class.

## Constructor & Destructor Documentation

dpx::Reader::Reader | ( |  | ) |

Constructor.

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

Destructor.

## Member Function Documentation

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:

  | data | buffer
  | size | size of the buffer component
  | block | image area to read
  | desc | element description type

Returns:
  success true/false

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.

block - this contains the square block of data to read in.

Parameters:

  | element | element (0-7)
  | data | buffer
  | block | image area to read

Returns:
  success true/false

The data elements in this structure need to be normalized Left to Right, Top to Bottom.

bool dpx::Reader::ReadHeader | ( |  | ) |

Read the dpx header into the header member.

Returns:
  success true/false

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:

  | data | buffer
  | size | size of the buffer component
  | desc | element description type

Returns:
  success true/false

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:

  | element | element (0-7)
  | data | buffer

Returns:
  success true/false

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:

  | data | buffer

Returns:
  success true/false

void dpx::Reader::Reset | ( |  | ) |

clear any caching or memory allocated specific to an image

void dpx::Reader::SetInStream | ( | InStream * | stream | ) |

Set the InStream object to be used to read images.

Parameters:

  | stream | Object to use for low level reads

## Member Data Documentation

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

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

Header dpx::Reader::header

DPX header.

ElementReadStream* dpx::Reader::rio`[protected]`

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

- /Users/patrick/Development/DPX/svn/source/DPX.h
- /Users/patrick/Development/DPX/svn/source/Reader.cpp