HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InputFile Class Reference

Provides generic access to read an image from an EXR file. More...

#include <ImfInputFile.h>

Public Member Functions

IMF_EXPORT InputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &is, int numThreads=globalThreadCount())
 
IMF_EXPORT InputFile (const char filename[], int numThreads=globalThreadCount())
 
IMF_EXPORT InputFile (const char *filename, const ContextInitializer &ctxtinit, int numThreads=globalThreadCount())
 
IMF_EXPORT const char * fileName () const
 
IMF_EXPORT const Headerheader () const
 
IMF_EXPORT int version () const
 
IMF_EXPORT void setFrameBuffer (const FrameBuffer &frameBuffer)
 
IMF_EXPORT const FrameBufferframeBuffer () const
 
IMF_EXPORT bool isComplete () const
 
IMF_EXPORT bool isOptimizationEnabled () const
 
IMF_EXPORT void readPixels (int scanLine1, int scanLine2)
 
IMF_EXPORT void readPixels (int scanLine)
 
IMF_EXPORT void readPixels (const FrameBuffer &frameBuffer, int scanLine1, int scanLine2)
 
IMF_EXPORT void rawPixelData (int firstScanLine, const char *&pixelData, int &pixelDataSize)
 
IMF_EXPORT void rawPixelDataToBuffer (int scanLine, char *pixelData, int &pixelDataSize) const
 
IMF_EXPORT void rawTileData (int &dx, int &dy, int &lx, int &ly, const char *&pixelData, int &pixelDataSize)
 

Friends

class MultiPartInputFile
 
class TiledOutputFile
 

Detailed Description

Provides generic access to read an image from an EXR file.

There are a suite of classes for accessing image data, depending on the level of complexity your application demands. This one is perhaps a good starting point. There is a simpler one in

See Also
RgbaInputFile, but that has very noted limitations of only being for a 16-bit half, RGBA image. This class gives access to arbitrary channels and data type outputs. It also will convert a tiled image into a "normal" image, and simplify access if you only want the first part, first image of a file.

If you will be accessing tiles (say for a renderer), working with multi-part images, or reading deep data there are other classes which provide API for handling that complexity more efficiently:

MultiPartInputFile can be constructed but not directly accessible

Of these, InputFile provide somewhat of a barrier to knowing what the file actually contains, such that it allows you to read a file as if it is scanlines, even if it is actually tiled under the covers. Similar, a deep file is automatically composited for the user. If a multi-part file is opened, the first part will be provided.

For most code, it is suggested to use MultiPartInputFile and the API provided by the relevant part classes, but if only a simple API is needed, InputFile will certainly hide much of the complexity.

Definition at line 64 of file ImfInputFile.h.

Constructor & Destructor Documentation

IMF_EXPORT InputFile::InputFile ( OPENEXR_IMF_INTERNAL_NAMESPACE::IStream is,
int  numThreads = globalThreadCount() 
)
IMF_EXPORT InputFile::InputFile ( const char  filename[],
int  numThreads = globalThreadCount() 
)
IMF_EXPORT InputFile::InputFile ( const char *  filename,
const ContextInitializer ctxtinit,
int  numThreads = globalThreadCount() 
)

Member Function Documentation

IMF_EXPORT const char* InputFile::fileName ( ) const
IMF_EXPORT const FrameBuffer& InputFile::frameBuffer ( ) const
IMF_EXPORT const Header& InputFile::header ( ) const
IMF_EXPORT bool InputFile::isComplete ( ) const
IMF_EXPORT bool InputFile::isOptimizationEnabled ( ) const
IMF_EXPORT void InputFile::rawPixelData ( int  firstScanLine,
const char *&  pixelData,
int pixelDataSize 
)
IMF_EXPORT void InputFile::rawPixelDataToBuffer ( int  scanLine,
char *  pixelData,
int pixelDataSize 
) const
IMF_EXPORT void InputFile::rawTileData ( int dx,
int dy,
int lx,
int ly,
const char *&  pixelData,
int pixelDataSize 
)
IMF_EXPORT void InputFile::readPixels ( int  scanLine1,
int  scanLine2 
)
IMF_EXPORT void InputFile::readPixels ( int  scanLine)
IMF_EXPORT void InputFile::readPixels ( const FrameBuffer frameBuffer,
int  scanLine1,
int  scanLine2 
)
IMF_EXPORT void InputFile::setFrameBuffer ( const FrameBuffer frameBuffer)
IMF_EXPORT int InputFile::version ( ) const

Friends And Related Function Documentation

friend class MultiPartInputFile
friend

Definition at line 274 of file ImfInputFile.h.

friend class TiledOutputFile
friend

Definition at line 278 of file ImfInputFile.h.


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