Modules

Image Library
[Basic Media Libraries]

This is a basic library for the reading (not necessarily writing!) of images. More...

Collaboration diagram for Image Library:

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 (nstream::Manager *mgr,const char *name,image_t &image)
 use this nstream-based routine to load images (see Named Stream Management).

Detailed Description

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";

Function Documentation

bool media::loadImage ( nstream::Manager mgr,
const char *  name,
image_t &  image 
)

use this nstream-based routine to load images (see Named Stream Management).