The C++ Template Image Processing Library.
Initially developped in the Odyssée Lab, at the INRIA-Sophia Antipolis.

[Introduction]- [Latest News]- [Download]- [Screenshots]- [Tutorial]- [Forums]- [Library Reference]- [SourceForge Repository ]

Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Library structure.

The CImg Library only consists in one header file CImg.h, containing all the classes and functions that compose the library. It is organized as follows :

A CImg image is defined as a template class CImg<T> containing a pixel data field with a maximum of 4 dimensions : the 3 first dimensions are usually used to describe the spatial coordinates (x,y,z) in the image, while the last one is often used as a vector-valued pixel dimension (color channel for instance). Then, this class can handle the case of 3D volumes of vector-valued pixels, and all images that requires less dimensions (gray-valued or color 2D images for instance). It also means that (almost) all member functions of the class CImg<T> are designed to handle the maximum case of these (3+1) dimensions.

Moreover, the pixel type is given by the template parameter T, which means that you can define images with different pixel types T. Fully supported template types are the basic C++ types : unsigned char, char, short, unsigned int, int, float, double, ... Using your own template types is possible however, but you will have to redefine the complete set of arithmetic and logical operators. Typically, fast image display would be done using CImg<uchar> images, while complex image processing algorithms would be coded using CImg<float> or CImg<double> images which have floating-point pixel values. Only two others classes are defined in the CImg.h file : CImgStats that is used to represent image statistics, and CImgDisplay used to open windows where images are displayed, and handle keyboard and mouse events.

CImg has been designed to be 'user-friendly', meaning that the underlying structure of the classes is always quite basic to understand. For instance, the CImg<T> class members (which are defined as public) are only the dimensions width, height, depth, dim, and the pixel data data. Very useful when you want to access the raw pixel buffer for calling with functions of other libraries, or when you want to convert your raw data buffer into a CImg, in order to visualize it for instance. Moreover, most of the classical arithmetic and logical operators have been redefined in the CImg<T> class, which means that accessing a pixel is as simple as image(x,y) or image(x,y,z,v) (in 4D), and beautiful things are possible such as (img1+3*img2).display();

All the functions and classes are defined in a single header file CImg.h. This sounds strange, but it is actually one of the major advantage of the CImg library :

CImg<>, CImgl<>, CImgDisplay, CImgStats : That's the only four classes you have to know in order to use the CImg library !

Finally, a lot of examples are provided in the CImg package that demonstrate how to use the library. Please take some time to look at it. It will surely teaches you a lot of things about using functions and classes of the CImg Library.
You can also look at Tutorial : Getting started., which gives you a step-by-step explanation of a working program.


Generated on Tue Aug 10 17:35:47 2004 for The CImg Library by doxygen 1.3.8