C++ Template Image Processing Library.    

[Introduction]- [News]- [Download]- [Screenshots]- [Tutorial]- [Forums-Eng]- [Forums-Fr]- [Reference]- [SourceForge Repository ]

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

CImgl Struct Template Reference

Class representing list of images CImg<T>. More...

List of all members.

Constructors - Destructor - Copy

 CImgl (const unsigned int n=0, const unsigned int width=0, const unsigned int height=1, const unsigned int depth=1, const unsigned int dim=1)
 Create a list of n new images, each having size (width,height,depth,dim).
CImglassign (const unsigned int n=0, const unsigned int width=0, const unsigned int height=1, const unsigned int depth=1, const unsigned int dim=1)
 In-place version of the previous constructor.
 CImgl (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const T &val)
 Create a list of n new images, each having size (width,height,depth,dim).
CImglassign (const unsigned int n, const unsigned int width, const unsigned int height, const unsigned int depth, const unsigned int dim, const T &val)
 In-place version of previous constructor.
template<typename t>
CImglassign (const unsigned int n, const CImg< t > &img)
 In-place version of previous constructor.
template<typename t>
 CImgl (const CImgl< t > &list)
 Copy constructor.
 CImgl (const CImgl< T > &list)
 Copy constructor (fast version).
template<typename t>
CImglassign (const CImgl< t > &list)
 In-place version of previous constructor.
 CImgl (const char *filename)
 Create a list by loading a file.
 CImgl (const CImg< T > &img)
 Create a list from a single image img.
CImgl assign (const CImg< T > &img)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2)
 Create a list from two images img1 and img2 (images are copied).
CImglassign (const CImg< T > &img1, const CImg< T > &img2)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3)
 Create a list from three images img1,img2 and img3 (images are copied).
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4)
 Create a list from four images img1,img2,img3 and img4 (images are copied).
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5)
 Create a list from five images.
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6)
 Create a list from six images.
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7)
 Create a list from seven images.
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7, const CImg< T > &img8)
 Create a list from eight images.
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7, const CImg< T > &img8)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7, const CImg< T > &img8, const CImg< T > &img9)
 Create a list from nine images.
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7, const CImg< T > &img8, const CImg< T > &img9)
 In-place version of previous constructor.
 CImgl (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7, const CImg< T > &img8, const CImg< T > &img9, const CImg< T > &img10)
 Create a list from ten images.
CImglassign (const CImg< T > &img1, const CImg< T > &img2, const CImg< T > &img3, const CImg< T > &img4, const CImg< T > &img5, const CImg< T > &img6, const CImg< T > &img7, const CImg< T > &img8, const CImg< T > &img9, const CImg< T > &img10)
 In-place version of previous constructor.
template<typename t>
 CImgl (const CImg< t > *const list, const unsigned int nb)
 Create a list from an array of CImg<t>.
 CImgl (const CImg< T > *const list, const unsigned int nb, const bool shared_memory)
 Create a list from an array of CImg<T>.
template<typename t>
CImgloperator= (const CImgl< t > &list)
 Copy constructor.
CImgloperator= (const CImgl< T > &list)
 Assignment constructor (fast version).
 ~CImgl ()
 Destructor.
CImglempty ()
 Empty list.
CImglclear ()
 same as empty()
static const char * pixel_type ()
 Return a string describing the type of the image pixels in the list (template parameter T).
static CImgl get_empty ()
 Get an empty list.

Arithmetics operators

bool is_empty () const
 Return true if list is empty.
template<typename t>
CImgloperator+= (const CImgl< t > &list)
 Add each image of the current list with the corresponding image in the list list.
template<typename t>
CImgloperator-= (const CImgl< t > &list)
 Subtract each image of the current list with the corresponding image in the list list.
CImgloperator+= (const T &val)
 Add each image of the current list with a value val.
CImgloperator-= (const T &val)
 Substract each image of the current list with a value val.
CImgloperator *= (const double val)
 Multiply each image of the current list by a value val.
CImgloperator/= (const double val)
 Divide each image of the current list by a value val.
CImgl operator+ (const T &val) const
 Return a new image list corresponding to the addition of each image of the current list with a value val.
CImgl operator * (const double val) const
 Return a new image list corresponding to the multiplication of each image of the current list by a value val.
CImgl operator- (const T &val) const
 Return a new image list corresponding to the substraction of each image of the current list with a value val.
CImgl operator/ (const double val) const
 Return a new image list corresponding to the division of each image of the current list by a value val.
CImgl operator+ (const CImgl &list) const
 Return a new image list corresponding to the addition of each image of the current list with the corresponding image in the list list.
CImgl operator- (const CImgl &list) const
 Return a new image list corresponding to the substraction of each image of the current list with the corresponding image in the list list.
CImgl operator+ (const T &val, const CImgl &list)
 Return a new image list corresponding to the addition of each image of the current list with a value val;.
CImgl operator * (const double val, const CImgl &list)
 Return a new image list corresponding to the scalar multiplication of each image of the current list by a value val.

List operations

CImg< T > & operator[] (const unsigned int pos)
 Return a reference to the i-th element of the image list.
CImg< T > & operator() (const unsigned int pos)
 Equivalent to CImgl<T>::operator[].
T & operator() (const unsigned int pos, const unsigned int x, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0)
 Return a reference to (x,y,z,v) pixel of the pos-th image of the list.
CImg< T > & at (const unsigned int pos)
 Equivalent to CImgl<T>::operator[], with boundary checking.
CImg< T > & back ()
 Returns a reference to last element.
CImg< T > & front ()
 Returns a reference to the first element.
iterator begin ()
 Returns an iterator to the beginning of the vector.
iterator end ()
 Returns an iterator just past the last element.
CImglinsert (const CImg< T > &img, const unsigned int pos)
 Insert a copy of the image img into the current image list, at position pos.
CImglinsert (const unsigned int n, const CImg< T > &img, const unsigned int pos)
 Insert n copies of the image img into the current image list, at position pos.
CImglinsert (const CImg< T > &img)
 Insert a copy of the image img at the current image list.
CImglinsert (const unsigned int n, const CImg< T > &img)
 Insert n copies of the image img at the end of the list.
CImglpush_back (const CImg< T > &img)
 Insert image img at the end of the list.
CImglpush_front (const CImg< T > &img)
 Insert image img at the front of the list.
CImglinsert (const CImgl< T > &list, const unsigned int pos)
 Insert a copy of the image list list into the current image list, starting from position pos.
CImglinsert (const unsigned int n, const CImgl< T > &list, const unsigned int pos)
 Insert n copies of the list list at position pos of the current list.
CImglinsert (const CImgl< T > &list)
 Append a copy of the image list list at the current image list.
CImglinsert (const unsigned int n, const CImgl< T > &list)
 Insert n copies of the list at the end of the current list.
CImglpush_back (const CImgl< T > &list)
 Insert list list at the end of the current list.
CImglpush_front (const CImgl< T > &list)
 Insert list list at the front of the current list.
CImglremove (const unsigned int pos)
 Remove the image at position pos from the image list.
CImglpop_back ()
 Remove last element of the list;.
CImglpop_front ()
 Remove first element of the list;.
CImglerase (const iterator iter)
 Remove the element pointed by iterator iter;.
CImglremove ()
 Remove the last image from the image list.
CImglreverse ()
 Reverse list order.
CImglget_reverse () const
 Get reversed list.
CImgloperator<< (const CImg< T > &img)
 Insert image at the end of the list.
CImgloperator>> (CImg< T > &img)
 Remove last image of the list.

Fourier transforms

CImglFFT (const char axe, const bool inverse=false)
 Compute the Fast Fourier Transform (along the specified axis).
CImglFFT (const bool inverse=false)
 Compute the Fast Fourier Transform of a complex image.
CImgl< typename cimg::largest<
T, float >::type > 
get_FFT (const bool inverse=false) const
 Return the Fast Fourier Transform of a complex image.
CImgl< typename cimg::largest<
T, float >::type > 
get_FFT (const char axe, const bool inverse=false) const
 Return the Fast Fourier Transform of a complex image (along a specified axis).

IO and display functions

const CImglprint (const char *title=NULL, const int print_flag=1) const
 Print informations about the list on the standard error stream.
CImglload (const char *filename)
 In-place version of load().
CImglload_cimg (const char *filename)
 In-place version of get_load_cimg().
CImglload_parrec (const char *filename)
 In-place version of get_load_parrec().
CImglload_yuv (const char *filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const int last_frame=-1, const bool yuv2rgb=true)
 In-place version of get_load_yuv().
const CImglsave_yuv (const char *filename, const bool rgb2yuv=true) const
 Save an image sequence into a YUV file.
const CImglsave (const char *filename) const
 Save an image list into a file.
const CImglsave_cimg (const char *filename) const
 Save an image list into a CImg RAW file.
template<typename tf, typename tc>
CImglload_off (const char *filename, CImgl< tf > &primitives, CImgl< tc > &colors, const bool invert_faces=false)
 In-place version of get_load_off().
template<typename tf, typename tc>
const CImglsave_off (const char *filename, const CImgl< tf > &primitives, const CImgl< tc > &colors, const bool invert_faces=false) const
 Save an image list into a OFF file.
CImg< T > get_append (const char axe='x', const char align='c') const
 Return a single image which is the concatenation of all images of the current CImgl instance.
const CImgldisplay (CImgDisplay &disp, const char axe='x', const char align='c') const
 Display the current CImgl instance in an existing CImgDisplay window (by reference).
const CImgldisplay (const char *title, const char axe='x', const char align='c', const int min_size=128, const int max_size=1024) const
 Display the current CImgl instance in a new display window.
const CImgldisplay (const char axe='x', const char align='c', const int min_size=128, const int max_size=1024) const
 Display the current CImgl instance in a new display window.
const CImglwait (const unsigned int milliseconds) const
 Same as cimg::wait().
const CImgl get_shared_images (const unsigned int i0, const unsigned int i1) const
 Return a reference to a set of images (I0->I1) of the list.
CImgl get_images (const unsigned int i0, const unsigned int i1) const
 Return a sublist.
static CImgl get_load (const char *filename)
 Load an image list from a file.
static CImgl get_load_cimg (const char *filename)
 Load an image list from a file (.raw format).
static CImgl get_load_parrec (const char *filename)
 Load PAR-REC (Philips) image file.
static CImgl get_load_yuv (const char *filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const int last_frame=-1, const bool yuv2rgb=true)
 Load YUV image sequence.
template<typename tf, typename tc>
static CImgl< T > get_load_off (const char *filename, CImgl< tf > &primitives, CImgl< tc > &colors, const bool invert_faces=false)
 Load from OFF file format.
static CImgl< T > get_font (const unsigned int font_width, const bool variable_size=true)
 Return a CImg pre-defined font with desired size.

Public Types

typedef CImg< T > * iterator
 Define a CImgl<T>::iterator.
typedef const CImg< T > * const_iterator
 Define a CImgl<T>::const_iterator.

Public Attributes

unsigned int size
 This variable represents the number of images in the image list.
const bool shared
 This variable defines if the instance list uses shared memory.
CImg< T > * data
 This variable represents a pointer to the first CImg<T> image of the list.


Detailed Description

template<typename T>
struct cimg_library::CImgl< T >

Class representing list of images CImg<T>.


Member Function Documentation

const CImgl& save const char *  filename  )  const
 

Save an image list into a file.

Depending on the extension of the given filename, a file format is chosen for the output file.

const CImgl& save_cimg const char *  filename  )  const
 

Save an image list into a CImg RAW file.

A CImg RAW file is a simple uncompressed binary file that may be used to save list of CImg<T> images.

Parameters:
filename : name of the output file.
Returns:
A reference to the current CImgl instance is returned.

CImg<T> get_append const char  axe = 'x',
const char  align = 'c'
const
 

Return a single image which is the concatenation of all images of the current CImgl instance.

Parameters:
axe : specify the axe for image concatenation. Can be 'x','y','z' or 'v'.
align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
Returns:
A CImg<T> image corresponding to the concatenation is returned.

static CImgl<T> get_font const unsigned int  font_width,
const bool  variable_size = true
[static]
 

Return a CImg pre-defined font with desired size.

Parameters:
font_height = height of the desired font (can be 11,13,24,38 or 57)
fixed_size = tell if the font has a fixed or variable width.

const CImgl& display CImgDisplay disp,
const char  axe = 'x',
const char  align = 'c'
const
 

Display the current CImgl instance in an existing CImgDisplay window (by reference).

This function displays the list images of the current CImgl instance into an existing CImgDisplay window. Images of the list are concatenated in a single temporarly image for visualization purposes. The function returns immediately.

Parameters:
disp : reference to an existing CImgDisplay instance, where the current image list will be displayed.
axe : specify the axe for image concatenation. Can be 'x','y','z' or 'v'.
align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
Returns:
A reference to the current CImgl instance is returned.

const CImgl& display const char *  title,
const char  axe = 'x',
const char  align = 'c',
const int  min_size = 128,
const int  max_size = 1024
const
 

Display the current CImgl instance in a new display window.

This function opens a new window with a specific title and displays the list images of the current CImgl instance into it. Images of the list are concatenated in a single temporarly image for visualization purposes. The function returns when a key is pressed or the display window is closed by the user.

Parameters:
title : specify the title of the opening display window.
axe : specify the axe for image concatenation. Can be 'x','y','z' or 'v'.
align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
min_size : specify the minimum size of the opening display window. Images having dimensions below this size will be upscaled.
max_size : specify the maximum size of the opening display window. Images having dimensions above this size will be downscaled.
Returns:
A reference to the current CImgl instance is returned.

const CImgl& display const char  axe = 'x',
const char  align = 'c',
const int  min_size = 128,
const int  max_size = 1024
const
 

Display the current CImgl instance in a new display window.

This function opens a new window and displays the list images of the current CImgl instance into it. Images of the list are concatenated in a single temporarly image for visualization purposes. The function returns when a key is pressed or the display window is closed by the user.

Parameters:
axe : specify the axe for image concatenation. Can be 'x','y','z' or 'v'.
align : specify the alignment for image concatenation. Can be 'p' (top), 'c' (center) or 'n' (bottom).
min_size : specify the minimum size of the opening display window. Images having dimensions below this size will be upscaled.
max_size : specify the maximum size of the opening display window. Images having dimensions above this size will be downscaled.
Returns:
A reference to the current CImgl instance is returned.

const CImgl& wait const unsigned int  milliseconds  )  const
 

Same as cimg::wait().

See also:
cimg::wait().


Member Data Documentation

unsigned int size
 

This variable represents the number of images in the image list.

Note:
if size==0, the image list is empty.
The CImg Library - C++ Template Image Processing Library