This is a basic library for the reading (not necessarily writing!) of images. More...
Modules | |
Base Image Library | |
This library is used only by clients that are writing an image loader. | |
JPEG Library | |
My own image loader for jpeg files. | |
| |
bool | media::loadImage (IN nstream::Manager *mgr, IN const char *name, OUT image_t &image) |
use this nstream-based routine to load images (see Named Stream Management). |
This is a basic library for the reading (not necessarily writing!) of images.
This library just declares a generic image type, which is common to all formats (JPG, PNG, BMP, etc.). Callers can use this API to read images.
The main use case is to call loadImage() with a path, and then this library will load the image and return it to you. Then you can work with the generic image_t object, regardless of the actual format of the persisted image.
For instance, if you want to load an image from a local file, you would use code like this:
smart_ptr<nstream::Manager> fsManager = nstream::getFilesystemManager("/my/home/directory"); media::image_t image; if (!media::loadImage(fsManager, "some/cool/image.jpg", image)) { throw "I couldn't load the image!"; } std::cout << "I just read an image that is " << image.width; std::cout << " pixels wide.\n";
bool media::loadImage | ( | IN nstream::Manager * | mgr, | |
IN const char * | name, | |||
OUT image_t & | image | |||
) |
use this nstream-based routine to load images (see Named Stream Management).