34 #include "SILLYImage.h" 36 #ifndef SILLY_OPT_INLINE 38 #include "SILLYImage.icpp" 41 #include "SILLYImageLoaderManager.h" 49 : d_bpp(0), d_pixels(0), d_data(&source), d_imageContext(0), d_imageLoader(0)
56 ImageLoaderList::iterator iter = ImageLoaderManager::getSingleton().begin();
57 for (; ! d_imageLoader && iter != ImageLoaderManager::getSingleton().end() ; ++iter)
59 d_imageContext = (*iter)->loadHeader(d_pfSource, d_data);
61 d_imageLoader = (*iter);
63 assert((! d_imageLoader || d_imageContext) &&
"ASSERT: Internal state of image invalid");
64 return d_imageLoader != 0;
92 if (! d_imageLoader->
loadImageData(order, d_data, d_imageContext))
100 bool Image::allocate()
105 return d_pixels != 0;
PixelFormat
List all pixel format supported.
size_t getHeight() const
Retrieve the height of the image.
size_t getWidth() const
Retrieve the width of the image.
bool loadImageHeader()
Retrieve the information concerning the image object.
Image(DataSource &data)
Constructor.
unsigned char byte
Typename for a byte.
void setDestination(byte *pixels, size_t length, PixelFormat format)
Set the destination of the loading.
PixelOrigin
List all pixel origin supported.
virtual bool loadImageData(PixelOrigin origin, DataSource *data, ImageContext *context)=0
Parse the pixels data of the image and fill the header struct.
bool loadImageData(PixelFormat resultFormat=PF_RGBA, PixelOrigin origin=PO_TOP_LEFT)
Load the image pixels in memory and store them in resultFormat.
Simple Image Loading LibrarY namespace.
This is an abstract class used to provide data to the loader.