Difference between revisions of "SILLY"
m |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 21: | Line 21: | ||
* '''License''': MIT | * '''License''': MIT | ||
|width="50%" valign="top"| | |width="50%" valign="top"| | ||
− | == Roadmap == | + | == Roadmap == |
− | === 0.1.X === | + | === 0.1.X === |
* Initial release | * Initial release | ||
− | === 0.2.X === | + | === 0.2.X === |
* Support for more pixel format | * Support for more pixel format | ||
* Better error reporting | * Better error reporting | ||
Line 32: | Line 32: | ||
* Gif support | * Gif support | ||
|} | |} | ||
− | == User Manual == | + | == User Manual == |
This is a quick manual for using SILLY it is not an intent to replace the API documentation provided by doxygen. This paragraph list some generalities on SILLY and its usage. First all symbol object defined in SILLY are contained in the SILLY namespace. I recommand the use of the complete name each time its needed instead of the ''using namespace'' construction. SILLY design make heavly used of the RAII concept and thus you will probably never need to explicitly allocate or release any memory when using SILLY. In order to use SILLY simply #include <SILLY.h> | This is a quick manual for using SILLY it is not an intent to replace the API documentation provided by doxygen. This paragraph list some generalities on SILLY and its usage. First all symbol object defined in SILLY are contained in the SILLY namespace. I recommand the use of the complete name each time its needed instead of the ''using namespace'' construction. SILLY design make heavly used of the RAII concept and thus you will probably never need to explicitly allocate or release any memory when using SILLY. In order to use SILLY simply #include <SILLY.h> | ||
Line 39: | Line 39: | ||
When using windows you should use [http://premake.sourceforge.net/ premake] to create the solution for MSVC. | When using windows you should use [http://premake.sourceforge.net/ premake] to create the solution for MSVC. | ||
==== Linux ==== | ==== Linux ==== | ||
− | Under linux premake could probably be used as but the prefered method | + | Under linux premake could probably be used as but the prefered method is configure script. |
./configure | ./configure | ||
make | make | ||
make install (as root) | make install (as root) | ||
− | === Initialisation=== | + | === Initialisation === |
In order to use SILLY one must initialise the library. This is required in order to load all image loader object in memory. You also have to do some cleanup once you finished using SILLY. You can call several time SILLYInit / SILLYCleanup. | In order to use SILLY one must initialise the library. This is required in order to load all image loader object in memory. You also have to do some cleanup once you finished using SILLY. You can call several time SILLYInit / SILLYCleanup. | ||
− | < | + | <source lang="cpp"> |
− | + | ||
SILLY::SILLYInit(); | SILLY::SILLYInit(); | ||
// Code using SILLY library | // Code using SILLY library | ||
SILLY::SILLYCleanup(); | SILLY::SILLYCleanup(); | ||
− | </ | + | </source> |
=== DataSource === | === DataSource === | ||
To load an image you need to tell SILLY where the image data is located. This is the role of the DataSource abstract class. SILLY comes with two implementation of this abstraction. FileDataSource class load an image from a file on disk. The content of the file is loaded in memory in the constructor. You have to check wether the operation succeded using the isValid methode. | To load an image you need to tell SILLY where the image data is located. This is the role of the DataSource abstract class. SILLY comes with two implementation of this abstraction. FileDataSource class load an image from a file on disk. The content of the file is loaded in memory in the constructor. You have to check wether the operation succeded using the isValid methode. | ||
− | < | + | <source lang="cpp"> |
− | + | ||
// Example using SILLY::FileDataSource object | // Example using SILLY::FileDataSource object | ||
SILLY::SILLYInit(); | SILLY::SILLYInit(); | ||
Line 67: | Line 65: | ||
} | } | ||
SILLY::SILLYCleanup(); | SILLY::SILLYCleanup(); | ||
− | </ | + | </source> |
The second DataSource concrete class is called MemoryDataSource. It provides a wrapper around a previously allocated chunk of memory that is supposed to contain a valid image. A MemoryDataSource object does not need validation because the constructor of the DataSource can't failed. SILLY does not take the ownership of the memory and does not modify this memory. You are responsible of allocating and freeing the memory. | The second DataSource concrete class is called MemoryDataSource. It provides a wrapper around a previously allocated chunk of memory that is supposed to contain a valid image. A MemoryDataSource object does not need validation because the constructor of the DataSource can't failed. SILLY does not take the ownership of the memory and does not modify this memory. You are responsible of allocating and freeing the memory. | ||
− | + | ||
− | <cpp | + | <source lang="cpp"> |
// Example using SILLY::MemoryDataSource object | // Example using SILLY::MemoryDataSource object | ||
SILLY::SILLYInit(); | SILLY::SILLYInit(); | ||
Line 77: | Line 75: | ||
// Load the image | // Load the image | ||
SILLY::SILLYCleanup(); | SILLY::SILLYCleanup(); | ||
− | </ | + | </source> |
− | ==== Image class ==== | + | |
+ | ==== Image class ==== | ||
==== Extending SILLY ==== | ==== Extending SILLY ==== | ||
===== ImageLoader and ImageContext ===== | ===== ImageLoader and ImageContext ===== | ||
===== ImageLoaderManager ===== | ===== ImageLoaderManager ===== | ||
+ | |||
+ | [[Category:WIP]] |
Latest revision as of 14:33, 4 March 2011
Contents
Introduction
SILLY means Simple Image Loading LibrarY. The aim of this library is to provide a simple library for loading image in the context of CEGUI. The library supports only the most common image format. The project was initialy launch in order to provide an MIT based replacement of DevIL with less image format supported and focused on loading image only.
Features
|
Roadmap0.1.X
0.2.X
|
User Manual
This is a quick manual for using SILLY it is not an intent to replace the API documentation provided by doxygen. This paragraph list some generalities on SILLY and its usage. First all symbol object defined in SILLY are contained in the SILLY namespace. I recommand the use of the complete name each time its needed instead of the using namespace construction. SILLY design make heavly used of the RAII concept and thus you will probably never need to explicitly allocate or release any memory when using SILLY. In order to use SILLY simply #include <SILLY.h>
Installation notes
Windows
When using windows you should use premake to create the solution for MSVC.
Linux
Under linux premake could probably be used as but the prefered method is configure script.
./configure make make install (as root)
Initialisation
In order to use SILLY one must initialise the library. This is required in order to load all image loader object in memory. You also have to do some cleanup once you finished using SILLY. You can call several time SILLYInit / SILLYCleanup.
SILLY::SILLYInit(); // Code using SILLY library SILLY::SILLYCleanup();
DataSource
To load an image you need to tell SILLY where the image data is located. This is the role of the DataSource abstract class. SILLY comes with two implementation of this abstraction. FileDataSource class load an image from a file on disk. The content of the file is loaded in memory in the constructor. You have to check wether the operation succeded using the isValid methode.
// Example using SILLY::FileDataSource object SILLY::SILLYInit(); SILLY::FileDataSource source("filename"); if (source.isValid()) { // Load the image } SILLY::SILLYCleanup();
The second DataSource concrete class is called MemoryDataSource. It provides a wrapper around a previously allocated chunk of memory that is supposed to contain a valid image. A MemoryDataSource object does not need validation because the constructor of the DataSource can't failed. SILLY does not take the ownership of the memory and does not modify this memory. You are responsible of allocating and freeing the memory.
// Example using SILLY::MemoryDataSource object SILLY::SILLYInit(); SILLY::MemoryDataSource source(buffer, bufferSize); // Load the image SILLY::SILLYCleanup();