Simple Image Loading LibrarY Documentation


The Simple Image Loading LibrarY is a compagnion library of the CEGUI project. This library released under MIT aims at providing a simple and easy to use library for image loading.

At the time being it supports the following image format:

The 0.1.0 release does not support any palettized version.

The library rests on third party library :

In order to help you getting started with the library, the following example shows how to load an image from a memory area. In order to load an image one need to know only a few class : SILLY::MemoryDataSource which is an adaptator around a memory area and SILLY::Image

   SILLY::SILLYInit(); // Init the library

   SILLY::byte* rawData;
   // set rawData with whatever pleased you (an image should be perfect ;p) 
   // We assume here that rawData is set to a memory area of dataSize bytes. 

   // Create the data source of the image 
   SILLY::MemoryDataSource mds(rawData, dataSize);

   // You can also use a FileDataSource for the image : 
   // SILLY::FileDataSource mds(filename);

   // Create the image object 
   SILLY::Image img(mds);
   // Load the image header 
   if (!img.loadImageHeader())
      // It's an error, the data does not corresponds to an image 
      // or the image data are not supported by SILLY 
      // return/exit/abort/throw ... 
   std::cout << "Image Loader: " << img.getLoaderIdentifierString() << std::endl
             << "Width: " << img.getWidth() << std::endl
             << "Height: " << img.getHeight() << std::endl;
   // Load the content of the image (pixels) 
   // Here we want the image data to be stored in memory using 
   // RGBA and the first line of the image to be stored first 
   if (!img.loadImageData(SILLY::PF_RGBA, SILLY::PO_TOP_LEFT))
       // loading of the image data failed 
       // return/exit/abort/throw
   // Return a pointer to a byte array containing the 
   // pixels stored as RGBA 
   // Get the size of the pixel array 
   SILLY::SILLYCleanup(); // Free all memory used by the library 

Generated on Sun Apr 6 14:47:06 2008 for Simple Image Loading LibrarY by  doxygen 1.5.2