The C++ Template Image Processing Library.    

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

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

CImg Struct Template Reference

This structure represents an image (up to 4 dimensions wide), with pixels of type T. More...

Inheritance diagram for CImg:

CImgROI List of all members.

Constructors - Destructor - Copy

 CImg (const unsigned int dx=0, const unsigned int dy=1, const unsigned int dz=1, const unsigned int dv=1)
 Create an image of size (dx,dy,dz,dv) with pixels of type T.
 CImg (const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv, const T &val)
 Create an image of size (dx,dy,dz,dv) with pixels of type T, and set the image pixels to the value val.
template<typename t>
 CImg (const CImg< t > &img)
 Copy constructor.
template<typename t>
 CImg (const CImg< t > &img, const bool pixel_copy)
 Copy constructor.
 CImg (const char *const filename)
 Create an image by loading a file.
template<typename t>
 CImg (const t *const data_buffer, const unsigned int dx, const unsigned int dy=1, const unsigned int dz=1, const unsigned int dv=1, const bool multiplexed=false)
 Create an image from a data buffer.
 ~CImg ()
 Destructor.
CImgempty ()
 Empty the instance image.

Access to image dimensions and pixel values

const unsigned int size () const
 Return the number of pixel values of an image.
const int dimx () const
 Return the number of columns of the instance image (size along the X-axis).
const int dimy () const
 Return the number of rows of the instance image (size along the Y-axis).
const int dimz () const
 Return the number of slices of the instance image (size along the Z-axis).
const int dimv () const
 Return the number of vector channels of the instance image (size along the V-axis).
const int offset (const int x=0, const int y=0, const int z=0, const int v=0) const
 Return the offset corresponding to the location of the pixel value located at (x,y,z,v).
T * ptr (const unsigned int x=0, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0) const
 Return a pointer to the pixel value located at (x,y,z,v).
T & operator() (const unsigned int x, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0) const
 Access to pixel value for reading or writing, without boundary checking.
T & operator[] (const unsigned int off) const
 Access to pixel buffer value for reading or writing.
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 for all coordinates (x,y,z,v).
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 for the three first coordinates (x,y,z).
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 for the two first coordinates (x,y).
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 for the first coordinate x.
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 for all coordinates (x,y,z,v).
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 for the three first coordinates (x,y,z).
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 for the two first coordinates (x,y).
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 for the first coordinate x.
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 for all coordinates (x,y,z,v).
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 for the three first coordinates (x,y,z).
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 for the two first coordinates (x,y).
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 for the first coordinate x.
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 for the two first coordinates (x,y).
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 for all coordinates x.
const CImgprint (const char *title=NULL, const unsigned int print_flag=1) const
 Print image information on the standart error output.
const CImgprint (const unsigned int print_flag) const
 Print image information on the standart error output.
const char * pixel_type ()
 Return the type of the pixel values.

Common arithmetics and boolean operators

template<typename t>
CImg< T > & operator= (const CImg< t > &img)
 Copy an image to the instance image.
CImgoperator= (const T &val)
 Assign a scalar value to all pixels of the instance image.
CImgoperator= (const T *buf)
 Copy the content of a C-array to the pixel buffer of the instance image.
CImgoperator+= (const T &val)
 Operator+=.
CImgoperator-= (const T &val)
 Operator-=.
CImgoperator%= (const T &val)
 Operator%=.
CImgoperator &= (const T &val)
 Operator&=.
CImgoperator|= (const T &val)
 Operator|=.
CImgoperator^= (const T &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 T &val) const
 Operator&.
CImg operator| (const T &val) const
 Operator|.
CImg operator^ (const T &val) const
 Operator^.
CImg operator! () const
 Operator!
CImg operator~ () const
 Operator~.
template<typename t>
CImgoperator+= (const CImg< t > &img)
 Operator+=.
template<typename t>
CImgoperator-= (const CImg< t > &img)
 Operator-=.
CImgoperator%= (const CImg &img)
 Operator%=.
CImgoperator &= (const CImg &img)
 Operator&=.
CImgoperator|= (const CImg &img)
 Operator|=.
CImgoperator^= (const CImg &img)
 Operator^=.
template<typename t>
CImg operator+ (const CImg< t > &img) const
 Operator+.
template<typename t>
CImg operator- (const CImg< t > &img) const
 Operator-.
CImg operator% (const CImg &img) const
 Operator%.
CImg operator & (const CImg &img) const
 Operator&.
CImg operator| (const CImg &img) const
 Operator|.
CImg operator^ (const CImg &img) const
 Operator^.
CImgoperator *= (const double val)
 Operator*=.
CImgoperator/= (const double val)
 Operator/=.
CImg operator * (const double val) const
 Operator*.
CImg operator/ (const double val) 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!=.
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-.

Usual mathematical operations

template<typename t>
CImgmul (const CImg< t > &img)
 Replace the image by the pointwise multiplication between *this and img.
template<typename t>
CImg get_mul (const CImg< t > &img) const
 Return the image corresponding to the pointwise multiplication between *this and img.
template<typename t>
CImgdiv (const CImg< t > &img)
 Replace the image by the pointwise division between *this and img.
template<typename t>
CImg get_div (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.
CImglog ()
 Replace each image pixel by its log.
CImg get_log () const
 Return the image of the log of the pixel values.
CImglog10 ()
 Replace each image pixel by its log10.
CImg get_log10 () const
 Return the image of the log10 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.

Usual image transformation

CImgfill (const T &val)
 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)
 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)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val7.
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)
 Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val9.
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 unsigned int n=256)
 Quantify pixel values into
levels.
CImg get_quantify (const unsigned int 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 unsigned int cond=2) const
 Return a rotated image.
CImgrotate (const float angle, const unsigned int cond=2)
 Rotate the image.
CImg get_rotate (const float angle, const float cx, const float cy, const float zoom=1, const unsigned int cond=2) const
 Return a rotated image around the point (cx,cy).
CImgrotate (const float angle, const float cx, const float cy, const float zoom=1, const unsigned int cond=2)
 Rotate the image around the point (cx,cy).
CImg get_resize (const int pdx=-100, const int pdy=-100, const int pdz=-100, const int pdv=-100, const unsigned int interp=1) const
 Return a resized image.
template<typename t>
CImg get_resize (const CImg< t > &src, const unsigned int interp=1) const
 Return a resized image.
CImg get_resize (const CImgDisplay &disp, const unsigned int 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 unsigned int interp=1)
 Resize the image.
template<typename t>
CImgresize (const CImg< t > &src, const unsigned int interp=1)
 Resize the image.
CImgresize (const CImgDisplay &disp, const unsigned int 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_crop (const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1, const bool border_condition=false) const
 Return a square region of the image, as a new image.
CImg get_crop (const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const bool border_condition=false) const
 Return a square region of the image, as a new image.
CImg get_crop (const unsigned int x0, const unsigned int y0, const unsigned int x1, const unsigned int y1, const bool border_condition=false) const
 Return a square region of the image, as a new image.
CImg get_crop (const unsigned int x0, const unsigned int x1, const bool border_condition=false) const
 Return a square region of the image, as a new image.
CImgcrop (const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int v0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const unsigned int v1, const bool border_condition=false)
 Replace the image by a square region of the image.
CImgcrop (const unsigned int x0, const unsigned int y0, const unsigned int z0, const unsigned int x1, const unsigned int y1, const unsigned int z1, const bool border_condition=false)
 Replace the image by a square region of the image.
CImgcrop (const unsigned int x0, const unsigned int y0, const unsigned int x1, const unsigned int y1, const bool border_condition=false)
 Replace the image by a square region of the image.
CImgcrop (const unsigned int x0, const unsigned int x1, const bool border_condition=false)
 Replace the image by a square region of the image.
CImg get_channel (const unsigned int v0=0) const
 Get the channel v of the current image, as a new image.
CImg get_slice (const unsigned int z0=0) const
 Get the z-slice z of *this, as a new image.
CImg get_plane (const unsigned int z0=0, const unsigned int 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 unsigned int xmin, const unsigned int xmax, const unsigned int y0=0, const unsigned int z0=0, const unsigned int 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 unsigned int ymin, const unsigned int ymax, const unsigned int z0=0, const unsigned int 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 unsigned int zmin, const unsigned int zmax, const unsigned int 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 unsigned int vmin, const unsigned int vmax) const
 Return a reference to a set of channels (v0->v1) of the image. Use it carefully !
CImgROI< T > ref_line (const unsigned int y0, const unsigned int z0=0, const unsigned int v0=0) const
 Return a reference to a line (y0,z0,v0) of the image. Use it carefully !
CImgROI< T > ref_plane (const unsigned int z0, const unsigned int v0=0) const
 Return a reference to a plane (z0,v0) of the image. Use it carefully !
CImgROI< T > ref_channel (const unsigned int v0) const
 Return a reference to a channel (v0) of the image. Use it carefully !
CImgchannel (const unsigned int v0=0)
 Replace the image by one of its channel.
CImgslice (const unsigned int z0=0)
 Replace the image by one of its z-slice.
CImgplane (const unsigned int z0=0, const unsigned int 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.
CImgscroll (const int scrollx, const int scrolly=0, const int scrollz=0, const int scrollv=0, const int border_condition=0)
 Scroll the image.
CImg get_scroll (const int scrollx, const int scrolly=0, const int scrollz=0, const int scrollv=0, const int border_condition=0) const
 Return a scrolled image.
CImg get_3dplanes (const unsigned int px0, const unsigned int py0, const unsigned int pz0) const
 Return a 2D representation of a 3D image, with three slices.
CImg< float > get_histogram (const unsigned int nblevels=256, const T val_min=(T) 0, const T val_max=(T) 0) const
 Return the histogram of the image.
CImgequalize_histogram (const unsigned int nblevels=256)
 Equalize the image histogram.
CImg get_equalize_histogram (const unsigned int 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_orientation_pointwise () const
 Return an image of the normalized vectors.
CImgorientation_pointwise ()
 Replace each pixel value with its normalized vector component.
CImgl< T > get_split (const char axe, const unsigned int nb=0) const
 Split current image into a list.
CImgl< T > get_gradientXY (const int scheme=0, const float alpha=0) const
 Return a list of images, corresponding to the XY-gradients of an image.
CImgl< T > get_gradientXYZ (const int scheme=0, const float alpha=0) const
 Return a list of images, corresponding to the XYZ-gradients of an image.

Color conversion functions

CImgRGBtoXYZ ()
 Convert color pixels from (R,G,B) to (X,Y,Z)_709.
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_point (const int x0, const int y0, const int z0, const T *const color, const float opacity=1)
 Draw a colored point in the instance image, at coordinates (x0,y0,z0).
CImgdraw_point (const int x0, const int y0, const T *const color, const float opacity=1)
 Draw a colored point in the instance image, at coordinates (x0,y0).
CImgdraw_line (const int x0, const int y0, const int x1, const int y1, const T *const color, const unsigned long pattern=~0L, const float opacity=1)
 Draw a 2D colored line in the instance image, at coordinates (x0,y0)-(x1,y1).
CImgdraw_line (const int x0, const int y0, const int z0, const int x1, const int y1, const int z1, const T *const color, const unsigned long pattern=~0L, const float opacity=1)
 Draw a 3D colored line in the instance image, at coordinates (x0,y0,z0)-(x1,y1,z1).
template<typename t>
CImgdraw_line (const int x0, const int y0, const int x1, const int y1, const CImg< t > &texture, const int tx0, const int ty0, const int tx1, const int ty1, const float opacity=1)
 Draw a 2D textured line in the instance image, at coordinates (x0,y0)-(x1,y1).
CImgdraw_arrow (const int x0, const int y0, const int x1, const int y1, const T *const color, const float angle=30, const float length=-10, const unsigned long pattern=~0L, const float opacity=1)
 Draw a 2D colored arrow in the instance image, at coordinates (x0,y0)->(x1,y1).
template<typename t>
CImgdraw_image (const CImg< t > &sprite, const int x0=0, const int y0=0, const int z0=0, const int v0=0, const float opacity=1)
 Draw a sprite image in the instance image, at coordinates (x0,y0,z0,v0).
template<typename ti, typename tm>
CImgdraw_image (const CImg< ti > &sprite, const CImg< tm > &mask, const int x0=0, const int y0=0, const int z0=0, const int v0=0, const tm mask_valmax=1, const float opacity=1)
 Draw a masked sprite image in the instance image, at coordinates (x0,y0,z0,v0).
CImgdraw_rectangle (const int x0, const int y0, const int z0, const int v0, const int x1, const int y1, const int z1, const int v1, const T &val, float opacity=1)
 Draw a 4D filled rectangle in the instance image, at coordinates (x0,y0,z0,v0)-(x1,y1,z1,v1).
CImgdraw_rectangle (const int x0, const int y0, const int z0, const int x1, const int y1, const int z1, const T *const color, const float opacity=1)
 Draw a 3D filled colored rectangle in the instance image, at coordinates (x0,y0,z0)-(x1,y1,z1).
CImgdraw_rectangle (const int x0, const int y0, const int x1, const int y1, const T *const color, const float opacity=1)
 Draw a 2D filled colored rectangle in the instance image, at coordinates (x0,y0)-(x1,y1).
CImgdraw_triangle (const int x0, const int y0, const int x1, const int y1, const int x2, const int y2, const T *const color, const float opacity=1)
 Draw a 2D filled colored triangle in the instance image, at coordinates (x0,y0)-(x1,y1)-(x2,y2).
template<typename t>
CImgdraw_triangle (const int x0, const int y0, const int x1, const int y1, const int x2, const int y2, const CImg< t > &texture, const int tx0, const int ty0, const int tx1, const int ty1, const int tx2, const int ty2, const float opacity=1)
 Draw a 2D textured triangle in the instance image, at coordinates (x0,y0)-(x1,y1)-(x2,y2).
CImgdraw_ellipse (const int x0, const int y0, const float r1, const float r2, const float ru, const float rv, const T *const color, const float opacity=1)
 Draw a filled ellipse on the instance image.
template<typename t>
CImgdraw_ellipse (const int x0, const int y0, const CImg< t > &tensor, const T *color, const float opacity=1)
 Draw a filled ellipse on the instance image.
CImgdraw_circle (const int x0, const int y0, float r, const T *const color, const float opacity=1)
 Draw a filled circle on the instance image.
template<typename t>
CImgdraw_text (const char *const text, const int x0, const int y0, const T *const fgcolor, const T *const bgcolor, const CImgl< t > &font, const float opacity=1)
 Draw a text into the instance image.
CImgdraw_text (const char *const text, const int x0, const int y0, const T *const fgcolor=NULL, const T *const bgcolor=NULL, const float opacity=1)
 Draw a text into the instance image.
CImgdraw_text (const int x0, const int y0, const T *const fgcolor, const T *const bgcolor, const float opacity, const char *format,...)
 Draw a text into the instance image.
template<typename t>
CImgdraw_quiver (const CImg< t > &flow, const T *const color, const unsigned int sampling=25, const float factor=-20, const int quiver_type=0, const float opacity=1)
 Draw a vector field in the instance image.
template<typename t1, typename t2>
CImgdraw_quiver (const CImg< t1 > &flow, const CImg< t2 > &color, const unsigned int sampling=25, const float factor=-20, const int quiver_type=0, const float opacity=1)
 Draw a vector field in the instance image, using a colormap.
template<typename t>
CImgdraw_graph (const CImg< t > &data, const T *const color, const unsigned int gtype=0, const double ymin=0, const double ymax=0, const float opacity=1)
 Draw a 1D graph on the instance image.
CImgdraw_axeX (const double x0, const double x1, const int y, const T *const color, const double precision=0, const float opacity=1)
 Draw a labelled horizontal axis on the instance image.
CImgdraw_axeY (const int x, const double y0, const double y1, const T *const color, const double precision=0, const float opacity=1)
 Draw a labelled vertical axis on the instance image.
CImgdraw_axeXY (const double x0, const double x1, const double y0, const double y1, const T *const color, const double precisionx=0, const double precisiony=0, const float opacity=1)
 Draw a labelled coordinate system (X,Y) on the instance image.
template<typename t>
CImgdraw_fill (const int x, const int y, const int z, const T *const color, CImg< t > &region, const float sigma=0, const float opacity=1)
 Draw a 3D filled region starting from a point (x,y,\ z) in the instance image.
CImgdraw_fill (const int x, const int y, const int z, const T *const color, const float sigma=0, const float opacity=1)
 Draw a 3D filled region starting from a point (x,y,\ z) in the instance image.
CImgdraw_fill (const int x, const int y, const T *const color, const float sigma=0, const float opacity=1)
 Draw a 2D filled region starting from a point (x,y) in the instance image.
CImgdraw_plasma (const int x0, const int y0, const int x1, const int y1, const double alpha=1.0, const double beta=1.0, const float opacity=1)
 Draw a plasma square in the instance image.
CImgdraw_plasma (const double alpha=1.0, const double beta=1.0, const float opacity=1)
 Draw a plasma in the instance image.
template<typename t>
CImgdraw_gaussian (const float xc, const double sigma, const T *const color, const float opacity=1)
 Draw a 1D gaussian function in the instance image.
template<typename t>
CImgdraw_gaussian (const float xc, const float yc, const CImg< t > &tensor, const T *const color, const float opacity=1)
 Draw an anisotropic 2D gaussian function in the instance image.
CImgdraw_gaussian (const float xc, const float yc, const float sigma, const T *const color, const float opacity=1)
 Draw an isotropic 2D gaussian function in the instance image.
template<typename t>
CImgdraw_gaussian (const float xc, const float yc, const float zc, const CImg< t > &tensor, const T *const color, const float opacity=1)
 Draw an anisotropic 3D gaussian function in the instance image.
CImgdraw_gaussian (const float xc, const float yc, const float zc, const double sigma, const T *const color, const float opacity=1)
 Draw an isotropic 3D gaussian function in the instance image.

Filtering functions

template<typename t>
CImg get_correlate (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_correl=false) const
 Return the correlation of the image by a mask.
template<typename t>
CImgcorrelate (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_correl=false)
 Correlate the image by a mask.
template<typename t>
CImg get_convolve (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_convol=false) const
 Return the convolution of the image by a mask.
template<typename t>
CImgconvolve (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_convol=false)
 Convolve the image by a mask.
CImgnoise (const double sigma=-20, const unsigned int ntype=0)
 Add noise to the image.
CImg get_noise (const double sigma=-20, const unsigned int ntype=0) const
 Return a noisy image.
CImgderiche (const float sigma=1, const int order=0, const char axe='x', const unsigned int 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 unsigned int cond=1) const
 Return the result of the Deriche filter.
CImgblur (const float sigmax, const float sigmay, const float sigmaz, const unsigned int cond=1)
 Blur the image with a Deriche filter (anisotropically).
CImgblur (const float sigma=1, const unsigned int cond=1)
 Blur the image with a Deriche filter (quasi-gaussian filter).
CImg get_blur (const float sigmax, const float sigmay, const float sigmaz, const unsigned int cond=1) const
 Return a blurred version of the image, using a Deriche filter (quasi gaussian filter).
CImg get_blur (const float sigma=1, const unsigned int cond=1) const
 Return a blurred version of the image, using a Deriche filter (quasi gaussian filter).
CImg get_erode (const unsigned int n=1)
 Return a eroded image (times erosion).
CImgl< T > get_FFT (const char axe, const bool inverse=false) const
 Return the Fast Fourier Transform of an image (along a specified axis).
CImgl< T > get_FFT (const bool inverse=false) const
 Return the Fast Fourier Transform on an image.
CImgerode (const unsigned int n=1)
 Erode the image n times.
CImg get_dilate (const unsigned int n=1)
 Return an dilated image (times dilatation).
CImgdilate (const unsigned int n=1)
 Dilate the image n times.

Matrix and vector 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 unsigned int x=0, const unsigned int y=0, const unsigned int 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 unsigned int x=0, const unsigned int y=0, const unsigned int 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 unsigned int x=0, const unsigned int y=0, const unsigned int 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 CImg &vec, const unsigned int x=0, const unsigned int y=0, const unsigned int 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 unsigned int x=0, const unsigned int y=0, const unsigned int 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 unsigned int x=0, const unsigned int y=0, const unsigned int z=0)
 Set the image vec as the tensor valued pixel located at (x,y,z) of the current vector-valued image.
CImgidentity_matrix (const unsigned int N)
 Set the current matrix to be the identity matrix.
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 matrix.
template<typename t>
const CImg< T > & eigen (CImg< t > &val) const
 Compute the eigenvalues of a matrix.
CImgl< T > get_eigen () const
 Return the eigenvalues and eigenvectors of a matrix.
template<typename t>
const CImg< T > & eigen (CImgl< t > &eig) const
 Compute the eigenvalues and eigenvectors of a 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 vector (const T &a1)
 Return a vector with specified coefficients.
CImg matrix (const T &a1)
 Return a square matrix with specified coefficients.
CImg tensor (const T &a1)
 Return a diffusion tensor with specified coefficients.
CImg diagonal (const T &a1)
 Return a diagonal matrix with specified coefficients.
CImg get_identity_matrix (const unsigned int N)
 Return a matrix dim * dim equal to factor * Identity.

Display functions

const CImgdisplay (CImgDisplay &disp, const unsigned int ymin=0, const unsigned int ymax=~0) const
 Display an image into a CImgDisplay window.
const CImgwait (const unsigned int milliseconds) const
 Same as cimg::wait().
const CImgdisplay (const char *title, const int min_size=128, 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=128, 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 &disp, unsigned int *const XYZ=NULL, const unsigned char *const color=NULL) const
 High-level interface to select features from images.
const CImgfeature_selection (int *const selection, const int feature_type, unsigned int *const XYZ=NULL, const unsigned char *const color=NULL) const
 High-level interface to select features in images.

Input-Output functions

const CImgsave (const char *filename, const int number=-1) const
 Save the image as a file.
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
 Save the image using ImageMagick's convert.
const CImgsave_inr (const char *filename, const float *const voxsize=NULL) const
 Save the image as an INRIMAGE-4 file.
const CImgsave_pandore (const char *filename) const
 Save the image as a PANDORE-5 file.
const CImgsave_bmp (const char *filename) const
 Save the image as a BMP file.
CImg load (const char *filename)
 Load an image from a file.
CImg load_ascii (const char *filename)
 Load an image from an ASCII file.
CImg load_dlm (const char *filename)
 Load an image from a DLM file.
CImg load_pnm (const char *filename)
 Load an image from a PNM file.
CImg load_bmp (const char *filename)
 Load an image from a BMP file.
CImg load_analyze (const char *filename, float *voxsize=NULL)
 Load an image from an ANALYZE7.5 file.
CImg load_raw (const char *filename, const char axe='v', const char align='p')
 Load an 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

unsigned int width
 Number of columns in the instance image (size along the X-axis).
unsigned int height
 Number of rows in the instance image (size along the Y-axis).
unsigned int depth
 Number of slices in the instance image (size along the Z-axis).
unsigned int dim
 Number of vector channels in the instance image (size along the V-axis).
T * data
 Pointer to pixel values (array of elements T).

Detailed Description

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

This structure represents an image (up to 4 dimensions wide), with pixels of type T.

This is the main structure of the CImg Library. It allows to define an image, access its pixel values, and perform various operations on it.

* Image structure

A CImg<T> structure contains only five fields :

You can access these fields publicly although it is recommended to use dedicated functions dimx(), dimy(), dimz(), dimv() and ptr() to do so. Image dimensions are not limited to a specific range (as long as you got enough RAM). A value of 1 usually means that the corresponding dimension is 'flat'. If one dimension is 0, the image is considered as an empty image. Empty images do not contain pixel data and thus, are not processed by most of CImg member functions. Most of the CImg<T> member functions are designed to work on images with general dimensions.

* Image declaration

Declaration of an image uses one of the several available constructors. Below is a list of the most used :

More constructors are available (copy constructor,...). Please look at the constructor list for more informations.

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<unsigned char> 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();

See also:
Introduction to the CImg Library

Definition at line 2963 of file CImg.h.


Constructor & Destructor Documentation

CImg const unsigned int  dx = 0,
const unsigned int  dy = 1,
const unsigned int  dz = 1,
const unsigned int  dv = 1
[explicit]
 

Create an image of size (dx,dy,dz,dv) with pixels of type T.

Parameters:
dx = number of columns of the created image (size along the X-axis).
dy = number of rows of the created image (size along the Y-axis).
dz = number of slices of the created image (size along the Z-axis).
dv = number of vector channels of the created image (size along the V-axis).
Note:
  • Pixel values are not initialized by this constructor (this can be done by another constructors).
  • If invoked without parameters, this constructor creates an empty image (default constructor).
  • The construction of an empty image does not allocate extra-memory.

Definition at line 3039 of file CImg.h.

CImg const unsigned int  dx,
const unsigned int  dy,
const unsigned int  dz,
const unsigned int  dv,
const T &  val
[explicit]
 

Create an image of size (dx,dy,dz,dv) with pixels of type T, and set the image pixels to the value val.

Parameters:
dx = number of columns of the created image (size along the X-axis).
dy = number of rows of the created image (size along the Y-axis).
dz = number of slices of the created image (size along the Z-axis).
dv = number of vector channels of the created image (size along the V-axis).
val = default value of the pixels.

Definition at line 3054 of file CImg.h.

CImg const CImg< t > &  img  ) 
 

Copy constructor.

Parameters:
img = the image to copy.
Note:
  • An optimized version of the copy constructor is used if the input and output image have same pixel types.

Definition at line 3066 of file CImg.h.

CImg const CImg< t > &  img,
const bool  pixel_copy
 

Copy constructor.

Parameters:
img = the image to copy.
pixel_copy = tells the constructor if the pixel data of the original image are copied into the created image.
Note:
This may be useful when one wants to create an image with same size than other image, but without copying pixel data :
       CImg<float> source("image.jpg");
       CImg<unsigned char> destination(source,false);
is equivalent to
       CImg<float> source("image.jpg");
       CImg<unsigned char> destination(source.dimx(),source.dimy(),source.dimz(),source.dimv());

Definition at line 3100 of file CImg.h.

CImg const char *const   filename  ) 
 

Create an image by loading a file.

Parameters:
filename = the filename of the image file.
Note:
The filename extension implicitely informs CImg about the image format.
See also:
cimg_files_io.

Definition at line 3112 of file CImg.h.

CImg const t *const   data_buffer,
const unsigned int  dx,
const unsigned int  dy = 1,
const unsigned int  dz = 1,
const unsigned int  dv = 1,
const bool  multiplexed = false
 

Create an image from a data buffer.

Parameters:
data_buffer = pointer t* to a buffer of pixel values t.
dx = number of columns of the created image (size along the X-axis).
dy = number of rows of the created image (size along the Y-axis).
dz = number of slices of the created image (size along the Z-axis).
dv = number of vector channels of the created image (size along the V-axis).
multiplexed = If true, it indicates that the source buffer is multiplexed, i.e. data values are interlaced with respect to the v axis (useful for vector-valued/color images only).
See also:
How pixel data are stored with CImg.

Definition at line 3125 of file CImg.h.

~CImg  ) 
 

Destructor.

Note:
The destructor frees the memory eventually used by the image pixels.

Definition at line 3161 of file CImg.h.


Member Function Documentation

CImg& empty  ) 
 

Empty the instance image.

Note:
Equivalent to
       (*this) = CImg<T>();

Definition at line 3170 of file CImg.h.

const char* pixel_type  )  [static]
 

Return the type of the pixel values.

Returns:
a string describing the type of the image pixels (template parameter T).
Note:
  • The string returned may contains spaces (for instance "unsigned char").
  • If the template parameter T does not correspond to a registered type, the string "unknown" is returned.

Definition at line 3188 of file CImg.h.

const unsigned int size  )  const
 

Return the number of pixel values of an image.

Returns:
dimx()*dimy()*dimz()*dimv()
See also:
dimx(), dimy(), dimz(), dimv()

Definition at line 3195 of file CImg.h.

const int dimx  )  const
 

Return the number of columns of the instance image (size along the X-axis).

Returns:
this->width
See also:
dimy(),dimz(),dimv(),size()
Note:
  • It is preferable to use img.dimx() instead of img.width since the latter is unsigned and may perturb arithmetics with signed numbers.

Definition at line 3205 of file CImg.h.

const int dimy  )  const
 

Return the number of rows of the instance image (size along the Y-axis).

Returns:
this->height
See also:
dimx(),dimz(),dimv(),size().
Note:
  • It is preferable to use img.dimy() instead of img.height since the latter is unsigned and may perturb arithmetics with signed numbers.

Definition at line 3215 of file CImg.h.

const int dimz  )  const
 

Return the number of slices of the instance image (size along the Z-axis).

Returns:
this->depth
See also:
dimx(),dimy(),dimv(),size().
  • It is preferable to use img.dimz() instead of img.depth since the latter is unsigned and may perturb arithmetics with signed numbers.

Definition at line 3224 of file CImg.h.

const int dimv  )  const
 

Return the number of vector channels of the instance image (size along the V-axis).

Returns:
this->dim
See also:
dimx(),dimy(),dimz(),size().
  • It is preferable to use img.dimv() instead of img.dim since the latter is unsigned and may perturb arithmetics with signed numbers.

Definition at line 3233 of file CImg.h.

const int offset const int  x = 0,
const int  y = 0,
const int  z = 0,
const int  v = 0
const
 

Return the offset corresponding to the location of the pixel value located at (x,y,z,v).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
Note:
No tests are made on the validity of the given coordinates.
See also:
cimg_storage.

Definition at line 3245 of file CImg.h.

T* ptr const unsigned int  x = 0,
const unsigned int  y = 0,
const unsigned int  z = 0,
const unsigned int  v = 0
const
 

Return a pointer to the pixel value located at (x,y,z,v).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
Note:
If the macro cimg_debug == 2, an extra test is made and a warning message appears if input coordinates are outside the image range.
See also:
cimg_storage, cimg_environment.

Definition at line 3257 of file CImg.h.

T& operator() const unsigned int  x,
const unsigned int  y = 0,
const unsigned int  z = 0,
const unsigned int  v = 0
const
 

Access to pixel value for reading or writing, without boundary checking.

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
Note:
If the macro cimg_debug == 2, a boundary checking is performed (but it slows down the code).

Definition at line 3278 of file CImg.h.

T& operator[] const unsigned int  off  )  const
 

Access to pixel buffer value for reading or writing.

Parameters:
off = offset in the pixel buffer
Note:
if cimg_debug==2, a out-of-buffer test is performed (but it slows down the code).

Definition at line 3296 of file CImg.h.

T 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 for all coordinates (x,y,z,v).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
out_val = returned value if pixel coordinates is out of the image range.

Definition at line 3316 of file CImg.h.

T 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 for the three first coordinates (x,y,z).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
out_val = returned value if pixel coordinates is out of the image range.

Definition at line 3328 of file CImg.h.

T 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 for the two first coordinates (x,y).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
out_val = returned value if pixel coordinates is out of the image range.

Definition at line 3339 of file CImg.h.

T 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 for the first coordinate x.

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel
out_val = returned value if pixel coordinates is out of the image range.

Definition at line 3351 of file CImg.h.

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 for all coordinates (x,y,z,v).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel

Definition at line 3362 of file CImg.h.

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 for the three first coordinates (x,y,z).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel

Definition at line 3375 of file CImg.h.

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 for the two first coordinates (x,y).

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel

Definition at line 3388 of file CImg.h.

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 for the first coordinate x.

Parameters:
x = x-coordinate of the pixel
y = y-coordinate of the pixel
z = z-coordinate of the pixel
v = v-coordinate of the pixel

Definition at line 3399 of file CImg.h.

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 for all coordinates (x,y,z,v).

Parameters:
ffx = x-coordinate of the pixel (float value)
ffy = y-coordinate of the pixel (float value)
ffz = z-coordinate of the pixel (float value)
ffv = v-coordinate of the pixel (float value)

Definition at line 3410 of file CImg.h.

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 for the three first coordinates (x,y,z).

Parameters:
ffx = x-coordinate of the pixel (float value)
ffy = y-coordinate of the pixel (float value)
ffz = z-coordinate of the pixel (float value)
v = v-coordinate of the pixel (integer value)

Definition at line 3441 of file CImg.h.

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 for the two first coordinates (x,y).

Parameters:
ffx = x-coordinate of the pixel (float value)
ffy = y-coordinate of the pixel (float value)
z = z-coordinate of the pixel (integer value)
v = v-coordinate of the pixel (integer value)

Definition at line 3463 of file CImg.h.

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 for the first coordinate x.

Parameters:
ffx = x-coordinate of the pixel (float value)
y = y-coordinate of the pixel (integer value)
z = z-coordinate of the pixel (integer value)
v = v-coordinate of the pixel (integer value)

Definition at line 3481 of file CImg.h.

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 for the two first coordinates (x,y).

Parameters:
pfx = x-coordinate of the pixel (float value)
pfy = y-coordinate of the pixel (float value)
z = z-coordinate of the pixel (integer value)
v = v-coordinate of the pixel (integer value)

Definition at line 3496 of file CImg.h.

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 for all coordinates x.

Parameters:
pfx = x-coordinate of the pixel (float value)
y = y-coordinate of the pixel (integer value)
z = z-coordinate of the pixel (integer value)
v = v-coordinate of the pixel (integer value)

Definition at line 3522 of file CImg.h.

const CImg& print const char *  title = NULL,
const unsigned int  print_flag = 1
const
 

Print image information on the standart error output.

Parameters:
title = name of your printed variable.
print_flag = - 0 : print only informations about image size and pixel buffer.
  • 1 : print also statistics on the image pixels.
  • 2 : print also the pixel buffer content, in a matlab-style.

Definition at line 3537 of file CImg.h.

const CImg& print const unsigned int  print_flag  )  const
 

Print image information on the standart error output.

Parameters:
print_flag = - 0 : print only informations about image size and pixel buffer.
  • 1 : print also statistics on the image pixels.
  • 2 : print also the pixel buffer content, in a matlab-style.

Definition at line 3562 of file CImg.h.

CImg<T>& operator= const CImg< t > &  img  ) 
 

Copy an image to the instance image.

Parameters:
img = image to copy.
Note:
If pixel types are different, a type cast is performed.

Definition at line 3578 of file CImg.h.

CImg& operator= const T &  val  ) 
 

Assign a scalar value to all pixels of the instance image.

Parameters:
val = the value to assign.

Definition at line 3596 of file CImg.h.

CImg& operator= const T *  buf  ) 
 

Copy the content of a C-array to the pixel buffer of the instance image.

Parameters:
buf = pointer to a C-array, with a size of (at least) this->size().

Definition at line 3602 of file CImg.h.

CImg& operator+= const T &  val  ) 
 

Operator+=.

Parameters:
val = value to add to each pixel value of the instance image.

Definition at line 3612 of file CImg.h.

CImg& operator-= const T &  val  ) 
 

Operator-=.

Parameters:
val = value to sub to each pixel value of the instance image.

Definition at line 3618 of file CImg.h.

CImg& operator%= const T &  val  ) 
 

Operator%=.

Parameters:
val = value of the modulo applied to each pixel value of the instance image.

Definition at line 3624 of file CImg.h.

CImg& operator &= const T &  val  ) 
 

Operator&=.

Parameters:
val = value of the bitwise AND applied to each pixel value of the instance image.

Definition at line 3630 of file CImg.h.

CImg& mul const CImg< t > &  img  ) 
 

Replace the image by the pointwise multiplication between *this and img.

This is the in-place version of get_mul().

See also:
get_mul().

Definition at line 3776 of file CImg.h.

CImg get_mul const CImg< t > &  img  )  const
 

Return the image corresponding to the pointwise multiplication between *this and img.

Parameters:
img = argument of the multiplication.
Note:
if *this and img have different size, the multiplication is applied only on possible values.
See also:
get_div(),mul(),div()

Definition at line 3790 of file CImg.h.

CImg& div const CImg< t > &  img  ) 
 

Replace the image by the pointwise division between *this and img.

This is the in-place version of get_div().

See also:
get_div().

Definition at line 3797 of file CImg.h.

CImg get_div const CImg< t > &  img  )  const
 

Return an image from a pointwise division between *this and img.

Parameters:
img = argument of the division.
Note:
if *this and img have different size, the division is applied only on possible values.
See also:
get_mul(),mul(),div()

Definition at line 3811 of file CImg.h.

CImg& max const CImg< t > &  img  ) 
 

Replace the image by the pointwise max operator between *this and img.

This is the in-place version of get_max().

See also:
get_max().

Definition at line 3818 of file CImg.h.

CImg get_max const CImg< t > &  img  )  const
 

Return the image corresponding to the max value for each pixel.

Parameters:
img = second argument of the max operator (the first one is *this).
See also:
max(), min(), get_min()

Definition at line 3829 of file CImg.h.

CImg& min const CImg< t > &  img  ) 
 

Replace the image by the pointwise min operator between *this and img.

This is the in-place version of get_min().

See also:
get_min().

Definition at line 3836 of file CImg.h.

CImg get_min const CImg< t > &  img  )  const
 

Return the image corresponding to the min value for each pixel.

Parameters:
img = second argument of the min operator (the first one is *this).
See also:
min(), max(), get_max()

Definition at line 3847 of file CImg.h.

CImg& sqrt  ) 
 

Replace each image pixel by its square root.

See also:
get_sqrt()

Definition at line 3853 of file CImg.h.

CImg get_sqrt  )  const
 

Return the image of the square root of the pixel values.

See also:
sqrt()

Definition at line 3862 of file CImg.h.

CImg& log  ) 
 

Replace each image pixel by its log.

See also:
get_log(), log10(), get_log10()

Definition at line 3868 of file CImg.h.

CImg get_log  )  const
 

Return the image of the log of the pixel values.

See also:
log(), log10(), get_log10()

Definition at line 3877 of file CImg.h.

CImg& log10  ) 
 

Replace each image pixel by its log10.

See also:
get_log10(), log(), get_log()

Definition at line 3883 of file CImg.h.

CImg get_log10  )  const
 

Return the image of the log10 of the pixel values.

See also:
log10(), log(), get_log()

Definition at line 3892 of file CImg.h.

CImg& pow const double  p  ) 
 

Replace each image pixel by its power by p.

Parameters:
p = power
See also:
get_pow(), sqrt(), get_sqrt()

Definition at line 3899 of file CImg.h.

CImg get_pow const double  p  )  const
 

Return the image of the square root of the pixel values.

Parameters:
p = power
See also:
pow(), sqrt(), get_sqrt()

Definition at line 3909 of file CImg.h.

CImg& abs  ) 
 

Replace each pixel value by its absolute value.

See also:
get_abs()

Definition at line 3915 of file CImg.h.

CImg get_abs  )  const
 

Return the image of the absolute value of the pixel values.

See also:
abs()

Definition at line 3924 of file CImg.h.

CImg& cos  ) 
 

Replace each image pixel by its cosinus.

See also:
get_cos(), sin(), get_sin(), tan(), get_tan()

Definition at line 3930 of file CImg.h.

CImg get_cos  )  const
 

Return the image of the cosinus of the pixel values.

See also:
cos(), sin(), get_sin(), tan(), get_tan()

Definition at line 3939 of file CImg.h.

CImg& sin  ) 
 

Replace each image pixel by its sinus.

See also:
get_sin(), cos(), get_cos(), tan(), get_tan()

Definition at line 3945 of file CImg.h.

CImg get_sin  )  const
 

Return the image of the sinus of the pixel values.

See also:
sin(), cos(), get_cos(), tan(), get_tan()

Definition at line 3954 of file CImg.h.

CImg& tan  ) 
 

Replace each image pixel by its tangent.

See also:
get_tan(), cos(), get_cos(), sin(), get_sin()

Definition at line 3960 of file CImg.h.

CImg get_tan  )  const
 

Return the image of the tangent of the pixel values.

See also:
tan(), cos(), get_cos(), sin(), get_sin()

Definition at line 3969 of file CImg.h.

CImg& fill const T &  val  ) 
 

Fill all pixel values with value val.

Parameters:
val = fill value
See also:
operator=()

Definition at line 3986 of file CImg.h.

CImg& fill const T &  val0,
const T &  val1
 

Fill sequentially all pixel values with values val0 and val1.

Parameters:
val0 = fill value 1
val1 = fill value 2

Definition at line 3998 of file CImg.h.

CImg& fill const T &  val0,
const T &  val1,
const T &  val2
 

Fill sequentially all pixel values with values val0 and val1 and val2.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3

Definition at line 4012 of file CImg.h.

CImg& fill 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.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4

Definition at line 4027 of file CImg.h.

CImg& fill 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.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5

Definition at line 4043 of file CImg.h.

CImg& fill 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.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6

Definition at line 4061 of file CImg.h.

CImg& fill const T &  val0,
const T &  val1,
const T &  val2,
const T &  val3,
const T &  val4,
const T &  val5,
const T &  val6
 

Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and val4 and val5.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6
val6 = fill value 7

Definition at line 4082 of file CImg.h.

CImg& fill const T &  val0,
const T &  val1,
const T &  val2,
const T &  val3,
const T &  val4,
const T &  val5,
const T &  val6,
const T &  val7
 

Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val7.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6
val6 = fill value 7
val7 = fill value 8

Definition at line 4105 of file CImg.h.

CImg& fill 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.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6
val6 = fill value 7
val7 = fill value 8
val8 = fill value 9

Definition at line 4131 of file CImg.h.

CImg& fill 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
 

Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val9.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6
val6 = fill value 7
val7 = fill value 8
val8 = fill value 9
val9 = fill value 10

Definition at line 4160 of file CImg.h.

CImg& fill 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.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6
val6 = fill value 7
val7 = fill value 8
val8 = fill value 9
val9 = fill value 10
val10 = fill value 11
val11 = fill value 12

Definition at line 4189 of file CImg.h.

CImg& fill 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.

Parameters:
val0 = fill value 1
val1 = fill value 2
val2 = fill value 3
val3 = fill value 4
val4 = fill value 5
val5 = fill value 6
val6 = fill value 7
val7 = fill value 8
val8 = fill value 9
val9 = fill value 10
val10 = fill value 11
val11 = fill value 12
val12 = fill value 13
val13 = fill value 14
val14 = fill value 15
val15 = fill value 16

Definition at line 4223 of file CImg.h.

CImg& normalize const T &  a,
const T &  b
 

Linear normalization of the pixel values between a and b.

Parameters:
a = minimum pixel value after normalization.
b = maximum pixel value after normalization.
See also:
get_normalize(), cut(), get_cut().

Definition at line 4248 of file CImg.h.

CImg get_normalize const T &  a,
const T &  b
const
 

Return the image of normalized values.

Parameters:
a = minimum pixel value after normalization.
b = maximum pixel value after normalization.
See also:
normalize(), cut(), get_cut().

Definition at line 4262 of file CImg.h.

CImg& cut const T &  a,
const T &  b
 

Cut pixel values between a and b.

Parameters:
a = minimum pixel value after cut.
b = maximum pixel value after cut.
See also:
get_cut(), normalize(), get_normalize().

Definition at line 4270 of file CImg.h.

CImg get_cut const T &  a,
const T &  b
const
 

Return the image of cutted values.

Parameters:
a = minimum pixel value after cut.
b = maximum pixel value after cut.
See also:
cut(), normalize(), get_normalize().

Definition at line 4282 of file CImg.h.

CImg& quantify const unsigned int  n = 256  ) 
 

Quantify pixel values into
levels.

Parameters:
n = number of quantification levels
See also:
get_quantify().

Definition at line 4289 of file CImg.h.

CImg get_quantify const unsigned int  n = 256  )  const
 

Return a quantified image, with
levels.

Parameters:
n = number of quantification levels
See also:
quantify().

Definition at line 4302 of file CImg.h.

CImg& threshold const T &  thres  ) 
 

Threshold the image.

Parameters:
thres = threshold
See also:
get_threshold().

Definition at line 4309 of file CImg.h.

CImg get_threshold const T &  thres  )  const
 

Return a thresholded image.

Parameters:
thres = threshold.
See also:
threshold().

Definition at line 4320 of file CImg.h.

CImg get_rotate const float  angle,
const unsigned int  cond = 2
const
 

Return a rotated image.

Parameters:
angle = rotation angle (in degrees).
cond = rotation type. can be :
  • 0 = zero-value at borders
  • 1 = repeat image at borders
  • 2 = zero-value at borders and linear interpolation
Note:
Returned image will probably have a different size than the instance image *this.
See also:
rotate()

Definition at line 4332 of file CImg.h.

CImg& rotate const float  angle,
const unsigned int  cond = 2
 

Rotate the image.

Parameters:
angle = rotation angle (in degrees).
cond = rotation type. can be :
  • 0 = zero-value at borders
  • 1 = repeat image at borders
  • 2 = zero-value at borders and linear interpolation
See also:
get_rotate()

Definition at line 4398 of file CImg.h.

CImg get_rotate const float  angle,
const float  cx,
const float  cy,
const float  zoom = 1,
const unsigned int  cond = 2
const
 

Return a rotated image around the point (cx,cy).

Parameters:
angle = rotation angle (in degrees).
cx = X-coordinate of the rotation center.
cy = Y-coordinate of the rotation center.
zoom = zoom.
cond = rotation type. can be :
  • 0 = zero-value at borders
  • 1 = repeat image at borders
  • 2 = zero-value at borders and linear interpolation
See also:
rotate()

Definition at line 4412 of file CImg.h.

CImg& rotate const float  angle,
const float  cx,
const float  cy,
const float  zoom = 1,
const unsigned int  cond = 2
 

Rotate the image around the point (cx,cy).

Parameters:
angle = rotation angle (in degrees).
cx = X-coordinate of the rotation center.
cy = Y-coordinate of the rotation center.
zoom = zoom.
cond = rotation type. can be :
  • 0 = zero-value at borders
  • 1 = repeat image at borders
  • 2 = zero-value at borders and linear interpolation
Note:
Rotation does not change the image size. If you want to get an image with a new size, use get_rotate() instead.
See also:
get_rotate()

Definition at line 4485 of file CImg.h.

CImg get_resize const int  pdx = -100,
const int  pdy = -100,
const int  pdz = -100,
const int  pdv = -100,
const unsigned int  interp = 1
const
 

Return a resized image.

Parameters:
pdx = Number of columns (new size along the X-axis).
pdy = Number of rows (new size along the Y-axis).
pdz = Number of slices (new size along the Z-axis).
pdv = Number of vector-channels (new size along the V-axis).
interp = Resizing type :
  • 0 = no interpolation : additionnal space is filled with 0.
  • 1 = bloc interpolation (nearest point).
  • 2 = mosaic : image is repeated if necessary.
  • 3 = linear interpolation.
  • 4 = grid interpolation.
  • 5 = bi-cubic interpolation.
Note:
If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100).

Definition at line 4504 of file CImg.h.

CImg get_resize const CImg< t > &  src,
const unsigned int  interp = 1
const
 

Return a resized image.

Parameters:
src = Image giving the geometry of the resize.
interp = Resizing type :
  • 0 = no interpolation : additionnal space is filled with 0.
  • 1 = bloc interpolation (nearest point).
  • 2 = mosaic : image is repeated if necessary.
  • 3 = linear interpolation.
  • 4 = grid interpolation.
  • 5 = bi-cubic interpolation.
Note:
If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100).

Definition at line 4588 of file CImg.h.

CImg get_resize const CImgDisplay disp,
const unsigned int  interp = 1
const
 

Return a resized image.

Parameters:
disp = Display giving the geometry of the resize.
interp = Resizing type :
  • 0 = no interpolation : additionnal space is filled with 0.
  • 1 = bloc interpolation (nearest point).
  • 2 = mosaic : image is repeated if necessary.
  • 3 = linear interpolation.
  • 4 = grid interpolation.
  • 5 = bi-cubic interpolation.
Note:
If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100).

Definition at line 4604 of file CImg.h.

CImg& resize const int  pdx = -100,
const int  pdy = -100,
const int  pdz = -100,
const int  pdv = -100,
const unsigned int  interp = 1
 

Resize the image.

Parameters:
pdx = Number of columns (new size along the X-axis).
pdy = Number of rows (new size along the Y-axis).
pdz = Number of slices (new size along the Z-axis).
pdv = Number of vector-channels (new size along the V-axis).
interp = Resizing type :
  • 0 = no interpolation : additionnal space is filled with 0.
  • 1 = bloc interpolation (nearest point).
  • 2 = mosaic : image is repeated if necessary.
  • 3 = linear interpolation.
  • 4 = grid interpolation.
  • 5 = bi-cubic interpolation.
Note:
If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100).

Definition at line 4623 of file CImg.h.

CImg& resize const CImg< t > &  src,
const unsigned int  interp = 1
 

Resize the image.

Parameters:
src = Image giving the geometry of the resize.
interp = Resizing type :
  • 0 = no interpolation : additionnal space is filled with 0.
  • 1 = bloc interpolation (nearest point).
  • 2 = mosaic : image is repeated if necessary.
  • 3 = linear interpolation.
  • 4 = grid interpolation.
  • 5 = bi-cubic interpolation.
Note:
If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100).

Definition at line 4645 of file CImg.h.

CImg& resize const CImgDisplay disp,
const unsigned int  interp = 1
 

Resize the image.

Parameters:
disp = Display giving the geometry of the resize.
interp = Resizing type :
  • 0 = no interpolation : additionnal space is filled with 0.
  • 1 = bloc interpolation (nearest point).
  • 2 = mosaic : image is repeated if necessary.
  • 3 = linear interpolation.
  • 4 = grid interpolation.
  • 5 = bi-cubic interpolation.
Note:
If pd[x,y,z,v]<0, it corresponds to a percentage of the original size (the default value is -100).

Definition at line 4661 of file CImg.h.

CImg get_resize_halfXY  )  const
 

Return an half-resized image, using a special filter.

See also:
resize_halfXY(), resize(), get_resize().

Definition at line 4669 of file CImg.h.

CImg& resize_halfXY  ) 
 

Half-resize the image, using a special filter.

See also:
get_resize_halfXY(), resize(), get_resize().

Definition at line 4684 of file CImg.h.

CImg get_crop const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1,
const bool  border_condition = false
const
 

Return a square region of the image, as a new image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
y0 = Y-coordinate of the upper-left crop rectangle corner.
z0 = Z-coordinate of the upper-left crop rectangle corner.
v0 = V-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
y1 = Y-coordinate of the lower-right crop rectangle corner.
z1 = Z-coordinate of the lower-right crop rectangle corner.
v1 = V-coordinate of the lower-right crop rectangle corner.
border_condition = Dirichlet (false) or Neumann border conditions.
See also:
crop()

Definition at line 4699 of file CImg.h.

CImg get_crop const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const bool  border_condition = false
const
 

Return a square region of the image, as a new image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
y0 = Y-coordinate of the upper-left crop rectangle corner.
z0 = Z-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
y1 = Y-coordinate of the lower-right crop rectangle corner.
z1 = Z-coordinate of the lower-right crop rectangle corner.
See also:
crop()

Definition at line 4758 of file CImg.h.

CImg get_crop const unsigned int  x0,
const unsigned int  y0,
const unsigned int  x1,
const unsigned int  y1,
const bool  border_condition = false
const
 

Return a square region of the image, as a new image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
y0 = Y-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
y1 = Y-coordinate of the lower-right crop rectangle corner.
See also:
crop()

Definition at line 4772 of file CImg.h.

CImg get_crop const unsigned int  x0,
const unsigned int  x1,
const bool  border_condition = false
const
 

Return a square region of the image, as a new image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
See also:
crop()

Definition at line 4784 of file CImg.h.

CImg& crop const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  v0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const unsigned int  v1,
const bool  border_condition = false
 

Replace the image by a square region of the image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
y0 = Y-coordinate of the upper-left crop rectangle corner.
z0 = Z-coordinate of the upper-left crop rectangle corner.
v0 = V-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
y1 = Y-coordinate of the lower-right crop rectangle corner.
z1 = Z-coordinate of the lower-right crop rectangle corner.
v1 = V-coordinate of the lower-right crop rectangle corner.
See also:
get_crop()

Definition at line 4800 of file CImg.h.

CImg& crop const unsigned int  x0,
const unsigned int  y0,
const unsigned int  z0,
const unsigned int  x1,
const unsigned int  y1,
const unsigned int  z1,
const bool  border_condition = false
 

Replace the image by a square region of the image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
y0 = Y-coordinate of the upper-left crop rectangle corner.
z0 = Z-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
y1 = Y-coordinate of the lower-right crop rectangle corner.
z1 = Z-coordinate of the lower-right crop rectangle corner.
See also:
get_crop()

Definition at line 4816 of file CImg.h.

CImg& crop const unsigned int  x0,
const unsigned int  y0,
const unsigned int  x1,
const unsigned int  y1,
const bool  border_condition = false
 

Replace the image by a square region of the image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
y0 = Y-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
y1 = Y-coordinate of the lower-right crop rectangle corner.
See also:
get_crop()

Definition at line 4830 of file CImg.h.

CImg& crop const unsigned int  x0,
const unsigned int  x1,
const bool  border_condition = false
 

Replace the image by a square region of the image.

Parameters:
x0 = X-coordinate of the upper-left crop rectangle corner.
x1 = X-coordinate of the lower-right crop rectangle corner.
See also:
get_crop()

Definition at line 4842 of file CImg.h.

CImg get_channel const unsigned int  v0 = 0  )  const
 

Get the channel v of the current image, as a new image.

Parameters:
v0 = vector-channel to return.
See also:
channel(), get_slice(), slice(), get_plane(), plane().

Definition at line 4851 of file CImg.h.

CImg get_slice const unsigned int  z0 = 0  )  const
 

Get the z-slice z of *this, as a new image.

Parameters:
z0 = Z-slice to return.
See also:
slice(), get_channel(), channel(), get_plane(), plane().

Definition at line 4858 of file CImg.h.

CImg get_plane const unsigned int  z0 = 0,
const unsigned int  v0 = 0
const
 

Get the z-slice z of the channel v of the current image, as a new image.

Parameters:
z0 = Z-slice of the plane to return.
v0 = V-channel of the plane to return.
See also:
plane(), get_channel(), channel(), get_slice(), slice().

Definition at line 4866 of file CImg.h.

CImgl<T> get_split const char  axe,
const unsigned int  nb = 0
const
 

Split current image into a list.

  • Splitting process is done along the specified dimension axe.

Definition at line 5284 of file CImg.h.

CImgl<T> get_gradientXY const int  scheme = 0,
const float  alpha = 0
const
 

Return a list of images, corresponding to the XY-gradients of an image.

Parameters:
scheme = Numerical scheme used for the gradient computation :
  • -1 = Backward finite differences
  • 0 = Centered finite differences
  • 1 = Forward finite differences
  • 2 = Using Sobel masks
  • 3 = Using rotation invariant masks
  • 4 = Using Deriche recusrsive filter.
alpha = Blur applied to the gradient.

Definition at line 5322 of file CImg.h.

CImgl<T> get_gradientXYZ const int  scheme = 0,
const float  alpha = 0
const
 

Return a list of images, corresponding to the XYZ-gradients of an image.

See also:
get_gradientXY().

Definition at line 5367 of file CImg.h.

CImg& draw_point const int  x0,
const int  y0,
const int  z0,
const T *const   color,
const float  opacity = 1
 

Draw a colored point in the instance image, at coordinates (x0,y0,z0).

Parameters:
x0 = X-coordinate of the vector-valued pixel to plot.
y0 = Y-coordinate of the vector-valued pixel to plot.
z0 = Z-coordinate of the vector-valued pixel to plot.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5506 of file CImg.h.

CImg& draw_point const int  x0,
const int  y0,
const T *const   color,
const float  opacity = 1
 

Draw a colored point in the instance image, at coordinates (x0,y0).

Parameters:
x0 = X-coordinate of the vector-valued pixel to plot.
y0 = Y-coordinate of the vector-valued pixel to plot.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5529 of file CImg.h.

CImg& draw_line const int  x0,
const int  y0,
const int  x1,
const int  y1,
const T *const   color,
const unsigned long  pattern = ~0L,
const float  opacity = 1
 

Draw a 2D colored line in the instance image, at coordinates (x0,y0)-(x1,y1).

Parameters:
x0 = X-coordinate of the starting point of the line.
y0 = Y-coordinate of the starting point of the line.
x1 = X-coordinate of the ending point of the line.
y1 = Y-coordinate of the ending point of the line.
color = array of dimv() values of type T, defining the drawing color.
pattern = A long integer whose bits describes the line pattern.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5544 of file CImg.h.

CImg& draw_line const int  x0,
const int  y0,
const int  z0,
const int  x1,
const int  y1,
const int  z1,
const T *const   color,
const unsigned long  pattern = ~0L,
const float  opacity = 1
 

Draw a 3D colored line in the instance image, at coordinates (x0,y0,z0)-(x1,y1,z1).

Parameters:
x0 = X-coordinate of the starting point of the line.
y0 = Y-coordinate of the starting point of the line.
z0 = Z-coordinate of the starting point of the line.
x1 = X-coordinate of the ending point of the line.
y1 = Y-coordinate of the ending point of the line.
z1 = Z-coordinate of the ending point of the line.
color = array of dimv() values of type T, defining the drawing color.
pattern = A long integer whose bits describes the line pattern.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5596 of file CImg.h.

CImg& draw_line const int  x0,
const int  y0,
const int  x1,
const int  y1,
const CImg< t > &  texture,
const int  tx0,
const int  ty0,
const int  tx1,
const int  ty1,
const float  opacity = 1
 

Draw a 2D textured line in the instance image, at coordinates (x0,y0)-(x1,y1).

Parameters:
x0 = X-coordinate of the starting point of the line.
y0 = Y-coordinate of the starting point of the line.
x1 = X-coordinate of the ending point of the line.
y1 = Y-coordinate of the ending point of the line.
texture = a colored texture image used to draw the line color.
tx0 = X-coordinate of the starting point of the texture.
ty0 = Y-coordinate of the starting point of the texture.
tx1 = X-coordinate of the ending point of the texture.
ty1 = Y-coordinate of the ending point of the texture.
opacity = opacity of the drawing.
Note:
Clipping is supported, but texture coordinates do not support clipping.

Definition at line 5653 of file CImg.h.

CImg& draw_arrow const int  x0,
const int  y0,
const int  x1,
const int  y1,
const T *const   color,
const float  angle = 30,
const float  length = -10,
const unsigned long  pattern = ~0L,
const float  opacity = 1
 

Draw a 2D colored arrow in the instance image, at coordinates (x0,y0)->(x1,y1).

Parameters:
x0 = X-coordinate of the starting point of the arrow (tail).
y0 = Y-coordinate of the starting point of the arrow (tail).
x1 = X-coordinate of the ending point of the arrow (head).
y1 = Y-coordinate of the ending point of the arrow (head).
color = array of dimv() values of type T, defining the drawing color.
angle = aperture angle of the arrow head
length = length of the arrow head. If <0, described as a percentage of the arrow length.
pattern = a long integer whose bits describes the line pattern.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5704 of file CImg.h.

CImg& draw_image const CImg< t > &  sprite,
const int  x0 = 0,
const int  y0 = 0,
const int  z0 = 0,
const int  v0 = 0,
const float  opacity = 1
 

Draw a sprite image in the instance image, at coordinates (x0,y0,z0,v0).

Parameters:
sprite = sprite image.
x0 = X-coordinate of the sprite position in the instance image.
y0 = Y-coordinate of the sprite position in the instance image.
z0 = Z-coordinate of the sprite position in the instance image.
v0 = V-coordinate of the sprite position in the instance image.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5732 of file CImg.h.

CImg& draw_image const CImg< ti > &  sprite,
const CImg< tm > &  mask,
const int  x0 = 0,
const int  y0 = 0,
const int  z0 = 0,
const int  v0 = 0,
const tm  mask_valmax = 1,
const float  opacity = 1
 

Draw a masked sprite image in the instance image, at coordinates (x0,y0,z0,v0).

Parameters:
sprite = sprite image.
mask = mask image.
x0 = X-coordinate of the sprite position in the instance image.
y0 = Y-coordinate of the sprite position in the instance image.
z0 = Z-coordinate of the sprite position in the instance image.
v0 = V-coordinate of the sprite position in the instance image.
mask_valmax = Maximum pixel value of the mask image mask.
opacity = opacity of the drawing.
Note:
Pixel values of mask set the opacity of the corresponding pixels in sprite.

Clipping is supported.

Dimensions along x,y and z of sprite and mask must be the same.

Definition at line 5814 of file CImg.h.

CImg& draw_rectangle const int  x0,
const int  y0,
const int  z0,
const int  v0,
const int  x1,
const int  y1,
const int  z1,
const int  v1,
const T &  val,
float  opacity = 1
 

Draw a 4D filled rectangle in the instance image, at coordinates (x0,y0,z0,v0)-(x1,y1,z1,v1).

Parameters:
x0 = X-coordinate of the upper-left rectangle corner in the instance image.
y0 = Y-coordinate of the upper-left rectangle corner in the instance image.
z0 = Z-coordinate of the upper-left rectangle corner in the instance image.
v0 = V-coordinate of the upper-left rectangle corner in the instance image.
x1 = X-coordinate of the lower-right rectangle corner in the instance image.
y1 = Y-coordinate of the lower-right rectangle corner in the instance image.
z1 = Z-coordinate of the lower-right rectangle corner in the instance image.
v1 = V-coordinate of the lower-right rectangle corner in the instance image.
val = scalar value used to fill the rectangle area.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5871 of file CImg.h.

CImg& draw_rectangle const int  x0,
const int  y0,
const int  z0,
const int  x1,
const int  y1,
const int  z1,
const T *const   color,
const float  opacity = 1
 

Draw a 3D filled colored rectangle in the instance image, at coordinates (x0,y0,z0)-(x1,y1,z1).

Parameters:
x0 = X-coordinate of the upper-left rectangle corner in the instance image.
y0 = Y-coordinate of the upper-left rectangle corner in the instance image.
z0 = Z-coordinate of the upper-left rectangle corner in the instance image.
x1 = X-coordinate of the lower-right rectangle corner in the instance image.
y1 = Y-coordinate of the lower-right rectangle corner in the instance image.
z1 = Z-coordinate of the lower-right rectangle corner in the instance image.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5913 of file CImg.h.

CImg& draw_rectangle const int  x0,
const int  y0,
const int  x1,
const int  y1,
const T *const   color,
const float  opacity = 1
 

Draw a 2D filled colored rectangle in the instance image, at coordinates (x0,y0)-(x1,y1).

Parameters:
x0 = X-coordinate of the upper-left rectangle corner in the instance image.
y0 = Y-coordinate of the upper-left rectangle corner in the instance image.
x1 = X-coordinate of the lower-right rectangle corner in the instance image.
y1 = Y-coordinate of the lower-right rectangle corner in the instance image.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5931 of file CImg.h.

CImg& draw_triangle const int  x0,
const int  y0,
const int  x1,
const int  y1,
const int  x2,
const int  y2,
const T *const   color,
const float  opacity = 1
 

Draw a 2D filled colored triangle in the instance image, at coordinates (x0,y0)-(x1,y1)-(x2,y2).

Parameters:
x0 = X-coordinate of the first corner in the instance image.
y0 = Y-coordinate of the first corner in the instance image.
x1 = X-coordinate of the second corner in the instance image.
y1 = Y-coordinate of the second corner in the instance image.
x2 = X-coordinate of the third corner in the instance image.
y2 = Y-coordinate of the third corner in the instance image.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 5949 of file CImg.h.

CImg& draw_triangle const int  x0,
const int  y0,
const int  x1,
const int  y1,
const int  x2,
const int  y2,
const CImg< t > &  texture,
const int  tx0,
const int  ty0,
const int  tx1,
const int  ty1,
const int  tx2,
const int  ty2,
const float  opacity = 1
 

Draw a 2D textured triangle in the instance image, at coordinates (x0,y0)-(x1,y1)-(x2,y2).

Parameters:
x0 = X-coordinate of the first corner in the instance image.
y0 = Y-coordinate of the first corner in the instance image.
x1 = X-coordinate of the second corner in the instance image.
y1 = Y-coordinate of the second corner in the instance image.
x2 = X-coordinate of the third corner in the instance image.
y2 = Y-coordinate of the third corner in the instance image.
texture = texture image used to fill the triangle.
tx0 = X-coordinate of the first corner in the texture image.
ty0 = Y-coordinate of the first corner in the texture image.
tx1 = X-coordinate of the second corner in the texture image.
ty1 = Y-coordinate of the second corner in the texture image.
tx2 = X-coordinate of the third corner in the texture image.
ty2 = Y-coordinate of the third corner in the texture image.
opacity = opacity of the drawing.
Note:
Clipping is supported, but texture coordinates do not support clipping.

Definition at line 5993 of file CImg.h.

CImg& draw_ellipse const int  x0,
const int  y0,
const float  r1,
const float  r2,
const float  ru,
const float  rv,
const T *const   color,
const float  opacity = 1
 

Draw a filled ellipse on the instance image.

Parameters:
x0 = X-coordinate of the ellipse center.
y0 = Y-coordinate of the ellipse center.
r1 = First radius of the ellipse.
r2 = Second radius of the ellipse.
ru = X-coordinate of the orientation vector related to the first radius.
rv = Y-coordinate of the orientation vector related to the first radius.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6094 of file CImg.h.

CImg& draw_ellipse const int  x0,
const int  y0,
const CImg< t > &  tensor,
const T *  color,
const float  opacity = 1
 

Draw a filled ellipse on the instance image.

Parameters:
x0 = X-coordinate of the ellipse center.
y0 = Y-coordinate of the ellipse center.
tensor = Diffusion tensor describing the ellipse.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6132 of file CImg.h.

CImg& draw_circle const int  x0,
const int  y0,
float  r,
const T *const   color,
const float  opacity = 1
 

Draw a filled circle on the instance image.

Parameters:
x0 = X-coordinate of the circle center.
y0 = Y-coordinate of the circle center.
r = radius of the circle.
color = an array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6147 of file CImg.h.

CImg& draw_text const char *const   text,
const int  x0,
const int  y0,
const T *const   fgcolor,
const T *const   bgcolor,
const CImgl< t > &  font,
const float  opacity = 1
 

Draw a text into the instance image.

Parameters:
text = a C-string containing the text to display.
x0 = X-coordinate of the text in the instance image.
y0 = Y-coordinate of the text in the instance image.
fgcolor = an array of dimv() values of type T, defining the foreground color (NULL means 'transparent').
bgcolor = an array of dimv() values of type T, defining the background color (NULL means 'transparent').
font = List of font characters used for the drawing.
opacity = opacity of the drawing.
Note:
Clipping is supported.
See also:
get_font7x11().

Definition at line 6163 of file CImg.h.

CImg& draw_text const char *const   text,
const int  x0,
const int  y0,
const T *const   fgcolor = NULL,
const T *const   bgcolor = NULL,
const float  opacity = 1
 

Draw a text into the instance image.

Parameters:
text = a C-string containing the text to display.
x0 = X-coordinate of the text in the instance image.
y0 = Y-coordinate of the text in the instance image.
fgcolor = an array of dimv() values of type T, defining the foreground color (NULL means 'transparent').
bgcolor = an array of dimv() values of type T, defining the background color (NULL means 'transparent').
opacity = opacity of the drawing.
Note:
Clipping is supported.
See also:
get_font7x11().

Definition at line 6201 of file CImg.h.

CImg& draw_text const int  x0,
const int  y0,
const T *const   fgcolor,
const T *const   bgcolor,
const float  opacity,
const char *  format,
  ...
 

Draw a text into the instance image.

Parameters:
x0 = X-coordinate of the text in the instance image.
y0 = Y-coordinate of the text in the instance image.
fgcolor = an array of dimv() values of type T, defining the foreground color (NULL means 'transparent').
bgcolor = an array of dimv() values of type T, defining the background color (NULL means 'transparent').
opacity = opacity of the drawing.
format = a 'printf'-style format, followed by arguments.
Note:
Clipping is supported.
See also:
get_font7x11().

Definition at line 6222 of file CImg.h.

CImg& draw_quiver const CImg< t > &  flow,
const T *const   color,
const unsigned int  sampling = 25,
const float  factor = -20,
const int  quiver_type = 0,
const float  opacity = 1
 

Draw a vector field in the instance image.

Parameters:
flow = a 2d image of 2d vectors used as input data.
color = an array of dimv() values of type T, defining the drawing color.
sampling = length (in pixels) between each arrow.
factor = length factor of each arrow (if <0, computed as a percentage of the maximum length).
quiver_type = type of plot. Can be 0 (arrows) or 1 (segments).
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 6250 of file CImg.h.

CImg& draw_quiver const CImg< t1 > &  flow,
const CImg< t2 > &  color,
const unsigned int  sampling = 25,
const float  factor = -20,
const int  quiver_type = 0,
const float  opacity = 1
 

Draw a vector field in the instance image, using a colormap.

Parameters:
flow = a 2d image of 2d vectors used as input data.
color = a 2d image of dimv()-D vectors corresponding to the color of each arrow.
sampling = length (in pixels) between each arrow.
factor = length factor of each arrow (if <0, computed as a percentage of the maximum length).
quiver_type = type of plot. Can be 0 (arrows) or 1 (segments).
opacity = opacity of the drawing.
Note:
Clipping is supported.

Definition at line 6290 of file CImg.h.

CImg& draw_graph const CImg< t > &  data,
const T *const   color,
const unsigned int  gtype = 0,
const double  ymin = 0,
const double  ymax = 0,
const float  opacity = 1
 

Draw a 1D graph on the instance image.

Parameters:
data = an image containing the graph values I = f(x).
color = an array of dimv() values of type T, defining the drawing color.
gtype = define the type of the plot :
  • 0 = Plot using linear interpolation (segments).
  • 1 = Plot with bars.
  • 2 = Plot using cubic interpolation (3-polynomials).
ymin = lower bound of the y-range.
ymax = upper bound of the y-range.
opacity = opacity of the drawing.
Note:
  • if ymin==ymax==0, the y-range is computed automatically from the input sample.
See also:
draw_axeX(), draw_axeY(), draw_axeXY().

Definition at line 6338 of file CImg.h.

CImg& draw_axeX const double  x0,
const double  x1,
const int  y,
const T *const   color,
const double  precision = 0,
const float  opacity = 1
 

Draw a labelled horizontal axis on the instance image.

Parameters:
x0 = lower bound of the x-range.
x1 = upper bound of the x-range.
y = Y-coordinate of the horizontal axis in the instance image.
color = an array of dimv() values of type T, defining the drawing color.
precision = precision of the labels.
opacity = opacity of the drawing.
Note:
if precision==0, precision of the labels is automatically computed.
See also:
draw_graph(), draw_axeY(), draw_axeXY().

Definition at line 6390 of file CImg.h.

CImg& draw_axeY const int  x,
const double  y0,
const double  y1,
const T *const   color,
const double  precision = 0,
const float  opacity = 1
 

Draw a labelled vertical axis on the instance image.

Parameters:
x = X-coordinate of the vertical axis in the instance image.
y0 = lower bound of the y-range.
y1 = upper bound of the y-range.
color = an array of dimv() values of type T, defining the drawing color.
precision = precision of the labels.
opacity = opacity of the drawing.
Note:
if precision==0, precision of the labels is automatically computed.
See also:
draw_graph(), draw_axeX(), draw_axeXY().

Definition at line 6426 of file CImg.h.

CImg& draw_axeXY const double  x0,
const double  x1,
const double  y0,
const double  y1,
const T *const   color,
const double  precisionx = 0,
const double  precisiony = 0,
const float  opacity = 1
 

Draw a labelled coordinate system (X,Y) on the instance image.

Parameters:
x0 = lower bound of the x-range.
x1 = upper bound of the x-range.
y0 = lower bound of the y-range.
y1 = upper bound of the y-range.
color = an array of dimv() values of type T, defining the drawing color.
precisionx = precision of the labels along the X-axis.
precisiony = precision of the labels along the Y-axis.
opacity = opacity of the drawing.
Note:
if precision==0, precision of the labels along the specified axix is automatically computed.
See also:
draw_graph(), draw_axeX(), draw_axeY().

Definition at line 6464 of file CImg.h.

CImg& draw_fill const int  x,
const int  y,
const int  z,
const T *const   color,
CImg< t > &  region,
const float  sigma = 0,
const float  opacity = 1
 

Draw a 3D filled region starting from a point (x,y,\ z) in the instance image.

Parameters:
x = X-coordinate of the starting point of the region to fill.
y = Y-coordinate of the starting point of the region to fill.
z = Z-coordinate of the starting point of the region to fill.
color = an array of dimv() values of type T, defining the drawing color.
region = image that will contain the mask of the filled region mask, as an output.
sigma = tolerance concerning neighborhood values.
opacity = opacity of the drawing.
Returns:
region is initialized with the binary mask of the filled region.

Definition at line 6552 of file CImg.h.

CImg& draw_fill const int  x,
const int  y,
const int  z,
const T *const   color,
const float  sigma = 0,
const float  opacity = 1
 

Draw a 3D filled region starting from a point (x,y,\ z) in the instance image.

Parameters:
x = X-coordinate of the starting point of the region to fill.
y = Y-coordinate of the starting point of the region to fill.
z = Z-coordinate of the starting point of the region to fill.
color = an array of dimv() values of type T, defining the drawing color.
sigma = tolerance concerning neighborhood values.
opacity = opacity of the drawing.

Definition at line 6570 of file CImg.h.

CImg& draw_fill const int  x,
const int  y,
const T *const   color,
const float  sigma = 0,
const float  opacity = 1
 

Draw a 2D filled region starting from a point (x,y) in the instance image.

Parameters:
x = X-coordinate of the starting point of the region to fill.
y = Y-coordinate of the starting point of the region to fill.
color = an array of dimv() values of type T, defining the drawing color.
sigma = tolerance concerning neighborhood values.
opacity = opacity of the drawing.

Definition at line 6583 of file CImg.h.

CImg& draw_plasma const int  x0,
const int  y0,
const int  x1,
const int  y1,
const double  alpha = 1.0,
const double  beta = 1.0,
const float  opacity = 1
 

Draw a plasma square in the instance image.

Parameters:
x0 = X-coordinate of the upper-left corner of the plasma.
y0 = Y-coordinate of the upper-left corner of the plasma.
x1 = X-coordinate of the lower-right corner of the plasma.
y1 = Y-coordinate of the lower-right corner of the plasma.
alpha = Alpha-parameter of the plasma.
beta = Beta-parameter of the plasma.
opacity = opacity of the drawing.

Definition at line 6598 of file CImg.h.

CImg& draw_plasma const double  alpha = 1.0,
const double  beta = 1.0,
const float  opacity = 1
 

Draw a plasma in the instance image.

Parameters:
alpha = Alpha-parameter of the plasma.
beta = Beta-parameter of the plasma.
opacity = opacity of the drawing.

Definition at line 6644 of file CImg.h.

CImg& draw_gaussian const float  xc,
const double  sigma,
const T *const   color,
const float  opacity = 1
 

Draw a 1D gaussian function in the instance image.

Parameters:
xc = X-coordinate of the gaussian center.
sigma = Variance of the gaussian distribution.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6655 of file CImg.h.

CImg& draw_gaussian const float  xc,
const float  yc,
const CImg< t > &  tensor,
const T *const   color,
const float  opacity = 1
 

Draw an anisotropic 2D gaussian function in the instance image.

Parameters:
xc = X-coordinate of the gaussian center.
yc = Y-coordinate of the gaussian center.
tensor = 2x2 covariance matrix.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6680 of file CImg.h.

CImg& draw_gaussian const float  xc,
const float  yc,
const float  sigma,
const T *const   color,
const float  opacity = 1
 

Draw an isotropic 2D gaussian function in the instance image.

Parameters:
xc = X-coordinate of the gaussian center.
yc = Y-coordinate of the gaussian center.
sigma = variance of the gaussian distribution.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6711 of file CImg.h.

CImg& draw_gaussian const float  xc,
const float  yc,
const float  zc,
const CImg< t > &  tensor,
const T *const   color,
const float  opacity = 1
 

Draw an anisotropic 3D gaussian function in the instance image.

Parameters:
xc = X-coordinate of the gaussian center.
yc = Y-coordinate of the gaussian center.
zc = Z-coordinate of the gaussian center.
tensor = 3x3 covariance matrix.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6724 of file CImg.h.

CImg& draw_gaussian const float  xc,
const float  yc,
const float  zc,
const double  sigma,
const T *const   color,
const float  opacity = 1
 

Draw an isotropic 3D gaussian function in the instance image.

Parameters:
xc = X-coordinate of the gaussian center.
yc = Y-coordinate of the gaussian center.
zc = Z-coordinate of the gaussian center.
sigma = variance of the gaussian distribution.
color = array of dimv() values of type T, defining the drawing color.
opacity = opacity of the drawing.

Definition at line 6756 of file CImg.h.

CImg get_correlate const CImg< t > &  mask,
const unsigned int  cond = 1,
const bool  weighted_correl = false
const
 

Return the correlation of the image by a mask.

The result res of the correlation of an image img by a mask mask is defined to be :

res(x,y,z) = sum_{i,j,k} img(x+i,y+j,z+k)*mask(i,j,k)

Parameters:
mask = the correlation kernel.
cond = the border condition type (0=zero, 1=dirichlet)
weighted_correl = enable local normalization.

Definition at line 6780 of file CImg.h.

CImg& correlate const CImg< t > &  mask,
const unsigned int  cond = 1,
const bool  weighted_correl = false
 

Correlate the image by a mask.

This is the in-place version of get_correlate.

See also:
get_correlate

Definition at line 6904 of file CImg.h.

CImg get_convolve const CImg< t > &  mask,
const unsigned int  cond = 1,
const bool  weighted_convol = false
const
 

Return the convolution of the image by a mask.

The result res of the convolution of an image img by a mask mask is defined to be :

res(x,y,z) = sum_{i,j,k} img(x-i,y-j,z-k)*mask(i,j,k)

Parameters:
mask = the correlation kernel.
cond = the border condition type (0=zero, 1=dirichlet)
weighted_convol = enable local normalization.

Definition at line 6918 of file CImg.h.

CImg& convolve const CImg< t > &  mask,
const unsigned int  cond = 1,
const bool  weighted_convol = false
 

Convolve the image by a mask.

This is the in-place version of get_convolve().

See also:
get_convolve()

Definition at line 7042 of file CImg.h.

CImg& noise const double  sigma = -20,
const unsigned int  ntype = 0
 

Add noise to the image.

This is the in-place version of get_noise.

See also:
get_noise.

Definition at line 7051 of file CImg.h.

CImg get_noise const double  sigma = -20,
const unsigned int  ntype = 0
const
 

Return a noisy image.

Parameters:
sigma = power of the noise. if sigma<0, it corresponds to the percentage of the maximum image value.
ntype = noise type. can be 0=gaussian, 1=uniform or 2=Salt and Pepper.
Returns:
A noisy version of the instance image.

Definition at line 7077 of file CImg.h.

CImg& deriche const float  sigma = 1,
const int  order = 0,
const char  axe = 'x',
const unsigned int  cond = 1
 

Apply a deriche filter on the image.

This is the in-place version of get_deriche

See also:
get_deriche.

Definition at line 7098 of file CImg.h.

CImg get_deriche const float  sigma = 1,
const int  order = 0,
const char  axe = 'x',
const unsigned int  cond = 1
const
 

Return the result of the Deriche filter.

The Canny-Deriche filter is a recursive algorithm allowing to compute blurred derivatives of order 0,1 or 2 of an image.

See also:
blur

Definition at line 7142 of file CImg.h.

CImg& blur const float  sigmax,
const float  sigmay,
const float  sigmaz,
const unsigned int  cond = 1
 

Blur the image with a Deriche filter (anisotropically).

This is the in-place version of get_blur().

See also:
get_blur().

Definition at line 7151 of file CImg.h.

CImg get_blur const float  sigmax,
const float  sigmay,
const float  sigmaz,
const unsigned int  cond = 1
const
 

Return a blurred version of the image, using a Deriche filter (quasi gaussian filter).

Blur the image with an anisotropic exponential filter (Deriche filter of order 0).

Definition at line 7166 of file CImg.h.

CImg load const char *  filename  )  [static]
 

Load an image from a file.

Parameters:
filename = name of the image file to load.
Returns:
A CImg<T> instance containing the pixel data defined in the image file.
Note:
The extension of filename defines the file format. If no filename extension is provided, CImg<T>::load() will try to load a RAW file.

Definition at line 7798 of file CImg.h.

const CImg& save const char *  filename,
const int  number = -1
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.

Definition at line 8406 of file CImg.h.

const CImg& save_convert const char *  filename  )  const
 

Save the image using ImageMagick's convert.

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 ).

Definition at line 8583 of file CImg.h.


Member Data Documentation

unsigned int width
 

Number of columns in the instance image (size along the X-axis).

Note:
  • Prefer using CImg<T>::dimx() to get the width of the instance image.
  • Should be considered as read-only. Modifying directly CImg<T>::width would probably result in a crash.
  • This value can be modified through the CImg<T>::resize() function.
  • If CImg<T>::width==0, the image is empty and contains no pixel data.

Definition at line 2974 of file CImg.h.

unsigned int height
 

Number of rows in the instance image (size along the Y-axis).

Note:

Definition at line 2985 of file CImg.h.

unsigned int depth
 

Number of slices in the instance image (size along the Z-axis).

Note:
  • Prefer using CImg<T>::dimz() to get the depth of the instance image.
  • Should be considered as read-only. Modifying directly CImg<T>::depth would probably result in a crash.
  • This value can be modified through the CImg<T>::resize() function.
  • If CImg<T>::depth==0, the image is empty and contains no pixel data.

Definition at line 2996 of file CImg.h.

unsigned int dim
 

Number of vector channels in the instance image (size along the V-axis).

Note:
  • Prefer using CImg<T>::dimv() to get the depth of the instance image.
  • Should be considered as read-only. Modifying directly CImg<T>::dim would probably result in a crash.
  • This value can be modified through the CImg<T>::resize() function.
  • If CImg<T>::dim==0, the image is empty and contains no pixel data.

Definition at line 3007 of file CImg.h.

T* data
 

Pointer to pixel values (array of elements T).

Note:
  • Prefer using CImg<T>::ptr() to get a pointer to the pixel buffer.
  • Should be considered as read-only. Modifying directly CImg<T>::data would probably result in a crash.
  • If CImg<T>::data==NULL, the image is empty and contains no pixel data.
See also:
How pixel data are stored with CImg.

Definition at line 3018 of file CImg.h.


Generated on Tue Mar 22 10:03:00 2005 for The CImg Library by  doxygen 1.3.9