class ffw::ImageReader
Class List > ffw :: ImageReader
Inherits the following classes: ffw::ImageFormat
Inherited by the following classes: ffw::BmpLoader, ffw::DdsLoader, ffw::JpgLoader, ffw::PbmLoader, ffw::PngLoader, ffw::TgaLoader, ffw::TifLoader
Protected Attributes
Type | Name |
---|---|
bool | loaded |
int | row |
int | mipmapOffset |
int | mipmaps |
Public Functions
Type | Name |
---|---|
ImageReader () | |
virtual | ~ImageReader () |
virtual void | close () = 0 Closes the file and frees the resources. |
virtual size_t | readRow (void * dest) = 0 Reads a row of pixels. |
virtual bool | getMipMap (int level) |
bool | readAll (void * dest) Reads the entire image into a single array. |
bool | readAll (ffw::ImageBuffer & image) Reads the entire image into an image buffer. |
bool | eof () const |
operator bool () const Same as isOpen() | |
int | getRowOffset () const Returns the number of rows already read. |
bool | isOpen () const Returns true if the image file is open and ready for reading. |
int | getNumOfMipMaps () const Returns the number of mipmaps the image contains. |
int | getMipMapOffset () const Returns the number of mipmaps already read. |
size_t | getAllocationSize () const Returns the number of bytes needed to allocate an array of pixels. |
Protected Attributes Documentation
variable loaded
bool ffw::ImageReader::loaded;
variable row
int ffw::ImageReader::row;
variable mipmapOffset
int ffw::ImageReader::mipmapOffset;
variable mipmaps
int ffw::ImageReader::mipmaps;
Public Functions Documentation
function ImageReader
ffw::ImageReader::ImageReader ()
function ~ImageReader
virtual ffw::ImageReader::~ImageReader ()
function close
virtual void ffw::ImageReader::close () = 0
Closes the file and frees the resources.
function readRow
virtual size_t ffw::ImageReader::readRow (
void * dest
) = 0
Reads a row of pixels.
Parameters:
- dest The destination where to write the pixels
Note:
The dest parameter must be large enough to contain all pixels of a single row. Use reader->getStrideSize() to determine the size of the row in number of bytes.
See also:
function getMipMap
virtual bool ffw::ImageReader::getMipMap (
int level
)
function readAll (1/2)
bool ffw::ImageReader::readAll (
void * dest
)
Reads the entire image into a single array.
Parameters:
- dest The destination where to write the pixels
The dest parameter must be large enough to contain all pixels. Use reader->getStrideSize() multiplied by reader->getHeight() to get the number of bytes needed for the destination array.
function readAll (2/2)
bool ffw::ImageReader::readAll (
ffw::ImageBuffer & image
)
Reads the entire image into an image buffer.
function eof
bool ffw::ImageReader::eof () const
function operator bool
ffw::ImageReader::operator bool () const
Same as isOpen()
function getRowOffset
int ffw::ImageReader::getRowOffset () const
Returns the number of rows already read.
function isOpen
bool ffw::ImageReader::isOpen () const
Returns true if the image file is open and ready for reading.
function getNumOfMipMaps
int ffw::ImageReader::getNumOfMipMaps () const
Returns the number of mipmaps the image contains.
This is usually exactly one unless you are reading a DDS file.
function getMipMapOffset
int ffw::ImageReader::getMipMapOffset () const
Returns the number of mipmaps already read.
function getAllocationSize
size_t ffw::ImageReader::getAllocationSize () const
Returns the number of bytes needed to allocate an array of pixels.
The documentation for this class was generated from the following file: include/ffw/media/imageloader.h