Interface to Alias Pix files.
#include <AlPixFile.h> class AlPixFile enum Format { kAlias = 1, kSGI, kGIF, kTIFF, kTIFF16, kOMF, kTIM, kRLA, kFIDO, kHARRY }; AlPixFile(); virtual ~AlPixFile(); statusCode openForRead( char *path ); statusCode openForWrite( char *path, int width, int height, int numChannels, Format fileFormat = kAlias ); statusCode close(); int read( AlPixel *ldata ); int write( AlPixel *ldata ); int width(); int height(); int numChannels(); statusCode fileFormat( Format& );
This class allows you to read and write Alias Pix files. Please note that kGIF is unsupported since this class cannot open GIF files.
Constructs the Pix file object.
Deletes the Pix file object.
Opens the Pix file for writing.
< path - file to be opened
< width - resolution in x direction
< height - resolution in y direction
< numChannels - 4 for RGBA, 3 for RGB, 1 for A
sSuccess - file successfully opened for writing
sAlreadyCreated - file had already been opened
sFailure - file could not be opened
Opens the Pix file for reading.
< path - file to be opened
sSuccess - file successfully opened for reading
sAlreadyCreated - file had already been opened
sFailure - file could not be opened
Closes the Pix file.
sSuccess - file successfully closed
sInvalidArgument - file had not been opened
sFailure - file could not be closed
Reads a scanline from the Pix file. ’ldata’ must be previously allocated to hold a scanline of AlPixels.
> ldata - array of size ’width’
Returns the number of pixels read. -1 indicates a failure.
Writes a scanline to the Pix file. ’ldata’ must contain the scanline.
< ldata - array of size ’width’
Returns the number of pixels written. -1 indicates a failure.
Returns the x resolution of the Pix file. -1 indicates a failure.
Returns the y resolution of the Pix file. -1 indicates a failure.
Returns the number of used channels in the Pix file. -1 indicates a failure.
Returns the format of the pix file.
> format - the file format
sSuccess - the file format was found
sFailure - the method failed