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

CImg< T > Struct Template Reference

The basic CImg class, representing images, with pixels of type T. More...

Inherited by CImgROI< T >.

List of all members.

Constructors - Destructor - Copy

 CImg (const uint dx=0, const uint dy=1, const uint dz=1, const uint dv=1)
 Create an image of size (dx,dy,dz,dv) with pixels of type T.
 CImg (const uint dx, const uint dy, const uint dz, const uint dv, const T &val)
 Create an image of size (dx,dy,dz,dv) with pixels of type T, and fill the image with the value val.
template<typename t>  CImg (const CImg< t > &img, const bool pixel_copy)
 Copy constructor. If pixel_copy=false, the pixel data are not copied.
template<typename t>  CImg (const CImg< t > &img)
 Copy constructor.
 CImg (const CImg &img, const bool pixel_copy)
 Copy constructor (optimized for same pixel types). If pixel_copy=false, the pixel data are not copied.
 CImg (const CImg< T > &img)
 Copy constructor (optimized for same pixel types).
 CImg (const char *filename)
 Create an image by reading a filename.
 CImg (const T *const data_buffer, uint dx=1, uint dy=1, uint dz=1, uint dv=1)
 Create an image from a data buffer.
 ~CImg ()
 Destructor.

Arithmetics and Boolean Operators

template<typename t> CImg< T > & operator= (const CImg< t > &img)
 Operator=.
CImgoperator= (const CImg &img)
 Operator=.
CImgoperator= (const T &val)
 Operator=.
CImgoperator= (const T *buf)
 Operator=. Assign the value of each pixel of the current instance with the values of the given buffer buf. Note that buf must have at least the size of the current instance.
template<typename t> CImgoperator+= (const CImg< t > &img)
 Operator+=.
template<typename t> CImgoperator-= (const CImg< t > &img)
 Operator-=.
CImgoperator%= (const T &val)
 Operator%=.
CImgoperator+= (const T &val)
 Operator+=.
CImgoperator-= (const T &val)
 Operator-=.
CImgoperator *= (const double val)
 Operator*=.
CImgoperator/= (const double val)
 Operator/=.
CImg operator% (const T &val) const
 Operator%.
CImg operator+ (const T &val) const
 Operator+.
CImg operator- (const T &val) const
 Operator-.
CImg operator * (const double val) const
 Operator*.
CImg operator/ (const double val) const
 Operator/.
CImg operator+ (const CImg &img) const
 Operator+.
CImg operator- (const CImg &img) const
 Operator-.
template<typename t> const bool operator== (const CImg< t > &img) const
 Operator==.
template<typename t> const bool operator!= (const CImg< t > &img) const
 Operator!=.
template<typename t> CImgoperator &= (const CImg< t > &img)
 Operator&= (bitwise AND).
template<typename t> CImg operator & (const CImg< t > &img) const
 Operator& (bitwise AND).
template<typename t> CImgoperator|= (const CImg< t > &img)
 Operator|= (bitwise OR).
template<typename t> CImg operator| (const CImg< t > &img) const
 Operator| (bitwise OR).
template<typename t> CImgoperator^= (const CImg< t > &img)
 Operator^= (bitwise XOR).
template<typename t> CImg operator^ (const CImg< t > &img) const
 Operator^ (bitwise XOR).
template<typename t> CImgpmul (const CImg< t > &img)
 Replace the image by the pointwise multiplication between *this and img.
template<typename t> CImg get_pmul (const CImg< t > &img) const
 Return an image from a pointwise multiplication between *this and img.
template<typename t> CImgpdiv (const CImg< t > &img)
 Replace the image by the pointwise division between *this and img.
template<typename t> CImg get_pdiv (const CImg< t > &img) const
 Return an image from a pointwise division between *this and img.
template<typename t> CImgmax (const CImg< t > &img)
 Replace the image by the pointwise max operator between *this and img.
template<typename t> CImg get_max (const CImg< t > &img) const
 Return the image corresponding to the max value for each pixel.
template<typename t> CImgmin (const CImg< t > &img)
 Replace the image by the pointwise min operator between *this and img.
template<typename t> CImg get_min (const CImg< t > &img) const
 Return the image corresponding to the min value for each pixel.
CImgsqrt ()
 Replace each image pixel by its square root.
CImg get_sqrt () const
 Return the image of the square root of the pixel values.
CImgpow (const double p)
 Replace each image pixel by its power by p.
CImg get_pow (const double p) const
 Return the image of the square root of the pixel values.
CImgabs ()
 Replace each pixel value by its absolute value.
CImg get_abs () const
 Return the image of the absolute value of the pixel values.
CImgcos ()
 Replace each image pixel by its cosinus.
CImg get_cos () const
 Return the image of the cosinus of the pixel values.
CImgsin ()
 Replace each image pixel by its sinus.
CImg get_sin () const
 Return the image of the sinus of the pixel values.
CImgtan ()
 Replace each image pixel by its tangent.
CImg get_tan () const
 Return the image of the tangent of the pixel values.
CImg operator+ (const T &val, const CImg &img)
 Operator+.
CImg operator * (const double val, const CImg &img)
 Operator*.
CImg operator- (const T &val, const CImg &img)
 Operator-.

Access to image dimensions and pixel values

const uint size () const
 Return the total number of pixels of an image (i.e. width*height*depth*dim).
const int dimx () const
 Return the width of the image (i.e. the field width).
const int dimy () const
 Return the height of the image (i.e. the field height).
const int dimz () const
 Return the depth of the image (i.e. the field depth).
const int dimv () const
 Return the vector dimension of the image (i.e. the field dim).
const int offset (const int x=0, const int y=0, const int z=0, const int v=0) const
 Return an offset corresponding to the location of the pixel value located at (x,y,z,v) with respect to the pixel data pointer data.
T * ptr (const uint x=0, const uint y=0, const uint z=0, const uint v=0) const
 Return a pointer to the pixel value located at (x,y,z,v).
T & operator() (const uint x, const uint y=0, const uint z=0, const uint v=0) const
 Pixel access (without boundary checking, unless cimg_debug=2).
T & operator[] (const uint off) const
 Buffer access (without boundary checking, unless cimg_debug=2).
dirichlet_pix4d (const int x, const int y=0, const int z=0, const int v=0, const T out_val=(T) 0) const
 Pixel access with Dirichlet boundary conditions.
dirichlet_pix3d (const int x, const int y=0, const int z=0, const int v=0, const T out_val=(T) 0) const
 Pixel access with Dirichlet boundary conditions.
dirichlet_pix2d (const int x, const int y=0, const int z=0, const int v=0, const T out_val=(T) 0) const
 Pixel access with Dirichlet boundary conditions.
dirichlet_pix1d (const int x, const int y=0, const int z=0, const int v=0, const T out_val=(T) 0) const
 Pixel access with Dirichlet boundary conditions.
const T & neumann_pix4d (const int x, const int y=0, const int z=0, const int v=0) const
 Pixel access with Neumann boundary conditions.
const T & neumann_pix3d (const int x, const int y=0, const int z=0, const int v=0) const
 Pixel access with Neumann boundary conditions.
const T & neumann_pix2d (const int x, const int y=0, const int z=0, const int v=0) const
 Pixel access with Neumann boundary conditions.
const T & neumann_pix1d (const int x, const int y=0, const int z=0, const int v=0) const
 Pixel access with Neumann boundary conditions.
double linear_pix4d (const float ffx, const float ffy=0, const float ffz=0, const float ffv=0) const
 Pixel access with Neumann boundary conditions and linear interpolation.
double linear_pix3d (const float ffx, const float ffy=0, const float ffz=0, const int v=0) const
 Pixel access with Neumann boundary conditions and linear interpolation.
double linear_pix2d (const float ffx, const float ffy=0, const int z=0, int v=0) const
 Pixel access with Neumann boundary conditions and linear interpolation.
double linear_pix1d (const float ffx, const int y=0, const int z=0, int v=0) const
 Pixel access with Neumann boundary conditions and linear interpolation.
double cubic_pix2d (const float pfx, const float pfy=0, const int z=0, int v=0) const
 Pixel access with Neumann boundary conditions and cubic interpolation.
double cubic_pix1d (const float pfx, const int y=0, const int z=0, int v=0) const
 Pixel access with Neumann boundary conditions and cubic interpolation.
CImgStats stats (const bool compute_variance=true) const
 Compute and return statistics on the image.
const CImgprint (const char *title=NULL, const uint print_flag=1) const
 Print image information on the standart error output.
const CImgprint (const uint print_flag) const
 Same as above, without the first parameter.
const char * pixel_type ()
 Return a string describing the type of the image pixels (template parameter T).

Basic Image Transformation

CImgfill (const T &val0=(T) 0)
 Fill all pixel values with value val.
CImgfill (const T &val0, const T &val1)
 Fill sequentially all pixel values with values val0 and val1.
CImgfill (const T &val0, const T &val1, const T &val2)
 Fill sequentially all pixel values with values val0 and val1 and val2.
CImgfill (const T &val0, const T &val1, const T &val2, const T &val3)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3.
CImgfill (const T &val0, const T &val1, const T &val2, const T &val3, const T &val4)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and val4.
CImgfill (const T &val0, const T &val1, const T &val2, const T &val3, const T &val4, const T &val5)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and val4 and val5.
CImgfill (const T &val0, const T &val1, const T &val2, const T &val3, const T &val4, const T &val5, const T &val6, const T &val7, const T &val8)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val8.
CImgfill (const T &val0, const T &val1, const T &val2, const T &val3, const T &val4, const T &val5, const T &val6, const T &val7, const T &val8, const T &val9, const T &val10, const T &val11)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val11.
CImgfill (const T &val0, const T &val1, const T &val2, const T &val3, const T &val4, const T &val5, const T &val6, const T &val7, const T &val8, const T &val9, const T &val10, const T &val11, const T &val12, const T &val13, const T &val14, const T &val15)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val15.
CImgnormalize (const T &a, const T &b)
 Linear normalization of the pixel values between a and b.
CImg get_normalize (const T &a, const T &b) const
 Return the image of normalized values.
CImgcut (const T &a, const T &b)
 Cut pixel values between a and b.
CImg get_cut (const T &a, const T &b) const
 Return the image of cutted values.
CImgquantify (const uint n=256)
 Quantify pixel values into
levels.
CImg get_quantify (const uint n=256) const
 Return a quantified image, with
levels.
CImgthreshold (const T &thres)
 Threshold the image.
CImg get_threshold (const T &thres) const
 Return a thresholded image.
CImg get_rotate (const float angle, const float pcx, const float pcy, const float zoom=1, const uint pcond=5) const
 Return a rotated image.
CImg get_rotate (const float angle, const uint cond=5) const
 Return a rotated image.
CImgrotate (const float angle, const float cx, const float cy, const float zoom=1, const uint cond=5)
 Rotate the image.
CImgrotate (const float angle, const uint cond=5)
 Rotate the image.
CImg get_rotate90 (const bool resize_flag=true)
 Return a rotated image, with an angle of 90 degrees.
CImg get_rotate270 (const bool resize_flag=true)
 Return a rotated image, with an angle of 270 degrees.
CImgrotate90 (const bool resize_flag=true)
 Rotate the image, with an angle of 90 degrees.
CImgrotate270 (const bool resize_flag=true)
 Rotate the image, with an angle of 270 degrees.
CImgrotate180 ()
 Rotate the image, with an angle of 180 degrees.
CImg get_rotate180 ()
 Return a rotated image, with an angle of 180 degrees.
CImg get_resize (const int pdx=-100, const int pdy=-100, const int pdz=-100, const int pdv=-100, const uint interp=1) const
 Return a resized image.
Parameters pdx, pdy, pdz, pdv sets the new size along each of the axes x,y,z and v. If negative, it corresponds to a percentage of the original size (the default value is -100).
Parameter interp sets the interpolation type (0=no interpolation, 1=bloc, 2=mosaic, 3=linear, 4=grid, 5=cubic).
CImg get_resize (const CImg &src, const uint interp=1) const
 Return a resized image.
CImgresize (const int pdx=-100, const int pdy=-100, const int pdz=-100, const int pdv=-100, const uint interp=1)
 Resize the image.
CImgresize (const CImg &src, const uint interp=1)
 Resize the image.
CImg get_resize_halfXY () const
 Return an half-resized image, using a special filter.
CImgresize_halfXY ()
 Half-resize the image, using a special filter.
CImg get_sprite (const uint x0, const uint y0, const uint z0, const uint v0, const uint x1, const uint y1, const uint z1, const uint v1) const
 Return a square region of the image, as a new image.
CImg get_sprite (const uint x0, const uint y0, const uint z0, const uint x1, const uint y1, const uint z1) const
 Return a square region of the image, as a new image.
CImg get_sprite (const uint x0, const uint y0, const uint x1, const uint y1) const
 Return a square region of the image, as a new image.
CImg get_sprite (const uint x0, const uint x1) const
 Return a square region of the image, as a new image.
CImgsprite (const uint x0, const uint y0, const uint z0, const uint v0, const uint x1, const uint y1, const uint z1, const uint v1)
 Replace the image by a square region of the image.
CImgsprite (const uint x0, const uint y0, const uint z0, const uint x1, const uint y1, const uint z1)
 Replace the image by a square region of the image.
CImgsprite (const uint x0, const uint y0, const uint x1, const uint y1)
 Replace the image by a square region of the image.
CImgsprite (const uint x0, const uint x1)
 Replace the image by a square region of the image.
CImg get_channel (const uint v0=0) const
 Get the channel v of the current image, as a new image.
CImg get_slice (const uint z0=0) const
 Get the z-slice z of *this, as a new image.
CImg get_plane (const uint z0=0, const uint v0=0) const
 Get the z-slice z of the channel v of the current image, as a new image.
CImgROI< T > ref_pointset (const uint xmin, const uint xmax, const uint y0=0, const uint z0=0, const uint v0=0) const
 Return a reference to a set of points (x0->x1,y0,z0,v0) of the image. Use it carefully !
CImgROI< T > ref_lineset (const uint ymin, const uint ymax, const uint z0=0, const uint v0=0) const
 Return a reference to a set of lines (y0->y1,z0,v0) of the image. Use it carefully !
CImgROI< T > ref_planeset (const uint zmin, const uint zmax, const uint v0=0) const
 Return a reference to a set of planes (z0->z1,v0) of the image. Use it carefully !
CImgROI< T > ref_channelset (const uint vmin, const uint vmax) const
 Return a reference to a set of channels (v0->v1) of the image. Use it carefully !
CImgROI< T > ref_line (const uint y0, const uint z0=0, const uint v0=0) const
 Return a reference to a line (y0,z0,v0) of the image. Use it carefully !
CImgROI< T > ref_plane (const uint z0, const uint v0=0) const
 Return a reference to a plane (z0,v0) of the image. Use it carefully !
CImgROI< T > ref_channel (const uint v0) const
 Return a reference to a channel (v0) of the image. Use it carefully !
CImgchannel (const uint v0=0)
 Replace the image by one of its channel.
CImgslice (const uint z0=0)
 Replace the image by one of its z-slice.
CImgplane (const uint z0=0, const uint v0=0)
 Replace the image by one of its plane.
CImgflip (const char axe='x')
 Flip an image along the specified axis.
CImg get_flip (const char axe='x')
 Get a flipped version of the image, along the specified axis.
CImg get_3dplanes (const uint px0, const uint py0, const uint pz0) const
 Return a 2D representation of a 3D image, with three slices.
CImg< float > get_histogram (const uint nblevels=256, const float pvmin=0, const float pvmax=0) const
 Return the histogramm of the image.
CImgequalize_histogram (const uint nblevels=256)
 Equalize the image histogram.
CImg get_equalize_histogram (const uint nblevels=256) const
 Return the histogram-equalized version of the current image.
CImg< float > get_norm_pointwise (int ntype=2) const
 Return the image of the vector norms of the current image.
CImgnorm_pointwise ()
 Replace each pixel value with its vector norm.
CImg get_orient_pointwise () const
 Return an image of the normalized vectors.
CImgorient_pointwise ()
 Replace each pixel value with its normalized vector component.
CImgl< T > get_split (const char Axe='v') const
 Return a list of images, corresponding to a split of the current image into a specific axis.
CImgl< T > get_gradientXY (const int scheme=0) const
 Return a list of images, corresponding to the XY-gradients of an image.
CImgl< T > get_gradientXYZ (const int scheme=0) const
 Return a list of images, corresponding to the XYZ-gradients of an image.
CImg get_dilate (const uint n=1)
 Return a dilated image (times dilatation).
CImgdilate (const uint n=1)
 Dilate the image n times.
CImg get_erode (const uint n=1)
 Return an eroded image (times erosion).
CImgerode (const uint n=1)
 Erode the image n times.

Color conversion functions

CImgRGBtoXYZ ()
 Convert (R,G,B) pixels of a color image into the (X,Y,Z)_709 color space.
CImg get_RGBtoXYZ () const
 Get a new image with (X,Y,Z) color-based pixels from a (R,G,B) image.
CImgXYZtoRGB ()
 Convert (X,Y,Z)_709 pixels of a color image into the (R,G,B) color space.
CImg get_XYZtoRGB () const
 Get a new image with (R,G,B) color-based pixels from a (X,Y,Z) image.
CImgXYZtoLab ()
 Convert (X,Y,Z)_709 pixels of a color image into the (L*,a*,b*) color space.
CImg get_XYZtoLab () const
 Get a new image with (L,a,b) color-based pixels from a (X,Y,Z) image.

Drawing functions

CImgdraw_image (const CImg &sprite, const int px0=0, const int py0=0, const int pz0=0, const int pv0=0, const float opacity=1)
 Draw a CImg<t> 'sprite' in the current image, at specified position (x0,y0,z0,v0).
template<class t> CImgdraw_image (const CImg &sprite, const CImg< t > &mask, const int px0=0, const int py0=0, const int pz0=0, const int pv0=0)
 same as draw_image, with a transparency mask (CImg with values between [0,1])
CImgdraw_line (const int px0, const int py0, const int px1, const int py1, const T *color)
 Draw a line (px0,py0)-(px1,py1) in a 2D image, with a color color.
CImgdraw_line (const int px0, const int py0, const int px1, const int py1, const CImg &texture, const int ptx0, const int pty0, const int ptx1, const int pty1)
 Draw a textured line (px0,py0)-(px1,py1) in a 2D image, with a texture texture.
CImgdraw_line (const int px0, const int py0, const int px1, const int py1, const T *color, const uint phatch)
 Draw an hatched line (px0,py0)-(px1,py1) in a 2D image, with a color color.
CImgdraw_line (const int px0, const int py0, const int pz0, const int px1, const int py1, const int pz1, const T *color)
 Draw a line (px0,py0,pz0)-(px1,py1,pz1) in a 3D volume, with a color color.
CImgdraw_triangle (const int px0, const int py0, const int px1, const int py1, const int px2, const int py2, const T *color)
 Draw a filled triangle (px0,py0)-(px1,py1)-(px2,py2) in a 2D image, with a color color.
CImgdraw_triangle (const int px0, const int py0, const int px1, const int py1, const int px2, const int py2, const CImg &texture, const int ptx0, const int pty0, const int ptx1, const int pty1, const int ptx2, const int pty2)
 Draw a textured triangle in a 2D image.
CImgdraw_triangle (const int px0, const int py0, const int px1, const int py1, const int px2, const int py2, const CImg &texture, const int ptx0, const int pty0, const int ptx1, const int pty1, const int ptx2, const int pty2, const CImg &motif, const int pmx0, const int pmy0, const int pmx1, const int pmy1, const int pmx2, const int pmy2, const float tweight, const float mweight)
 Draw a bi-textured triangle in a 2D image.
CImgdraw_rectangle (const int px0, const int py0, const int pz0, const int pv0, const int px1, const int py1, const int pz1, const int pv1, const T &val)
 Draw a filled rectangle (px0,py0,pz0,pv0)-(px1,py1,pz1,pv1) into an image, using a single value.
CImgdraw_rectangle (const int px0, const int py0, const int pz0, const int px1, const int py1, const int pz1, const T *color)
 Draw a filled rectangle (px0,py0,pz0)-(px1,py1,pz1) into an image with a specified color color.
CImgdraw_rectangle (const int px0, const int py0, const int px1, const int py1, const T *color)
 Same function as above, for 2D images.
CImgdraw_ellipse (const int x0, const int y0, const float r1, const float r2, const float ru, const float rv, const T *color)
 Draw a filled ellipse on a 2D image.
CImgdraw_circle (const int x0, const int y0, float r, const T *color)
 Draw a filled circle on a 2D image.
CImgdraw_text (const int x0, const int y0, const char *text, const T *fgcolor, const T *bgcolor, const CImgl< T > &font)
 Draw a text into an image, with the specified colors fgcolor and bgcolor, and the specified font pfont.
CImgdraw_text (const int x0, const int y0, const char *text, const T *fgcolor, const T *bgcolor, const CImgl< T > *pfont)
 Draw a text into an image, with the specified colors fgcolor and bgcolor, and the specified font pfont.
CImgdraw_text (const int x0, const int y0, const char *text, const T *fgcolor=NULL, const T *bgcolor=NULL)
 Draw a text into an image, with the specified colors fgcolor and bgcolor and a default 7x11 font.
CImgdraw_text (const int x0, const int y0, const T *fgcolor, const T *bgcolor, const CImgl< T > *pfont, const char *format,...)
 Draw a text into an image, with format and arguments (2D version).
template<typename t> CImgdraw_quiver (const CImg< t > &flow, const T *color, const uint sampling=25, const float factor=-20, const int quiver_type=0)
 Draw a vector field in the image.
template<typename t> CImgdraw_plot (const CImg< t > &plot, const T *color, const double ymin, const double ymax, const uint gtype=1)
 Draw a 1D graphical representation of a signal 'plot' in the image.
template<typename t> CImgdraw_plot (const CImg< t > &plot, const T *color, const uint gtype=1)
 Draw a 1D graphical representation of a signal 'plot' in the image.
template<typename t> CImgdraw_fill (const int x, const int y, const int z, const T *color, CImg< t > &region, const float sigma=0, const bool first=true)
 Draw a filled region with a specified color, starting from the given point (x,y,z) in a 3D image.
CImgdraw_fill (const int x, const int y, const int z, const T *color, const float sigma=0)
 Draw a filled region with a specified color, starting from the given point (x,y,z) in a 3D image.
CImgdraw_fill (const int x, const int y, const T *color, const float sigma=0)
 Draw a filled region with a specified color, starting from the given point (x,y,z) in a 3D image.
CImgdraw_plasma (const int px0=0, const int py0=0, const int px1=1<< 15, const int py1=1<< 15, const double alpha=1.0, const double beta=1.0)
 Draw a fractal-like plasma effect.
CImgl< T > get_cropfont (const CImgl< T > &font, const uint padding=2)
 Create an auto-cropped font (along the X axis) from a input font font.
CImgl< T > get_font7x11 (const bool fixed_size=false)
 Return the default cimg font : a 3-channel masked 7x11 font. Parameter fixed_size allows to get the fixed-size font (true), or the non fixed-size font (false);.

Filtering functions

CImg get_correl (const CImg &mask, const uint cond=1, const bool weighted_correl=false) const
 Return the correlation of the image by a mask.
CImgcorrel (const CImg &mask, const uint cond=1, const bool weighted_correl=false)
 Correlate the image by a mask.
CImg get_convol (const CImg &mask, const uint cond=1, const bool weighted_correl=false) const
 Return the convolution of the image by a mask.
CImgconvol (const CImg &mask, const uint cond=1, const bool weighted_convol=false)
 Convolve the image by a mask.
CImg get_convol3x3 (const double m[3][3], const bool weighted_convol=false) const
 Return the convolution of the image by a 3x3 mask (fast implementation).
CImgconvol3x3 (const double m[3][3], const bool weighted_convol=false)
 Convolve the image by a 3x3 mask (fast implementation).
CImg get_correl3x3 (const double m[3][3], const bool weighted_correl=false) const
 Return the correlation of the image by a 3x3 mask (fast implementation).
CImgcorrel3x3 (const double m[3][3], const bool weighted_correl=false)
 Correlate the image by a 3x3 mask (fast implementation).
CImg get_convol5x5 (const double m[5][5], const bool weighted_convol=false) const
 Return the convolution of the image by a 5x5 mask (fast implementation).
CImgconvol5x5 (const double m[5][5], const bool weighted_convol=false)
 Convolve the image by a 5x5 mask (fast implementation).
CImg get_correl5x5 (const double m[3][3], const bool weighted_correl=false) const
 Return the correlation of the image by a 5x5 mask (fast implementation).
CImgcorrel5x5 (const double m[5][5], const bool weighted_correl=false)
 Correlate the image by a 5x5 mask (fast implementation).
CImg get_convol3x3x3 (const double m[3][3][3], const bool weighted_convol=false) const
 Return the convolution of the image by a 3x3x3 mask (fast implementation).
CImgconvol3x3x3 (const double m[3][3][3], const bool weighted_convol=false)
 Convolve the image by a 3x3x3 mask (fast implementation).
CImg get_correl3x3x3 (const double m[3][3][3], const bool weighted_correl=false) const
 Return the correlation of the image by a 3x3x3 mask (fast implementation).
CImgcorrel3x3x3 (const double m[3][3][3], const bool weighted_correl=false)
 Correlate the image by a 3x3x3 mask (fast implementation).
CImgnoise (const double psigma=-20, const uint ntype=0)
 Add noise to the image.
CImg get_noise (const double sigma=-20, const uint ntype=0) const
 Return a noisy image.
CImgderiche (const float sigma=1, const int order=0, const char axe='x', const uint cond=1)
 Apply a deriche filter on the image.
CImg get_deriche (const float sigma=1, const int order=0, const char axe='x', const uint cond=1) const
 Return the result of the Deriche filter.
CImgblur (const float sigma=1, const uint cond=1)
 Blur the image with a Deriche filter (quasi-gaussian filter).
CImg get_blur (const float sigma=1, const uint cond=1) const
 Return a blurred version of the image, using a Deriche filter (quasi gaussian filter).

Matrix computation

template<typename t> CImg operator * (const CImg< t > &img) const
 Operator* (matrix product).
template<typename t> CImgoperator *= (const CImg< t > &img)
 Operator*= (matrix product).
CImg get_vector (const uint x=0, const uint y=0, const uint z=0) const
 Return a new image corresponding to the vector located at (x,y,z) of the current vector-valued image.
CImg get_matrix (const uint x=0, const uint y=0, const uint z=0) const
 Return a new image corresponding to the square matrix located at (x,y,z) of the current vector-valued image.
CImg get_tensor (const uint x=0, const uint y=0, const uint z=0) const
 Return a new image corresponding to the diffusion tensor located at (x,y,z) of the current vector-valued image.
CImgset_vector (const T *vec, const uint x=0, const uint y=0, const uint z=0)
 Set the image vec as the vector valued pixel located at (x,y,z) of the current vector-valued image.
CImgset_matrix (const CImg &mat, const uint x=0, const uint y=0, const uint z=0)
 Set the image vec as the square matrix-valued pixel located at (x,y,z) of the current vector-valued image.
CImgset_tensor (const CImg &ten, const uint x=0, const uint y=0, const uint z=0)
 Set the image vec as the tensor valued pixel located at (x,y,z) of the current vector-valued image.
CImgeye (const T &factor=(T) 1)
 Set the current matrix to be the matrix factor * Identity.
CImg get_transpose () const
 Return the transpose version of the current matrix.
CImgtranspose ()
 Replace the current matrix by its transpose.
CImg get_diagonal () const
 Get a diagonal matrix, whose diagonal coefficients are the coefficients of the input image.
CImgdiagonal ()
 Replace a vector by a diagonal matrix containing the original vector coefficients.
CImginverse ()
 Inverse the current matrix.
CImg get_inverse () const
 Return the inverse of the current matrix.
double trace () const
 Return the trace of the current matrix.
double dot (const CImg &img) const
 Return the dot product of the current vector/matrix with the vector/matrix img.
CImgcross (const CImg &img)
 Return the cross product between two 3d vectors.
CImg get_cross (const CImg &img) const
 Return the cross product between two 3d vectors.
double det () const
 Return the determinant of the current matrix.
double norm (const int ntype=2) const
 Return the norm of the current vector/matrix. ntype = norm type (0=L2, 1=L1, -1=Linf).
double sum () const
 Return the sum of all the pixel values in an image.
template<typename t> const CImg< T > & eigen (CImg< t > &val, CImg< t > &vec) const
 Compute the eigenvalues and eigenvectors of a general matrix.
template<typename t> const CImg< T > & eigen (CImg< t > &val) const
 Compute the eigenvalues of a general matrix.
template<typename t> const CImg< T > & symeigen (CImg< t > &val, CImg< t > &vec) const
 Compute the eigenvalues and eigenvectors of a symmetric matrix.
template<typename t> const CImg< T > & symeigen (CImg< t > &val) const
 Compute the eigenvalues of a symmetric matrix.
CImg get_eye (const uint dim, const T &factor=(T) 1)
 Return a matrix dim * dim equal to factor * Identity.

Display functions

CImgDisplaynew_display (const char *title="", const int normalize=1, const uint event_type=3, const bool visible=true) const
 Open a Window with the specified image and return a pointer to the corresponding CImgDisplay structure.
const CImgdisplay (CImgDisplay &disp, const uint ymin=0, const uint ymax=(uint)(-1)) const
 Display an image into a CImgDisplay window.
const CImgdisplay (CImgDisplay *disp, const uint ymin=0, const uint ymax=(uint)(-1)) const
 Display an image into a CImgDisplay window.
const CImgwait_sync (const uint milliseconds) const
 Same as cimg::wait_sync().
const CImgdisplay (const char *title, const int min_size=64, const int max_size=1024) const
 Display an image in a window with a title title, and wait a 'closed' or 'keyboard' event.
Parameters min_size and max_size set the minimum and maximum dimensions of the display window. If negative, they corresponds to a percentage of the original image size.
const CImgdisplay (const int min_size=64, const int max_size=1024) const
 Display an image in a window, with a default title. See also display() for details on parameters.
const CImgfeature_selection (int *const selection, const int feature_type, CImgDisplay &xdisp, uint *const XYZ=NULL, const uchar *pcolor=NULL) const
 High-level interface to select features in images.
const CImgfeature_selection (int *const selection=NULL, const int feature_type=0, CImgDisplay *xdisp=NULL, uint *const XYZ=NULL, const uchar *pcolor=NULL) const
 High-level interface to select features in images.

Input-Output functions

const CImgsave (const char *filename, const int number=-1, const bool normalize=true) const
 Save the image as a file. The used file format is defined by the file extension in the filename filename.
Parameter number can be used to add a 6-digit number to the filename before saving.
If normalize is true, a normalized version of the image (between [0,255]) is saved.
const CImgsave_ascii (const char *filename) const
 Save the image as an ASCII file.
const CImgsave_dlm (const char *filename) const
 Save the image as a DLM file.
const CImgsave_pnm (const char *filename) const
 Save the image as a PNM file.
const CImgsave_analyze (const char *filename, const float *const voxsize=NULL) const
 Save the image as an ANALYZE7.5 file.
const CImgsave_raw (const char *filename) const
 Save the image as a RAW file.
const CImgsave_convert (const char *filename) const
 Function that saves the image for other file formats that are not natively handled by CImg, using the tool 'convert' from the ImageMagick package.
This is the case for all compressed image formats (GIF,PNG,JPG,TIF,...). You need to install the ImageMagick package in order to get this function working properly (see http://www.imagemagick.org ).
const CImgsave_inr (const char *filename, const float *const voxsize=NULL) const
 Save the image as an INRIMAGE-4 file.
CImg load (const char *filename)
 Load the image from a file. The used file format is defined by the file extension in the filename filename.
CImg load_inr (const char *filename, float *voxsize=NULL)
 Load the image from an INRIMAGE-4 file.
CImg load_pnm (const char *filename)
 Load the image from a PNM file.
CImg load_ascii (const char *filename)
 Load the image from an ASCII file.
CImg load_dlm (const char *filename)
 Load the image from a DLM file.
CImg load_analyze (const char *filename, float *voxsize=NULL)
 Load the image from an ANALYZE7.5 file.
CImg load_raw (const char *filename)
 Load the image from a RAW file.
CImg load_convert (const char *filename)
 Function that loads the image for other file formats that are not natively handled by CImg, using the tool 'convert' from the ImageMagick package.
This is the case for all compressed image formats (GIF,PNG,JPG,TIF,...). You need to install the ImageMagick package in order to get this function working properly (see http://www.imagemagick.org ).

Public Attributes

uint width
 Width of the image (numbers of columns).
uint height
 Height of the image (number of rows).
uint depth
 Depth of the image (number of z-slices).
uint dim
 Dimension of the image (number of vector channels).
T * data
 Pointer to pixel values (tab of size width*height*depth*data).


Detailed Description

template<typename T>
struct CImg< T >

The basic CImg class, representing images, with pixels of type T.


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