C++ Template Image Processing Library. |
[Introduction]- [News]- [Download]- [Screenshots]- [Tutorial]- [Forums-Eng]- [Forums-Fr]- [Reference]- [SourceForge Repository ]

- Main Page
- Modules
- Namespaces
- Classes

- Class List
- Class Hierarchy
- Class Members

# CImg Struct Template Reference

Class representing an image (up to 4 dimensions wide), each pixel being of type `T`. More...

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)
| Construct 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)
| Construct an image of size (`dx`,`dy`,`dz`,`dv`) with pixels of type `T` and set all pixel values to `val`.
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)
| Construct an image of size (`dx`,`dy`,`dz`,`dv`) with pixels of type `T`, from a raw pixel buffer `data_buffer`.
| CImg (const char *const filename)
| Construct an image from the filename `filename`.
template<typename t>
| CImg (const CImg< t > &img)
| Copy constructor.
template<typename t>
| CImg (const CImg< t > &img, const bool pixel_copy)
| Construct an image with same size as the source image `img`, and copy pixel values if `pixel_copy` is `true`.
template<typename t>
CImg< T > & | operator= (const CImg< t > &img)
| Assignement operator.
| ~CImg ()
| Destructor.
CImg & | assign (const unsigned int dx=0, const unsigned int dy=1, const unsigned int dz=1, const unsigned int dv=1)
| In-place version of the corresponding constructor.
CImg & | assign (const unsigned int dx, const unsigned int dy, const unsigned int dz, const unsigned int dv, const T &val)
| In-place version of the corresponding constructor.
template<typename t>
CImg & | assign (const t *const data_buffer, const unsigned int dx, const unsigned int dy=1, const unsigned int dz=1, const unsigned int dv=1)
| In-place version of the corresponding constructor.
CImg & | assign (const char *const filename)
| In-place version of the corresponding constructor.
template<typename t>
CImg & | assign (const CImg< t > &img)
| In-place version of the corresponding constructor.
template<typename t>
CImg & | assign (const CImg< t > &img, const bool pixel_copy)
| In-place version of the corresponding constructor.
CImg & | empty ()
| In-place version of the destructor.
CImg & | clear ()
| Equivalent to empty() (introduced as a STL-like function name).
static CImg | get_empty ()
| Return an empty image.
## Access to image informations
unsigned long | size () const
| Return the total number of pixel values in an image.
int | dimx () const
| Return the number of columns of the instance image (size along the X-axis, i.e image width).
int | dimy () const
| Return the number of rows of the instance image (size along the Y-axis, i.e image height).
int | dimz () const
| Return the number of slices of the instance image (size along the Z-axis).
int | dimv () const
| Return the number of vector channels of the instance image (size along the V-axis).
template<typename t>
bool | is_sameX (const CImg< t > &img) const
| Return `true` if images ``(*this) and `img` have same width.
template<typename t>
bool | is_sameY (const CImg< t > &img) const
| Return `true` if images ``(*this) and `img` have same height.
template<typename t>
bool | is_sameZ (const CImg< t > &img) const
| Return `true` if images ``(*this) and `img` have same depth.
template<typename t>
bool | is_sameV (const CImg< t > &img) const
| Return `true` if images ``(*this) and `img` have same dim.
template<typename t>
bool | is_sameXY (const CImg< t > &img) const
| Return `true` if images have same width and same height.
template<typename t>
bool | is_sameXYZ (const CImg< t > &img) const
| Return `true` if images have same width, same height and same depth.
template<typename t>
bool | is_sameXYZV (const CImg< t > &img) const
| Return `true` if images ``(*this) and `img` have same width, same height, same depth and same number of channels.
bool | is_empty () const
| Return `true` if image is empty.
long | offset (const int x=0, const int y=0, const int z=0, const int v=0) const
| Return the offset of the pixel coordinates (`x`,`y`,`z`,`v`) with respect to the data pointer `data`.
T * | ptr (const unsigned int x=0, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0)
| Return a pointer to the pixel value located at (`x`,`y`,`z`,`v`).
iterator | begin ()
| Return an iterator to the first image pixel.
iterator | end ()
| Return an iterator to the last image pixel.
T & | operator() (const unsigned int x, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0)
| Fast access to pixel value for reading or writing.
T & | at (const unsigned int x, const unsigned int y=0, const unsigned int z=0, const unsigned int v=0)
| Return pixel value at a given position. Equivalent to operator().
T & | operator[] (const unsigned long off)
| Fast access to pixel value for reading or writing, using an offset to the image pixel.
T & | back ()
| Return a reference to the last image value.
T & | front ()
| Return a reference to the first image value.
T | pix4d (const int x, const int y, const int z, const int v, const T &out_val) const
| Read a pixel value with Dirichlet or Neumann boundary conditions.
T | pix3d (const int x, const int y, const int z, const int v, const T &out_val) const
| Read a pixel value with Dirichlet or Neumann boundary conditions for the three first coordinates (`x`,`y`,`z`).
T | pix2d (const int x, const int y, const int z, const int v, const T &out_val) const
| Read a pixel value with Dirichlet or Neumann boundary conditions for the two first coordinates (`x`,`y`).
T | pix1d (const int x, const int y, const int z, const int v, const T &out_val) const
| Read a pixel value with Dirichlet or Neumann boundary conditions for the first coordinate `x`.
cimg::largest< T, float >::type | linear_pix4d (const float fx, const float fy, const float fz, const float fv, const T &out_val) const
| Read a pixel value using linear interpolation.
cimg::largest< T, float >::type | linear_pix3d (const float fx, const float fy, const float fz, const int v, const T &out_val) const
| Read a pixel value using linear interpolation for the three first coordinates (`cx`,`cy`,`cz`).
cimg::largest< T, float >::type | linear_pix2d (const float fx, const float fy, const int z, const int v, const T &out_val) const
| Read a pixel value using linear interpolation for the two first coordinates (`cx`,`cy`).
cimg::largest< T, float >::type | linear_pix1d (const float fx, const int y, const int z, const int v, const T &out_val) const
| Read a pixel value using linear interpolation for the first coordinate `cx`.
cimg::largest< T, float >::type | cubic_pix1d (const float fx, const int y, const int z, const int v, const T &out_val) const
| Read a pixel value using cubic interpolation for the first coordinate `cx`.
cimg::largest< T, float >::type | cubic_pix2d (const float fx, const float fy, const int z, const int v, const T &out_val) const
| Read a pixel value using bicubic interpolation.
const CImg & | print (const char *title=0, const unsigned int print_flag=1) const
| Display informations about the image on the standard error output.
const CImg & | print (const unsigned int print_flag) const
| Display informations about the image on the standart output.
static const char * | pixel_type ()
| Return the type of the pixel values.
## Arithmetic and Boolean operators
CImg & | operator= (const T &val)
| Assign a value to each image pixel of the instance image.
CImg & | operator= (const T *buf)
| Assign values of a C-array to the instance image.
CImg | operator+ (const T &val) const
| Addition.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | operator+ (const CImg< t > &img) const
| Addition.
CImg & | operator+= (const T &val)
| In-place addition.
template<typename t>
CImg & | operator+= (const CImg< t > &img)
| In-place addition.
CImg & | operator++ ()
| In-place increment.
CImg | operator- (const T &val) const
| Substraction.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | operator- (const CImg< t > &img) const
| Substraction.
CImg & | operator-= (const T &val)
| In-place substraction.
template<typename t>
CImg & | operator-= (const CImg< t > &img)
| In-place substraction.
CImg & | operator-- ()
| In-place decrement.
CImg | operator * (const double val) const
| Multiplication.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | operator * (const CImg< t > &img) const
| Multiplication.
template<typename t>
CImgl< typename cimg::largest< T, t >::type > | operator * (const CImgl< t > &list) const
| Matrix multiplication with an image list.
CImg & | operator *= (const double val)
| In-place multiplication.
template<typename t>
CImg & | operator *= (const CImg< t > &img)
| In-place multiplication.
CImg | operator/ (const double val) const
| Division.
CImg & | operator/= (const double val)
| In-place division.
CImg | operator% (const T &val) const
| Modulo.
CImg | operator% (const CImg &img) const
| Modulo.
CImg & | operator%= (const T &val)
| In-place modulo.
CImg & | operator%= (const CImg &img)
| In-place modulo.
CImg | operator & (const T &val) const
| Bitwise AND.
CImg | operator & (const CImg &img) const
| Bitwise AND.
CImg & | operator &= (const T &val)
| In-place bitwise AND.
CImg & | operator &= (const CImg &img)
| In-place bitwise AND.
CImg | operator| (const T &val) const
| Bitwise OR.
CImg | operator| (const CImg &img) const
| Bitwise OR.
CImg & | operator|= (const T &val)
| In-place bitwise OR.
CImg & | operator|= (const CImg &img)
| In-place bitwise OR.
CImg | operator^ (const T &val) const
| Bitwise XOR.
CImg | operator^ (const CImg &img) const
| Bitwise XOR.
CImg & | operator^= (const T &val)
| In-place bitwise XOR.
CImg & | operator^= (const CImg &img)
| In-place bitwise XOR.
CImg | operator! () const
| Boolean NOT.
CImg | operator~ () const
| Bitwise NOT.
template<typename t>
bool | operator== (const CImg< t > &img) const
| Boolean equality.
template<typename t>
bool | operator!= (const CImg< t > &img) const
| Boolean difference.
CImg | operator+ (const T &val, const CImg< T > &img)
| Addition.
CImg | operator- (const T &val, const CImg< T > &img)
| Substraction.
CImg | operator * (const double val, const CImg &img)
| Multiplication.
## Usual mathematical operations
template<typename ts, typename td>
CImg & | apply (td(*func)(ts))
| Apply a R->R function on all image value.
template<typename ts, typename td>
CImg< typename cimg::largest< T, td >::type > | get_apply (td(*func)(ts))
| Return an image where each pixel value is equal to func(x).
template<typename t>
CImg & | mul (const CImg< t > &img)
| In-place pointwise multiplication between `*this` and `img`.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | get_mul (const CImg< t > &img) const
| Pointwise multiplication between `*this` and `img`.
template<typename t>
CImg & | div (const CImg< t > &img)
| Replace the image by the pointwise division between `*this` and `img`.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | get_div (const CImg< t > &img) const
| Return an image from a pointwise division between `*this` and `img`.
template<typename t>
CImg & | max (const CImg< t > &img)
| Replace the image by the pointwise max operator between `*this` and `img`.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | get_max (const CImg< t > &img) const
| Return the image corresponding to the max value for each pixel.
CImg & | max (const T &val)
| Replace the image by the pointwise max operator between `*this` and `val`.
CImg | get_max (const T &val) const
| Return the image corresponding to the max value for each pixel.
template<typename t>
CImg & | min (const CImg< t > &img)
| Replace the image by the pointwise min operator between `*this` and `img`.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | get_min (const CImg< t > &img) const
| Return the image corresponding to the min value for each pixel.
CImg & | min (const T &val)
| Replace the image by the pointwise min operator between `*this` and `val`.
CImg | get_min (const T &val) const
| Return the image corresponding to the min value for each pixel.
CImg & | sqrt ()
| Replace each image pixel by its square root.
CImg< typename cimg::largest< T, float >::type > | get_sqrt () const
| Return the image of the square root of the pixel values.
CImg & | log ()
| Replace each image pixel by its log.
CImg< typename cimg::largest< T, float >::type > | get_log () const
| Return the image of the log of the pixel values.
CImg & | log10 ()
| Replace each image pixel by its log10.
CImg< typename cimg::largest< T, float >::type > | get_log10 () const
| Return the image of the log10 of the pixel values.
CImg & | pow (const double p)
| Replace each image pixel by its power by `p`.
CImg< typename cimg::largest< T, float >::type > | get_pow (const double p) const
| Return the image of the square root of the pixel values.
template<typename t>
CImg & | pow (const CImg< t > &img)
| Return each image pixel (*this)(x,y,z,k) by its power by `img(x,y,z,k)`.
template<typename t>
CImg< typename cimg::largest< T, float >::type > | get_pow (const CImg< t > &img) const
| Return each image pixel (*this)(x,y,z,k) by its power by `img(x,y,z,k)`.
CImg & | abs ()
| Replace each pixel value by its absolute value.
CImg< typename cimg::largest< T, float >::type > | get_abs () const
| Return the image of the absolute value of the pixel values.
CImg & | cos ()
| Replace each image pixel by its cosinus.
CImg< typename cimg::largest< T, float >::type > | get_cos () const
| Return the image of the cosinus of the pixel values.
CImg & | sin ()
| Replace each image pixel by its sinus.
CImg< typename cimg::largest< T, float >::type > | get_sin () const
| Return the image of the sinus of the pixel values.
CImg & | tan ()
| Replace each image pixel by its tangent.
CImg< typename cimg::largest< T, float >::type > | get_tan () const
| Return the image of the tangent of the pixel values.
template<typename t>
double | MSE (const CImg< t > &img) const
| Return the MSE (Mean-Squared Error) between two images.
template<typename t>
double | PSNR (const CImg< t > &img, const double valmax=255.0) const
| Return the PSNR between two images.
## Usual image transformation
CImg & | fill (const T &val)
| Fill an image by a value `val`.
CImg & | fill (const T &val0, const T &val1)
| Fill sequentially all pixel values with values val0 and val1 respectively.
CImg & | fill (const T &val0, const T &val1, const T &val2)
| Fill sequentially all pixel values with values val0 and val1 and val2.
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.
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.
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.
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.
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.
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.
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.
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.
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)
| Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val11.
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.
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, const T &val16, const T &val17, const T &val18, const T &val19, const T &val20, const T &val21, const T &val22, const T &val23, const T &val24)
| Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val24.
CImg & | normalize (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.
CImg & | cut (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.
CImg & | quantize (const unsigned int n=256)
| Quantize pixel values into levels.
CImg | get_quantize (const unsigned int n=256) const
| Return a quantified image, with levels.
CImg & | threshold (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=3) const
| Return a rotated image.
CImg & | rotate (const float angle, const unsigned int cond=3)
| Rotate the image.
CImg | get_rotate (const float angle, const float cx, const float cy, const float zoom=1, const unsigned int cond=3) const
| Return a rotated image around the point (`cx`,`cy`).
CImg & | rotate (const float angle, const float cx, const float cy, const float zoom=1, const unsigned int cond=3)
| 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.
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.
template<typename t>
CImg & | resize (const CImg< t > &src, const unsigned int interp=1)
| Resize the image.
CImg & | resize (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.
CImg & | resize_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.
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.
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.
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.
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.
CImg | get_shared_points (const unsigned int x0, const unsigned int x1, const unsigned int y0=0, const unsigned int z0=0, const unsigned int v0=0)
| Get a shared-memory image referencing a set of points of the instance image.
const CImg | get_shared_points (const unsigned int x0, const unsigned int x1, const unsigned int y0=0, const unsigned int z0=0, const unsigned int v0=0) const
| Get a shared-memory image referencing a set of points of the instance image (const version).
CImg | get_points (const unsigned int x0, const unsigned int x1, const unsigned int y0=0, const unsigned int z0=0, const unsigned int v0=0) const
| Get a copy of a set of points of the instance image.
CImg | get_shared_lines (const unsigned int y0, const unsigned int y1, const unsigned int z0=0, const unsigned int v0=0)
| Return a shared-memory image referencing a set of lines of the instance image.
const CImg | get_shared_lines (const unsigned int y0, const unsigned int y1, const unsigned int z0=0, const unsigned int v0=0) const
| Return a shared-memory image referencing a set of lines of the instance image (const version).
CImg | get_lines (const unsigned int y0, const unsigned int y1, const unsigned int z0=0, const unsigned int v0=0) const
| Get a copy of a set of lines of the instance image.
CImg & | lines (const unsigned int y0, const unsigned int y1, const unsigned int z0=0, const unsigned int v0=0) const
| Replace the instance image by a set of lines of the instance image.
CImg | get_shared_line (const unsigned int y0, const unsigned int z0=0, const unsigned int v0=0)
| Return a shared-memory image referencing one particular line (y0,z0,v0) of the instance image.
const CImg | get_shared_line (const unsigned int y0, const unsigned int z0=0, const unsigned int v0=0) const
| Return a shared-memory image referencing one particular line (y0,z0,v0) of the instance image (const version).
CImg | get_line (const unsigned int y0, const unsigned int z0=0, const unsigned int v0=0) const
| Get a copy of a line of the instance image.
CImg & | line (const unsigned int y0, const unsigned int z0=0, const unsigned int v0=0)
| Replace the instance image by one of its line.
CImg | get_shared_planes (const unsigned int z0, const unsigned int z1, const unsigned int v0=0)
| Return a shared memory image referencing a set of planes (z0->z1,v0) of the instance image.
const CImg | get_shared_planes (const unsigned int z0, const unsigned int z1, const unsigned int v0=0) const
| Return a shared-memory image referencing a set of planes (z0->z1,v0) of the instance image (const version).
CImg | get_planes (const unsigned int z0, const unsigned int z1, const unsigned int v0=0) const
| Return a copy of a set of planes of the instance image.
CImg & | planes (const unsigned int z0, const unsigned int z1, const unsigned int v0=0)
| Replace the instance image by a set of planes of the instance image.
CImg | get_shared_plane (const unsigned int z0, const unsigned int v0=0)
| Return a shared-memory image referencing one plane (z0,v0) of the instance image.
const CImg | get_shared_plane (const unsigned int z0, const unsigned int v0=0) const
| Return a shared-memory image referencing one plane (z0,v0) of the instance image (const version).
CImg | get_plane (const unsigned int z0, const unsigned int v0=0) const
| Return a copy of a plane of the instance image.
CImg & | plane (const unsigned int z0, const unsigned int v0=0)
| Replace the instance image by one plane of the instance image.
CImg | get_shared_channels (const unsigned int v0, const unsigned int v1)
| Return a shared-memory image referencing a set of channels (v0->v1) of the instance image.
const CImg | get_shared_channels (const unsigned int v0, const unsigned int v1) const
| Return a shared-memory image referencing a set of channels (v0->v1) of the instance image (const version).
CImg | get_channels (const unsigned int v0, const unsigned int v1) const
| Return a copy of a set of channels of the instance image.
CImg & | channels (const unsigned int v0, const unsigned int v1)
| Replace the instance image by a set of channels of the instance image.
CImg | get_shared_channel (const unsigned int v0)
| Return a shared-memory image referencing one channel v0 of the instance image.
const CImg | get_shared_channel (const unsigned int v0) const
| Return a shared-memory image referencing one channel v0 of the instance image (const version).
CImg | get_channel (const unsigned int v0) const
| Return a copy of a channel of the instance image.
CImg & | channel (const unsigned int v0)
| Replace the instance image by one of its channel.
CImg | get_shared ()
| Return a shared version of the instance image.
const CImg | get_shared () const
| Return a shared version of the instance image (const version).
CImg | get_slice (const unsigned int z0=0) const
| Get the z-slice z of *this, as a new image.
CImg & | slice (const unsigned int z0)
| Replace the image by one of its slice.
CImg & | mirror (const char axe='x')
| Mirror an image along the specified axis.
CImg | get_mirror (const char axe='x')
| Get a mirrored version of the image, along the specified axis.
CImg & | scroll (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_projections2d (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 image histogram.
CImg & | equalize_histogram (const unsigned int nblevels=256, const T val_min=(T) 0, const T val_max=(T) 0)
| Equalize the image histogram.
CImg | get_equalize_histogram (const unsigned int nblevels=256, const T val_min=(T) 0, const T val_max=(T) 0) const
| Return the histogram-equalized version of the current image.
CImg< typename cimg::largest< T, float >::type > | get_norm_pointwise (int norm_type=2) const
| Return the scalar image of vector norms.
CImg & | norm_pointwise ()
| Replace each pixel value with its vector norm.
CImg< typename cimg::largest< T, float >::type > | get_orientation_pointwise () const
| Return the image of normalized vectors.
CImg & | orientation_pointwise ()
| Replace each pixel value by its normalized vector.
CImgl< T > | get_split (const char axe, const unsigned int nb=0) const
| Split image into a list CImgl<>.
CImg | get_append (const CImg< T > &img, const char axis='x', const char align='c') const
| Append an image to another one.
CImg & | append (const CImg< T > &img, const char axis='x', const char align='c')
| Append an image to another one (in-place version).
CImg & | operator<< (const CImg< T > &img)
| Append an image to another one (in-place operator<< version).
CImgl< typename cimg::largest< T, float >::type > | get_gradientXY (const int scheme=0) const
| Return a list of images, corresponding to the XY-gradients of an image.
CImgl< typename cimg::largest< T, float >::type > | get_gradientXYZ (const int scheme=0) const
| Return a list of images, corresponding to the XYZ-gradients of an image.
template<typename tp, typename tf>
const CImg & | marching_cubes (const float isovalue, CImgl< tp > &points, CImgl< tf > &primitives, const bool invert_faces=false) const
| Get a triangularization of an implicit function defined by the instance image.
template<typename tp, typename tf>
const CImg & | marching_cubes (const float isovalue, const float resx, const float resy, const float resz, CImgl< tp > &points, CImgl< tf > &primitives, const bool invert_faces=false) const
| Get a triangularization of an implicit function defined by the instance image.
template<typename tp, typename tf>
const CImg & | marching_squares (const float isovalue, CImgl< tp > &points, CImgl< tf > &primitives) const
| Get a vectorization of an implicit function defined by the instance image.
template<typename tp, typename tf>
const CImg & | marching_squares (const float isovalue, const float resx, const float resy, CImgl< tp > &points, CImgl< tf > &primitives) const
| Get a vectorization of an implicit function defined by the instance image.
## Color conversion functions
template<typename t>
CImg< t > | get_RGBtoLUT (const CImg< t > &palette, const bool dithering=true, const bool indexing=false) const
| Convert color pixels from (R,G,B) to match a specified palette.
CImg< T > | get_RGBtoLUT (const bool dithering=true, const bool indexing=false) const
| Convert color pixels from (R,G,B) to match the default 256 colors palette.
CImg & | RGBtoLUT (const CImg< T > &palette, const bool dithering=true, const bool indexing=false)
| Convert color pixels from (R,G,B) to match the specified color palette.
CImg & | RGBtoLUT (const bool dithering=true, const bool indexing=false)
| Convert color pixels from (R,G,B) to match the specified color palette.
template<typename t>
CImg< t > | get_LUTtoRGB (const CImg< t > &palette) const
| Convert an indexed image to a (R,G,B) image using the specified color palette.
CImg< T > | get_LUTtoRGB () const
| Convert an indexed image (with the default palette) to a (R,G,B) image.
CImg & | LUTtoRGB (const CImg< T > &palette)
| In-place version of get_LUTtoRGB().
CImg & | LUTtoRGB ()
| In-place version of get_LUTroRGB().
CImg & | RGBtoHSV ()
| Convert color pixels from (R,G,B) to (H,S,V).
CImg & | HSVtoRGB ()
| Convert color pixels from (H,S,V) to (R,G,B).
CImg & | RGBtoYCbCr ()
| Convert color pixels from (R,G,B) to (Y,Cb,Cr)_8 (Thanks to Chen Wang).
CImg & | YCbCrtoRGB ()
| Convert color pixels from (Y,Cb,Cr)_8 to (R,G,B).
CImg & | RGBtoYUV ()
| Convert color pixels from (R,G,B) to (Y,U,V).
CImg & | YUVtoRGB ()
| Convert color pixels from (Y,U,V) to (R,G,B).
CImg & | RGBtoXYZ ()
| Convert color pixels from (R,G,B) to (X,Y,Z)_709.
CImg & | XYZtoRGB ()
| Convert (X,Y,Z)_709 pixels of a color image into the (R,G,B) color space.
CImg & | LabtoXYZ ()
| Convert (L,a,b) pixels of a color image into the (X,Y,Z) color space.
CImg & | XYZtoxyY ()
| Convert (X,Y,Z)_709 pixels of a color image into the (x,y,Y) color space.
CImg & | xyYtoXYZ ()
| Convert (x,y,Y) pixels of a color image into the (X,Y,Z)_709 color space.
CImg & | RGBtoLab ()
| In-place version of get_RGBtoLab().
CImg & | LabtoRGB ()
| In-place version of get_LabtoRGb().
CImg & | RGBtoxyY ()
| In-place version of get_RGBtoxyY().
CImg & | xyYtoRGB ()
| In-place version of get_xyYtoRGB().
CImg | get_RGBtoHSV () const
| Convert a (R,G,B) image to a (H,S,V) one.
CImg | get_HSVtoRGB () const
| Convert a (H,S,V) image to a (R,G,B) one.
CImg | get_RGBtoYCbCr () const
| Convert a (R,G,B) image to a (Y,Cb,Cr) one.
CImg | get_YCbCrtoRGB () const
| Convert a (Y,Cb,Cr) image to a (R,G,B) one.
CImg< typename cimg::largest< T, float >::type > | get_RGBtoYUV () const
| Convert a (R,G,B) image into a (Y,U,V) one.
CImg | get_YUVtoRGB () const
| Convert a (Y,U,V) image into a (R,G,B) one.
CImg< typename cimg::largest< T, float >::type > | get_RGBtoXYZ () const
| Convert a (R,G,B) image to a (X,Y,Z) one.
CImg | get_XYZtoRGB () const
| Convert a (X,Y,Z) image to a (R,G,B) one.
CImg | get_XYZtoLab () const
| Convert a (X,Y,Z) image to a (L,a,b) one.
CImg | get_LabtoXYZ () const
| Convert a (L,a,b) image to a (X,Y,Z) one.
CImg | get_XYZtoxyY () const
| Convert a (X,Y,Z) image to a (x,y,Y) one.
CImg | get_xyYtoXYZ () const
| Convert a (x,y,Y) image to a (X,Y,Z) one.
CImg | get_RGBtoLab () const
| Convert a (R,G,B) image to a (L,a,b) one.
CImg | get_LabtoRGB () const
| Convert a (L,a,b) image to a (R,G,B) one.
CImg | get_RGBtoxyY () const
| Convert a (R,G,B) image to a (x,y,Y) one.
CImg | get_xyYtoRGB () const
| Convert a (x,y,Y) image to a (R,G,B) one.
static CImg< T > | get_default_LUT8 ()
| Return the default 256 colors palette.
## Drawing functions
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`).
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`).
CImg & | draw_line (const int x0, const int y0, const int x1, const int y1, const T *const color, const unsigned int pattern=~0L, const float opacity=1)
| Draw a 2D colored line in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`).
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 int 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>
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`).
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 int pattern=~0L, const float opacity=1)
| Draw a 2D colored arrow in the instance image, at coordinates (`x0`,`y0`)->(`x1`,`y1`).
template<typename t>
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`).
template<typename ti, typename tm>
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`).
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, const float opacity=1.0f)
| Draw a 4D filled rectangle in the instance image, at coordinates (`x0`,`y0`,`z0`,`v0`)-(`x1`,`y1`,`z1`,`v1`).
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`).
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`).
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, const float brightness=1)
| Draw a 2D filled colored triangle in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`)-(`x2`,`y2`).
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 c0, const float c1, const float c2, const float opacity=1)
| Draw a 2D Gouraud-filled triangle in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`)-(`x2`,`y2`).
template<typename t>
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 CImg< t > &light, const int lx0, const int ly0, const int lx1, const int ly1, const int lx2, const int ly2, const float opacity=1.0f)
| Draw a 2D phong-shaded triangle in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`)-(`x2`,`y2`).
template<typename t>
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.0f, const float brightness=1.0f)
| Draw a 2D textured triangle in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`)-(`x2`,`y2`).
template<typename t>
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 c0, const float c1, const float c2, const float opacity=1)
| Draw a 2D textured triangle with Gouraud-Shading in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`)-(`x2`,`y2`).
template<typename t, typename tl>
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 CImg< tl > &light, const int lx0, const int ly0, const int lx1, const int ly1, const int lx2, const int ly2, const float opacity=1.0f)
| Draw a phong-shaded 2D textured triangle in the instance image, at coordinates (`x0`,`y0`)-(`x1`,`y1`)-(`x2`,`y2`).
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 unsigned int pattern=0L, const float opacity=1)
| Draw an ellipse on the instance image.
template<typename t>
CImg & | draw_ellipse (const int x0, const int y0, const CImg< t > &tensor, const T *color, const unsigned int pattern=0L, const float opacity=1)
| Draw an ellipse on the instance image.
CImg & | draw_circle (const int x0, const int y0, float r, const T *const color, const unsigned int pattern=0L, const float opacity=1)
| Draw a circle on the instance image.
template<typename t>
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.
CImg & | draw_text (const char *const text, const int x0, const int y0, const T *const fgcolor, const T *const bgcolor=0, const unsigned int font_size=11, const float opacity=1.0f)
| Draw a text into the instance image.
CImg & | draw_text (const int x0, const int y0, const T *const fgcolor, const T *const bgcolor, const unsigned int font_size, const float opacity, const char *format,...)
| Draw a text into the instance image.
template<typename t>
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.
template<typename t1, typename t2>
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.
template<typename t>
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.
template<typename t>
CImg & | draw_axe (const CImg< t > &xvalues, const int y, const T *const color, const int precision=-1, const float opacity=1.0f)
| Draw a labelled horizontal axis on the instance image.
template<typename t>
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.
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.
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.
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.
CImg & | draw_plasma (const double alpha=1.0, const double beta=1.0, const float opacity=1)
| Draw a plasma in the instance image.
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.
template<typename t>
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.
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.
template<typename t>
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.
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.
template<typename tp, typename tf, typename to>
CImg & | draw_object3d (const float X, const float Y, const float Z, const CImg< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImg< to > &opacities, const unsigned int render_type=4, const bool double_sided=false, const float focale=500, const float lightx=0, const float lighty=0, const float lightz=-5000, const float ambiant_light=0.05f)
| Draw a 3D object in the instance image.
template<typename tp, typename tf, typename to>
CImg & | draw_object3d (const float X, const float Y, const float Z, const CImg< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImgl< to > &opacities, const unsigned int render_type=4, const bool double_sided=false, const float focale=500, const float lightx=0, const float lighty=0, const float lightz=-5000, const float ambiant_light=0.05f)
| Draw a 3D object in the instance image.
template<typename tp, typename tf, typename to>
CImg & | draw_object3d (const float X, const float Y, const float Z, const CImgl< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImg< to > &opacities, const unsigned int render_type=4, const bool double_sided=false, const float focale=500, const float lightx=0, const float lighty=0, const float lightz=-5000, const float ambiant_light=0.05f)
| Draw a 3D object in the instance image.
template<typename tp, typename tf, typename to>
CImg & | draw_object3d (const float X, const float Y, const float Z, const CImgl< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImgl< to > &opacities, const unsigned int render_type=4, const bool double_sided=false, const float focale=500, const float lightx=0, const float lighty=0, const float lightz=-5000, const float ambiant_light=0.05f)
| Draw a 3D object in the instance image.
template<typename tp, typename tf>
CImg & | draw_object3d (const float X, const float Y, const float Z, const tp &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const unsigned int render_type=4, const bool double_sided=false, const float focale=500, const float lightx=0, const float lighty=0, const float lightz=-5000, const float ambiant_light=0.05f, const float opacity=1.0f)
| Draw a 3D object in the instance image.
## Filtering functions
template<typename t>
CImg< typename cimg::largest< T, t >::type > | 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>
CImg & | correlate (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_correl=false)
| Correlate the image by a mask.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | 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>
CImg & | convolve (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_convol=false)
| Convolve the image by a mask.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | get_erode (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_erosion=false) const
| Return the erosion of the image by a structuring element.
template<typename t>
CImg & | erode (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_erosion=false)
| Erode the image by a structuring element.
CImg | get_erode (const unsigned int n=1, const unsigned int cond=1) const
| Erode the image by a square structuring element of size n.
CImg & | erode (const unsigned int n=1, const unsigned int cond=1)
| Erode the image by a square structuring element of size n.
template<typename t>
CImg< typename cimg::largest< T, t >::type > | get_dilate (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_dilatation=false) const
| Return the dilatation of the image by a structuring element.
template<typename t>
CImg & | dilate (const CImg< t > &mask, const unsigned int cond=1, const bool weighted_dilatation=false)
| Dilate the image by a structuring element.
CImg | get_dilate (const unsigned int n=1, const unsigned int cond=1) const
| Dilate the image by a square structuring element of size n.
CImg & | dilate (const unsigned int n=1, const unsigned int cond=1)
| Dilate the image by a square structuring element of size n.
CImg & | noise (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.
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.
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.
CImg & | blur (const float sigmax, const float sigmay, const float sigmaz, const unsigned int cond=1)
| Blur the image with a Deriche filter (anisotropically).
CImg & | blur (const float sigma, const unsigned int cond=1)
| Blur the image with a Canny-Deriche 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 Canny-Deriche filter.
CImg | get_blur (const float sigma, const unsigned int cond=1) const
| Return a blurred version of the image, using a Canny-Deriche filter.
template<typename t>
CImg & | blur_anisotropic (const CImg< t > &G, const float amplitude=30.0f, const float dl=0.8f, const float da=30.0f, const float gauss_prec=2.0f, const unsigned int interpolation=0, const bool fast_approx=true)
| Blur an image following a field of diffusion tensors.
template<typename t>
CImg | get_blur_anisotropic (const CImg< t > &G, const float amplitude=30.0f, const float dl=0.8f, const float da=30.0f, const float gauss_prec=2.0f, const unsigned int interpolation=0, const bool fast_approx=true) const
| Get a blurred version of an image following a field of diffusion tensors.
CImg & | blur_anisotropic (const float amplitude, const float sharpness=0.8f, const float anisotropy=0.3f, const float alpha=1.2f, const float sigma=0.8f, const float dl=0.8f, const float da=30.0f, const float gauss_prec=2.0f, const unsigned int interpolation=0, const bool fast_approx=true)
| Blur an image following a field of diffusion tensors.
CImg | get_blur_anisotropic (const float amplitude, const float sharpness=0.8f, const float anisotropy=0.3f, const float alpha=1.2f, const float sigma=0.8f, const float dl=0.8f, const float da=30.0f, const float gauss_prec=2.0f, const unsigned int interpolation=0, const bool fast_approx=true) const
| Blur an image in an anisotropic way.
CImgl< typename cimg::largest< T, float >::type > | get_FFT (const char axe, const bool inverse=false) const
| Return the Fast Fourier Transform of an image (along a specified axis).
CImgl< typename cimg::largest< T, float >::type > | get_FFT (const bool inverse=false) const
| Return the Fast Fourier Transform on an image.
CImg | get_blur_median (const unsigned int n=3)
| Apply a median filter.
CImg & | blur_median (const unsigned int n=3)
| Apply a median filter.
## Matrix and vector computation
CImg & | vector ()
| Unroll all image values into a vector.
CImg | get_diagonal () const
| Get a diagonal matrix, whose diagonal coefficients are the coefficients of the input image.
CImg & | diagonal ()
| Replace a vector by a diagonal matrix containing the original vector coefficients.
CImg & | sequence (const T &a0, const T &a1)
| Return a N-numbered sequence vector from `a0` to `a1`.
CImg | get_vector_at (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_at (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_at (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.
CImg & | set_vector_at (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.
CImg & | set_matrix_at (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.
CImg & | set_tensor_at (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.
CImg | get_transpose () const
| Return the transpose version of the current matrix.
CImg & | transpose ()
| Replace the current matrix by its transpose.
CImg & | inverse (const bool use_LU=true)
| Inverse the current matrix.
CImg< typename cimg::largest< T, float >::type > | get_inverse (const bool use_LU=true) const
| Return the inverse of the current matrix.
CImg< typename cimg::largest< T, float >::type > | get_pseudoinverse () const
| Return the pseudo-inverse (Moore-Penrose) of the matrix.
CImg & | pseudoinverse ()
| Replace the matrix by its pseudo-inverse.
double | trace () const
| Return the trace of the current matrix.
const T | kth_smallest (const unsigned int k) const
| Return the kth smallest element of the image.
const T | median () const
| Return the median of the image.
double | dot (const CImg &img) const
| Return the dot product of the current vector/matrix with the vector/matrix `img`.
CImg & | cross (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 & | SVD (CImg< t > &U, CImg< t > &S, CImg< t > &V, const bool sorting=true, const unsigned int max_iter=40) const
| Compute the SVD of a general matrix.
template<typename t>
const CImg & | SVD (CImgl< t > &USV) const
| Compute the SVD of a general matrix.
CImgl< typename cimg::largest< T, float >::type > | get_SVD (const bool sorting=true) const
| Compute the SVD of a general matrix.
CImg & | solve (const CImg &A)
| Solve a linear system AX=B where B=*this. (in-place version).
CImg< typename cimg::largest< T, float >::type > | get_solve (const CImg &A) const
| Solve a linear system AX=B where B=*this.
template<typename t>
const CImg< T > & | eigen (CImg< t > &val, CImg< t > &vec) const
| Compute the eigenvalues and eigenvectors of a matrix.
CImgl< typename cimg::largest< T, float >::type > | 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 > & | symmetric_eigen (CImg< t > &val, CImg< t > &vec) const
| Compute the eigenvalues and eigenvectors of a symmetric matrix.
CImgl< typename cimg::largest< T, float >::type > | get_symmetric_eigen () const
| Compute the eigenvalues and eigenvectors of a symmetric matrix.
template<typename t>
const CImg< T > & | symmetric_eigen (CImgl< t > &eig) const
| Compute the eigenvalues and eigenvectors of a symmetric matrix.
template<typename t>
CImg< T > & | sort (CImg< t > &permutations, const bool increasing=true)
| Sort values of a vector and get permutations.
CImg< T > & | sort (const bool increasing=true)
| Sort values of a vector.
template<typename t>
CImg< T > | get_sort (CImg< t > &permutations, const bool increasing=true)
| Get a sorted version a of vector, with permutations.
CImg< T > | get_sort (const bool increasing=true)
| Get a sorted version of a vector.
static CImg | vector (const T &a1)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9, const T &a10)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9, const T &a10, const T &a11)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9, const T &a10, const T &a11, const T &a12)
| Return a vector with specified coefficients.
static CImg | vector (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9, const T &a10, const T &a11, const T &a12, const T &a13)
| Return a vector with specified coefficients.
static CImg | matrix (const T &a1)
| Return a 1x1 square matrix with specified coefficients.
static CImg | matrix (const T &a1, const T &a2, const T &a3, const T &a4)
| Return a 2x2 square matrix with specified coefficients.
static CImg | matrix (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9)
| Return a 3x3 square matrix with specified coefficients.
static CImg | matrix (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9, const T &a10, const T &a11, const T &a12, const T &a13, const T &a14, const T &a15, const T &a16)
| Return a 4x4 square matrix with specified coefficients.
static CImg | matrix (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6, const T &a7, const T &a8, const T &a9, const T &a10, const T &a11, const T &a12, const T &a13, const T &a14, const T &a15, const T &a16, const T &a17, const T &a18, const T &a19, const T &a20, const T &a21, const T &a22, const T &a23, const T &a24, const T &a25)
| Return a 5x5 square matrix with specified coefficients.
static CImg | tensor (const T &a1)
| Return a 1x1 symmetric matrix with specified coefficients.
static CImg | tensor (const T &a1, const T &a2, const T &a3)
| Return a 2x2 symmetric matrix tensor with specified coefficients.
static CImg | tensor (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5, const T &a6)
| Return a 3x3 symmetric matrix with specified coefficients.
static CImg | diagonal (const T &a1)
| Return a 1x1 diagonal matrix with specified coefficients.
static CImg | diagonal (const T &a1, const T &a2)
| Return a 2x2 diagonal matrix with specified coefficients.
static CImg | diagonal (const T &a1, const T &a2, const T &a3)
| Return a 3x3 diagonal matrix with specified coefficients.
static CImg | diagonal (const T &a1, const T &a2, const T &a3, const T &a4)
| Return a 4x4 diagonal matrix with specified coefficients.
static CImg | diagonal (const T &a1, const T &a2, const T &a3, const T &a4, const T &a5)
| Return a 5x5 diagonal matrix with specified coefficients.
static CImg | identity_matrix (const unsigned int N)
| Return a NxN identity matrix.
static CImg | rotation_matrix (const float x, const float y, const float z, const float w, const bool quaternion_data=false)
| Return a 3x3 rotation matrix along the (x,y,z)-axis with an angle w.
## Display functions
const CImg & | display (CImgDisplay &disp) const
| Display an image into a CImgDisplay window.
const CImg & | display (const char *title, const int min_size=128, const int max_size=1024) const
| If negative, they corresponds to a percentage of the original image size.
const CImg & | display (const int min_size=128, const int max_size=1024) const
| Display an image in a window, with a default title. See also.
const CImg & | feature_selection (int *const selection, const int feature_type, CImgDisplay &disp, unsigned int *const XYZ=0, const unsigned char *const color=0) const
| High-level interface to select features from images.
const CImg & | feature_selection (int *const selection, const int feature_type, unsigned int *const XYZ=0, const unsigned char *const color=0) const
| High-level interface to select features in images.
template<typename tp, typename tf, typename to>
const CImg & | display_object3d (const CImg< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImg< to > &opacities, CImgDisplay &disp, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
template<typename tp, typename tf, typename to>
const CImg & | display_object3d (const CImg< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImgl< to > &opacities, CImgDisplay &disp, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
template<typename tp, typename tf, typename to>
const CImg & | display_object3d (const CImgl< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImg< to > &opacities, CImgDisplay &disp, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
template<typename tp, typename tf, typename to>
const CImg & | display_object3d (const CImgl< tp > &points, const CImgl< tf > &primitives, const CImgl< T > &colors, const CImgl< to > &opacities, CImgDisplay &disp, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
template<typename tp, typename tf, typename to>
const CImg & | display_object3d (const tp &points, const CImgl< tf > &primitives, const CImgl< T > colors, const to &opacities, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
template<typename tp, typename tf>
const CImg & | display_object3d (const tp &points, const CImgl< tf > &primitives, const CImgl< T > colors, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const float opacity=1.0f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
template<typename tp, typename tf>
const CImg & | display_object3d (const tp &points, const CImgl< tf > &primitives, const CImgl< T > colors, CImgDisplay &disp, const bool centering=true, const int render_static=4, const int render_motion=1, const bool double_sided=false, const float focale=500.0f, const float ambiant_light=0.05f, const float opacity=1.0f, const bool display_axes=true, float *const pose_matrix=0) const
| High-level interface for displaying a 3d object.
## Input-Output functions
CImg & | load (const char *filename)
| Load an image from a file.
CImg & | load_ascii (const char *filename)
| Load an image from an ASCII file (in-place version).
CImg & | load_dlm (const char *filename)
| Load an image from a DLM file (in-place version).
CImg & | load_pnm (const char *filename)
| Load an image from a PNM file (in-place version).
CImg & | load_yuv (const char *filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const int last_frame=-1, const bool yuv2rgb=true)
| Load a YUV image sequence file (in-place).
CImg & | load_bmp (const char *filename)
| Load an image from a BMP file.
CImg & | load_png (const char *filename)
| Load an image from a PNG file.
CImg & | load_jpeg (const char *filename)
| Load an image from a JPEG file.
CImg & | load_raw (const char *filename, const unsigned int sizex, const unsigned int sizey=1, const unsigned int sizez=1, const unsigned int sizev=1, const bool multiplexed=false, const bool endian_swap=false)
| In-place version of get_load_raw().
CImg & | load_rgba (const char *filename, const unsigned int dimw, const unsigned int dimh)
| In-place version of get_load_rgba().
CImg & | load_rgb (const char *filename, const unsigned int dimw, const unsigned int dimh)
| In-place version of get_load_rgb().
CImg & | load_inr (const char *filename, float *voxsize=0)
| In-place version of get_load_inr().
CImg & | load_pandore (const char *filename)
| In-place version of get_load_pandore().
CImg & | load_analyze (const char *filename, float *voxsize=0)
| In-place version of get_load_analyze().
CImg & | load_parrec (const char *filename, const char axis='v', const char align='p')
| In-place version of get_load_parrec().
CImg & | load_cimg (const char *filename, const char axis='v', const char align='p')
| In-place version of get_load_cimg().
CImg & | load_convert (const char *filename)
| In-place version of get_load_convert().
CImg & | load_dicom (const char *filename)
| In-place version of get_load_dicom().
template<typename tf, typename tc>
CImg & | load_off (const char *filename, CImgl< tf > &primitives, CImgl< tc > &colors, const bool invert_faces=false)
| In-place version of get_load_off().
const CImg & | save (const char *filename, const int number=-1) const
| Save the image as a file.
const CImg & | save_ascii (const char *filename) const
| Save the image as an ASCII file.
const CImg & | save_dlm (const char *filename) const
| Save the image as a DLM file.
const CImg & | save_pnm (const char *filename) const
| Save the image as a PNM file.
const CImg & | save_dicom (const char *filename) const
| Save an image as a Dicom file (need '(X)Medcon' : http://xmedcon.sourceforge.net ).
const CImg & | save_analyze (const char *filename, const float *const voxsize=0) const
| Save the image as an ANALYZE7.5 file.
const CImg & | save_cimg (const char *filename) const
| Save the image as a CImg RAW file.
const CImg & | save_raw (const char *filename, const bool multiplexed=false) const
| Save the image as a RAW file.
const CImg & | save_convert (const char *filename, const unsigned int quality=100) const
| Save the image using ImageMagick's convert.
const CImg & | save_inr (const char *filename, const float *const voxsize=0) const
| Save the image as an INRIMAGE-4 file.
const CImg & | save_pandore (const char *filename, const unsigned int colorspace=0) const
| Save the image as a PANDORE-5 file.
const CImg & | save_yuv (const char *filename, const bool rgb2yuv=true) const
| Save the image as a YUV file.
const CImg & | save_bmp (const char *filename) const
| Save the image as a BMP file.
const CImg & | save_png (const char *filename) const
| Save an image to a PNG file.
const CImg< T > & | save_jpeg (const char *filename, const unsigned int quality=100) const
| Save a file in JPEG format.
const CImg & | save_rgba (const char *filename) const
| Save the image as a RGBA file.
const CImg & | save_rgb (const char *filename) const
| Save the image as a RGB file.
template<typename tf, typename tc>
const CImg & | save_off (const char *filename, const CImgl< tf > &primitives, const CImgl< tc > &colors, const bool invert_faces=false) const
| Save OFF files (GeomView 3D object files).
static CImg | get_load (const char *filename)
| Load an image from a file.
static CImg | get_load_ascii (const char *filename)
| Load an image from an ASCII file.
static CImg | get_load_dlm (const char *filename)
| Load an image from a DLM file.
static CImg | get_load_pnm (const char *filename)
| Load an image from a PNM file.
static CImg | get_load_yuv (const char *filename, const unsigned int sizex, const unsigned int sizey, const unsigned int first_frame=0, const int last_frame=-1, const bool yuv2rgb=true)
| Load a YUV image sequence file.
static CImg | get_load_bmp (const char *filename)
| Load an image from a BMP file.
static CImg | get_load_png (const char *filename)
| Load an image from a PNG file.
static CImg | get_load_jpeg (const char *filename)
| Load a file in JPEG format.
static CImg | get_load_raw (const char *filename, const unsigned int sizex, const unsigned int sizey=1, const unsigned int sizez=1, const unsigned int sizev=1, const bool multiplexed=false, const bool endian_swap=false)
| Load an image from a RAW file.
static CImg | get_load_rgba (const char *filename, const unsigned int dimw, const unsigned int dimh)
| Load an image from a RGBA file.
static CImg | get_load_rgb (const char *filename, const unsigned int dimw, const unsigned int dimh)
| Load an image from a RGB file.
static CImg | get_load_inr (const char *filename, float *voxsize=0)
| Load an image from an INRIMAGE-4 file.
static CImg | get_load_pandore (const char *filename)
| Load an image from a PANDORE-5 file.
static CImg | get_load_analyze (const char *filename, float *voxsize=0)
| Load an image from an ANALYZE7.5 file.
static CImg | get_load_parrec (const char *filename, const char axe='v', const char align='p')
| Load PAR-REC (Philips) image file.
static CImg | get_load_cimg (const char *filename, const char axis='v', const char align='p')
| Load an image from a CImg RAW file.
static CImg | get_load_convert (const char *filename)
| this function working properly (see http://www.imagemagick.org ).
static CImg | get_load_dicom (const char *filename)
| Load an image from a Dicom file (need '(X)Medcon' : http://xmedcon.sourceforge.net ).
template<typename tf, typename tc>
static CImg< T > | get_load_off (const char *filename, CImgl< tf > &primitives, CImgl< tc > &colors, const bool invert_faces=false)
| Load OFF files (GeomView 3D object files).
static CImg | get_logo40x38 ()
| Get a 40x38 color logo of a 'danger' item.
## Public Types
typedef T * | iterator
| Iterator type for CImg<T>.
typedef const T * | const_iterator
| Const iterator type for CImg<T>.

## Detailed Description

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

Class representing an image (up to 4 dimensions wide), each pixel being of type `T`.

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

Image representation

A CImg image is defined as an instance of the container CImg<T>, which contains a regular grid of pixels, each pixel value being of type `T`. The image grid can have up to 4 dimensions : width, height, depth and number of channels. Usually, the three first dimensions are used to describe spatial coordinates `(x,y,z)`, while the number of channels is rather used as a vector-valued dimension (it may describe the R,G,B color channels for instance). If you need a fifth dimension, you can use image lists CImgl<T> rather than simple images CImg<T>.

Thus, the CImg<T> class is able to represent volumetric images of vector-valued pixels, as well as images with less dimensions (1D scalar signal, 2D color images, ...). Most member functions of the class CImg<T> are designed to handle this maximum case of (3+1) dimensions.

Concerning the pixel value type `T` : fully supported template types are the basic C++ types : `unsigned char, char, short, unsigned int, int, unsigned long, long, float, double, ...` . Typically, fast image display can be done using `CImg<unsigned char>` images, while complex image processing algorithms may be rather coded using `CImg<float>` or `CImg<double>` images that have floating-point pixel values. The default value for the template T is `float`. Using your own template types may be possible. However, you will certainly have to define the complete set of arithmetic and logical operators for your class.

Image structure

The CImg<`T>` structure contains five fields :

- width defines the number of columns of the image (size along the X-axis).
- height defines the number of rows of the image (size along the Y-axis).
- depth defines the number of slices of the image (size along the Z-axis).
- dim defines the number of channels of the image (size along the V-axis).
- data defines a pointer to the pixel data (of type `T`).

You can access these fields publicly although it is recommended to use the 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 available memory). A value of 1 usually means that the corresponding dimension is flat. If one of the dimensions is 0, or if the data pointer is null, the image is considered as empty. Empty images should not contain any pixel data and thus, will not be processed by CImg member functions (a CImgInstanceException will be thrown instead). Pixel data are stored in memory, in a non interlaced mode (See How pixel data are stored with CImg.).

Image declaration and construction

Declaring an image can be done by using one of the several available constructors. Here is a list of the most used :

- Construct images from arbitrary dimensions :
  - `CImg<char> img;` declares an empty image.
  - `CImg<unsigned char> img(128,128);` declares a 128x128 greyscale image with `unsigned` `char` pixel values.
  - `CImg<double> img(3,3);` declares a 3x3 matrix with `double` coefficients.
  - `CImg<unsigned char> img(256,256,1,3);` declares a 256x256x1x3 (color) image (colors are stored as an image with three channels).
  - `CImg<double> img(128,128,128);` declares a 128x128x128 volumetric and greyscale image (with `double` pixel values).
  - `CImg<> img(128,128,128,3);` declares a 128x128x128 volumetric color image (with `float` pixels, which is the default value of the template parameter `T`).
  - Note : images pixels are not automatically initialized to 0. You may use the function fill() to do it, or use the specific constructor taking 5 parameters like this : `CImg<> img(128,128,128,3,0);` declares a 128x128x128 volumetric color image with all pixel values to 0.

- Construct images from filenames :
  - `CImg<unsigned char> img("image.jpg");` reads a JPEG color image from the file "image.jpg".
  - `CImg<float> img("analyze.hdr");` reads a volumetric image (ANALYZE7.5 format) from the file "analyze.hdr".
  - Note : You need to install ImageMagick to be able to read common compressed image formats (JPG,PNG,...) (See Files IO in CImg.).

- Construct images from C-style arrays :
  - `CImg<int> img(data_buffer,256,256);` constructs a 256x256 greyscale image from a `int*` buffer `data_buffer` (of size 256x256=65536).
  - `CImg<unsigned char> img(data_buffer,256,256,1,3,false);` constructs a 256x256 color image from a `unsigned` `char*` buffer `data_buffer` (where R,G,B channels follow each others).
  - `CImg<unsigned char> img(data_buffer,256,256,1,3,true);` constructs a 256x256 color image from a `unsigned` `char*` buffer `data_buffer` (where R,G,B channels are multiplexed).

The complete list of constructors can be found here.

Most useful functions

The CImg<T> class contains a lot of functions that operates on images. Some of the most useful are :

- operator()(), operator[]() : allows to access or write pixel values.
- display() : displays the image in a new window.

See also:
  CImgl, CImgStats, CImgDisplay, CImgException.

## Member Typedef Documentation

typedef T* iterator

| Iterator type for CImg<T>. Remarks: An `iterator` is a `T*` pointer (address of a pixel value in the pixel buffer). Iterators are not directly used in CImg functions, they have been introduced for compatibility with the STL.

typedef const T* const_iterator

| Const iterator type for CImg<T>. Remarks: A `const_iterator` is a `const T*` pointer (address of a pixel value in the pixel buffer). Iterators are not directly used in CImg functions, they have been introduced for compatibility with the STL.

## 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]`

  | Construct an image of size (`dx`,`dy`,`dz`,`dv`) with pixels of type `T`. Parameters:
  | dx | : Width of the image (dimension along the X-axis, i.e. number of image columns).
  | dy | : Height of the image (dimension along the Y-axis, i.e. number of image lines).
  | dz | : Depth of the image (dimension along the Z-axis, i.e. number of image slices).
  | dv | : Vector dimension of the image (dimension along the V-axis, i.e. number of image channels).
  Remarks: If one of the specified dimension is equal to `0`, the constructed image is empty and contains no pixel data. In this case, all image dimensions as well as the pointer to the pixel buffer are set to `0`. For non-empty images, pixel buffer allocation/deallocation is automatically performed by the constructor/destructor. When allocated, pixel data are always contiguous in memory. Pixel values are not initialized by this constructor. You may use CImg<T>::fill() to set a default pixel value after construction. Example :
             CImg<float> img_greyscale(200,200);         // Define a 2D grayscale image with float-valued pixels.
             CImg<unsigned char> img_color(256,256,1,3); // Define a 2D color-valued image with unsigned char-valued pixels.
             CImg<short> img3d(64,64,64);                // Define a 3D greyscale image with short int-valued pixels.

CImg | ( | const unsigned int | dx,
|  | const unsigned int | dy,
|  | const unsigned int | dz,
|  | const unsigned int | dv,
|  | const T & | val
| ) | `[explicit]`

  | Construct an image of size (`dx`,`dy`,`dz`,`dv`) with pixels of type `T` and set all pixel values to `val`. Parameters:
  | dx | : Width of the image (dimension along the X-axis, i.e. number of image columns).
  | dy | : Height of the image (dimension along the Y-axis, i.e. number of image lines).
  | dz | : Depth of the image (dimension along the Z-axis, i.e. number of image slices).
  | dv | : Vector dimension of the image (dimension along the V-axis, i.e. number of image channels).
  | val | : Value assigned to all image pixels.
  Remarks: If one of the specified dimension is equal to `0`, the constructed image is empty and contains no pixel data. In this case, all image dimensions as well as the pointer to the pixel buffer are set to `0`. For non-empty images, pixel buffer allocation/deallocation is automatically performed by the constructor/destructor. When allocated, pixel data are always contiguous in memory. `CImg<T>(dx,dy,dz,dv,N);` is equivalent to `CImg<T>(dx,dy,dz,dv).fill(N);` Example :
             CImg<unsigned char> black_image(128,128,1,3,0); // Define a 128x128 black color image.

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

  | Construct an image of size (`dx`,`dy`,`dz`,`dv`) with pixels of type `T`, from a raw pixel buffer `data_buffer`. Parameters:
  | data_buffer | : Raw pixel buffer from where pixel values are copied.
  | dx | : Width of the image (dimension along the X-axis, i.e. number of image columns).
  | dy | : Height of the image (dimension along the Y-axis, i.e. number of image lines).
  | dz | : Depth of the image (dimension along the Z-axis, i.e. number of image slices).
  | dv | : Vector dimension of the image (dimension along the V-axis, i.e. number of image channels).
  Remarks: If `data_buffer` is a pointer to `0` or if one of the specified dimension is equal to `0`, the constructed image is empty and contains no pixel data. In this case, all image dimensions as well as the pointer to the pixel buffer are set to `0`. For a non-empty image, a new pixel buffer is allocated containing a copy of the original `data_buffer` content. If source type `t` and destination type `T` do not match, an implicit cast is performed during construction. Example :
             const unsigned char buffer[256*256*3];   // Raw buffer that codes a 256*256 color image.
             CImg<float> img(buffer,256,256,1,3);     // Construct a float-valued color image from the raw buffer.

CImg | ( | const char *const | filename | ) |

  | Construct an image from the filename `filename`. Parameters:
  | filename | : Filename of the file containing the image data.
  Remarks: If `filename` is equal to `0`, an empty image is constructed. In this case, all image dimensions as well as the pointer to the pixel buffer are set to `0`. If the file does not exist or is corrupted, a CImgIOException is thrown. Example :
             CImg<float> img("lena.png");  // Construct a color float-valued image from a PNG image file.
See also: CImg<T>::load().

CImg | ( | const CImg< t > & | img | ) |

  | Copy constructor. Parameters:
  | img | : Source image to be copied.
  Remarks: Construction by copy allocates a new pixel buffer containing the copy of the source image `img`. If source type `t` and destination type `T` do not match, an implicit cast is performed during construction, else a fast memory buffer copy is performed. Copy of a shared-memory image is also a shared-memory image. Example :
             CImg<float> source("lena.png"), img(source);  // Construct 'img' as a copy of 'source'.

CImg | ( | const CImg< t > & | img,
|  | const bool | pixel_copy
| ) |

  | Construct an image with same size as the source image `img`, and copy pixel values if `pixel_copy` is `true`. Parameters:
  | img | : Source image to be copied.
  Remarks: If is `true`, pixel values of `img` are copied during construction. In this case, this constructor acts a the classical copy-constructor. If is `false`, the constructed image gets its size from `img`, allocating its pixel buffer (if non-empty), but does not copy the pixel buffer from `img`. Example :
             CImg<float> source("lena.png"), img(source,false);  // 'img' has same size as 'source' but with uninitialized pixel data.

~CImg | ( |  | ) |

| Destructor. Remarks: Destruction of a non-shared and non-empty image deallocates the memory used for the pixel buffer.

## Member Function Documentation

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

  | Assignement operator. This is the in-place version of the copy constructor. Example :
             CImg<float> source("lena.png"), img;    // Here, 'img' is an empty image.
             img = source;                           // 'img' is now a copy of the 'source' image.

CImg& assign | ( | const unsigned int | dx = `0`,
|  | const unsigned int | dy = `1`,
|  | const unsigned int | dz = `1`,
|  | const unsigned int | dv = `1`
| ) |

  | In-place version of the corresponding constructor. Example :
             CImg<float> img;           // 'img' is an empty image.
             img.assign(256,256,1,3);   // 'img' is now a 256x256 color image.
;

CImg& assign | ( | const unsigned int | dx,
|  | const unsigned int | dy,
|  | const unsigned int | dz,
|  | const unsigned int | dv,
|  | const T & | val
| ) |

  | In-place version of the corresponding constructor. Example :
             CImg<float> img;             // 'img' is an empty image.
             img.assign(256,256,1,3,0);   // 'img' is now a 256x256 black color image.
;

static CImg get_empty | ( |  | ) | `[static]`

| Return an empty image. Remarks: `img = CImg<T>::get_empty()` is equivalent to `img = CImg<T>();`.

static 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`). The string returned may contains spaces (`"unsigned char"`). If the template parameter T does not correspond to a registered type, the string `"unknown"` is returned.

unsigned long size | ( |  | ) | const

  | Return the total number of pixel values in an image. Equivalent to : dimx() * dimy() * dimz() * dimv(). example:
             CImg<> img(100,100,1,3);
             if (img.size()==100*100*3) std::fprintf(stderr,"This statement is true");
See also: dimx(), dimy(), dimz(), dimv()

int dimx | ( |  | ) | const

| Return the number of columns of the instance image (size along the X-axis, i.e image width). See also: width, dimy(), dimz(), dimv(), size().

int dimy | ( |  | ) | const

| Return the number of rows of the instance image (size along the Y-axis, i.e image height). See also: height, dimx(), dimz(), dimv(), size().

int dimz | ( |  | ) | const

| Return the number of slices of the instance image (size along the Z-axis). See also: depth, dimx(), dimy(), dimv(), size().

int dimv | ( |  | ) | const

| Return the number of vector channels of the instance image (size along the V-axis). See also: dim, dimx(), dimy(), dimz(), size().

long offset | ( | const int | x = `0`,
|  | const int | y = `0`,
|  | const int | z = `0`,
|  | const int | v = `0`
| ) | const

  | Return the offset of the pixel coordinates (`x`,`y`,`z`,`v`) with respect to the data pointer `data`. 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.
  No checking is done on the validity of the given coordinates. example:
             CImg<float> img(100,100,1,3,0);         // Define a 100x100 color image with float-valued black pixels.
             long off = img.offset(10,10,0,2);       // Get the offset of the blue value of the pixel located at (10,10).
             float val = img[off];                   // Get the blue value of the pixel.
See also: ptr(), operator()(), operator[](), How pixel data are stored with CImg..

T* ptr | ( | const unsigned int | x = `0`,
|  | const unsigned int | y = `0`,
|  | const unsigned int | z = `0`,
|  | const unsigned int | v = `0`
| ) |

  | 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.
  When called without parameters, ptr() returns a pointer to the begining of the pixel buffer. If the macro `cimg_debug` == 2, boundary checking is performed and warning messages may appear if given coordinates are outside the image range (but function performances decrease). example:
             CImg<float> img(100,100,1,1,0);   // Define a 100x100 greyscale image with float-valued pixels.
             float *ptr = ptr(10,10);          // Get a pointer to the pixel located at (10,10).
             float val = *ptr;                 // Get the pixel value.
See also: data, offset(), operator()(), operator[](), How pixel data are stored with CImg., Setting Environment Variables.

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

  | Fast access to pixel value for reading or writing. 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.
  If one image dimension is equal to 1, it can be omitted in the coordinate list (see example below). If the macro `cimg_debug` == 2, boundary checking is performed and warning messages may appear (but function performances decrease). example:
             CImg<float> img(100,100,1,3,0);                       // Define a 100x100 color image with float-valued black pixels.
             const float valR = img(10,10,0,0);                    // Read the red component at coordinates (10,10).
             const float valG = img(10,10,0,1);                    // Read the green component at coordinates (10,10)
             const float valB = img(10,10,2);                      // Read the blue component at coordinates (10,10) (Z-coordinate omitted here).
             const float avg = (valR + valG + valB)/3;             // Compute average pixel value.
             img(10,10,0) = img(10,10,1) = img(10,10,2) = avg;     // Replace the pixel (10,10) by the average grey value.
See also: operator[](), ptr(), offset(), How pixel data are stored with CImg., Setting Environment Variables.

T& operator[] | ( | const unsigned long | off | ) |

  | Fast access to pixel value for reading or writing, using an offset to the image pixel. Parameters:
  | off | Offset of the pixel according to the begining of the pixel buffer, given by ptr().
  If the macro `cimg_debug==2`, boundary checking is performed and warning messages may appear (but function performances decrease). As pixel values are aligned in memory, this operator can sometime useful to access values easier than with operator()() (see example below). example:
             CImg<float> vec(1,10);        // Define a vector of float values (10 lines, 1 row).
             const float val1 = vec(0,4);  // Get the fifth element using operator()().
             const float val2 = vec[4];    // Get the fifth element using operator[]. Here, val2==val1.
See also: operator()(), ptr(), offset(), How pixel data are stored with CImg., Setting Environment Variables.

T pix4d | ( | const int | x,
|  | const int | y,
|  | const int | z,
|  | const int | v,
|  | const T & | out_val
| ) | const

  | Read a pixel value with Dirichlet or Neumann boundary conditions. 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 | Desired value if pixel coordinates are outside the image range (optional parameter).
  This function allows to read pixel values with boundary checking on all coordinates. If given coordinates are outside the image range and the parameter out_val is specified, the value `out_val` is returned. If given coordinates are outside the image range and the parameter out_val is not specified, the closest pixel value is returned. example:
             CImg<float> img(100,100,1,1,128);                     // Define a 100x100 images with all pixel values equal to 128.
             const float val1 = img.pix4d(10,10,0,0,0);  // Equivalent to val1=img(10,10) (but slower).
             const float val2 = img.pix4d(-4,5,0,0,0);   // Return 0, since coordinates are outside the image range.
             const float val3 = img.pix4d(10,10,5,0,64); // Return 64, since coordinates are outside the image range.
See also: operator()(), linear_pix4d(), cubic_pix2d().

cimg::largest<T,float>::type linear_pix4d | ( | const float | fx,
|  | const float | fy,
|  | const float | fz,
|  | const float | fv,
|  | const T & | out_val
| ) | const

  | Read a pixel value using linear interpolation. Parameters:
  | ffx | X-coordinate of the pixel (float-valued).
  | ffy | Y-coordinate of the pixel (float-valued).
  | ffz | Z-coordinate of the pixel (float-valued).
  | ffv | V-coordinate of the pixel (float-valued).
  | out_val | Out-of-border pixel value
  This function allows to read pixel values with boundary checking on all coordinates. If given coordinates are outside the image range, the value of the nearest pixel inside the image is returned (Neumann boundary conditions). If given coordinates are float-valued, a linear interpolation is performed in order to compute the returned value. example:
             CImg<float> img(2,2);     // Define a greyscale 2x2 image.
             img(0,0) = 0;             // Fill image with specified pixel values.
             img(1,0) = 1;
             img(0,1) = 2;
             img(1,1) = 3;
             const double val = img.linear_pix4d(0.5,0.5);  // Return val=1.5, which is the average intensity of the four pixels values.
See also: operator()(), linear_pix3d(), linear_pix2d(), linear_pix1d(), cubic_pix2d().

cimg::largest<T,float>::type linear_pix3d | ( | const float | fx,
|  | const float | fy,
|  | const float | fz,
|  | const int | v,
|  | const T & | out_val
| ) | const

| Read a pixel value using linear interpolation for the three first coordinates (`cx`,`cy`,`cz`). Same as linear_pix4d(), except that linear interpolation and boundary checking is performed only on the three first coordinates. See also: operator()(), linear_pix4d(), linear_pix2d(), linear_pix1d(), linear_pix3d(), cubic_pix2d().

cimg::largest<T,float>::type linear_pix2d | ( | const float | fx,
|  | const float | fy,
|  | const int | z,
|  | const int | v,
|  | const T & | out_val
| ) | const

| Read a pixel value using linear interpolation for the two first coordinates (`cx`,`cy`). Same as linear_pix4d(), except that linear interpolation and boundary checking is performed only on the two first coordinates. See also: operator()(), linear_pix4d(), linear_pix3d(), linear_pix1d(), linear_pix2d(), cubic_pix2d().

cimg::largest<T,float>::type linear_pix1d | ( | const float | fx,
|  | const int | y,
|  | const int | z,
|  | const int | v,
|  | const T & | out_val
| ) | const

| Read a pixel value using linear interpolation for the first coordinate `cx`. Same as linear_pix4d(), except that linear interpolation and boundary checking is performed only on the first coordinate. See also: operator()(), linear_pix4d(), linear_pix3d(), linear_pix2d(), linear_pix1d(), cubic_pix1d().

cimg::largest<T,float>::type cubic_pix1d | ( | const float | fx,
|  | const int | y,
|  | const int | z,
|  | const int | v,
|  | const T & | out_val
| ) | const

| Read a pixel value using cubic interpolation for the first coordinate `cx`. Same as cubic_pix2d(), except that cubic interpolation and boundary checking is performed only on the first coordinate. See also: operator()(), cubic_pix2d(), linear_pix1d().

cimg::largest<T,float>::type cubic_pix2d | ( | const float | fx,
|  | const float | fy,
|  | const int | z,
|  | const int | v,
|  | const T & | out_val
| ) | const

  | Read a pixel value using bicubic interpolation. Parameters:
  | pfx | X-coordinate of the pixel (float-valued).
  | pfy | Y-coordinate of the pixel (float-valued).
  | z | Z-coordinate of the pixel.
  | v | V-coordinate of the pixel.
This function allows to read pixel values with boundary checking on the two first coordinates. If given coordinates are outside the image range, the value of the nearest pixel inside the image is returned (Neumann boundary conditions). If given coordinates are float-valued, a cubic interpolation is performed in order to compute the returned value. See also: operator()(), cubic_pix1d(), linear_pix2d().

const CImg& print | ( | const char * | title = `0`,
|  | const unsigned int | print_flag = `1`
| ) | const

  | Display informations about the image on the standard error output. Parameters:
  | title | Name for the considered image (optional).
  | print_flag | Level of informations to be printed.
  The possible values for `print_flag` are : 0 : print only informations about image size and pixel buffer. 1 : print also statistics on the image pixels. 2 : print also the content of the pixel buffer, in a matlab-style. example:
             CImg<float> img("foo.jpg");      // Load image from a JPEG file.
             img.print("Image : foo.jpg",1);  // Print image informations and statistics.
See also: CImgStats

CImg& operator= | ( | const T & | val | ) |

  | Assign a value to each image pixel of the instance image. Parameters:
  | val | Value to assign.
  Replace all pixel values of the instance image by `val`. Can be used to easily initialize an image. example:
             CImg<float> img(100,100);   // Define a 100x100 greyscale image.
             img = 3.14f;                // Set all pixel values to 3.14.
See also: fill().

CImg& operator= | ( | const T * | buf | ) |

  | Assign values of a C-array to the instance image. Parameters:
  | buf | Pointer to a C-style array having a size of (at least) `this->size()`.
  Replace pixel values by the content of the array `buf`. Warning : the value types in the array and in the image must be the same. example:
             float tab[4*4] = { 1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16 };  // Define a 4x4 matrix in C-style.
             CImg<float> matrice(4,4);                                        // Define a 4x4 greyscale image.
             matrice = tab;                                                   // Fill the image by the values in tab.

CImg operator+ | ( | const T & | val | ) | const

  | Addition. Parameters:
  | val | Constant value added to each image pixel of the instance image.

CImg<typename cimg::largest<T,t>::type> operator+ | ( | const CImg< t > & | img | ) | const

  | Addition. Parameters:
  | img | Image added to the instance image.

CImg& operator+= | ( | const T & | val | ) |

| In-place addition. This is the in-place version of operator+().

CImg& operator+= | ( | const CImg< t > & | img | ) |

| In-place addition. This is the in-place version of operator+().

CImg& operator++ | ( |  | ) |

| In-place increment. Equivalent to `operator+=(1)`.

CImg operator- | ( | const T & | val | ) | const

  | Substraction. Parameters:
  | val | Constant value substracted to each image pixel of the instance image.

CImg<typename cimg::largest<T,t>::type> operator- | ( | const CImg< t > & | img | ) | const

  | Substraction. Parameters:
  | img | Image substracted to the instance image.

CImg& operator-= | ( | const T & | val | ) |

| In-place substraction. This is the in-place version of operator-().

CImg& operator-= | ( | const CImg< t > & | img | ) |

| In-place substraction. This is the in-place version of operator-().

CImg& operator-- | ( |  | ) |

| In-place decrement. Equivalent to `operator-=(1)`.

CImg operator * | ( | const double | val | ) | const

  | Multiplication. Parameters:
  | val | Constant value multiplied to each image pixel of the instance image.

CImg<typename cimg::largest<T,t>::type> operator * | ( | const CImg< t > & | img | ) | const

| Multiplication. Matrix multiplication.

CImg& operator *= | ( | const double | val | ) |

| In-place multiplication. This is the in-place version of operator*().

CImg& operator *= | ( | const CImg< t > & | img | ) |

| In-place multiplication. This is the in-place version of operator*().

CImg operator/ | ( | const double | val | ) | const

  | Division. Parameters:
  | val | Constant value divided to each image pixel of the instance image.

CImg& operator/= | ( | const double | val | ) |

| In-place division. This is the in-place version of operator/().

CImg operator% | ( | const T & | val | ) | const

  | Modulo. Parameters:
  | val | Constant valued used for a modulo on each image pixel.

CImg operator% | ( | const CImg< T > & | img | ) | const

  | Modulo. Parameters:
  | img | Image whose values are used for a modulo.

CImg& operator%= | ( | const T & | val | ) |

| In-place modulo. This is the in-place version of operator%().

CImg& operator%= | ( | const CImg< T > & | img | ) |

| In-place modulo. This is the in-place version of operator%().

CImg operator & | ( | const T & | val | ) | const

  | Bitwise AND. Parameters:
  | val | Constant valued used for a bitwise AND on each image pixel.

CImg operator & | ( | const CImg< T > & | img | ) | const

  | Bitwise AND. Parameters:
  | img | Image whose value are used for the AND.

CImg& operator &= | ( | const T & | val | ) |

| In-place bitwise AND. This is the in-place version of operator&().

CImg& operator &= | ( | const CImg< T > & | img | ) |

| In-place bitwise AND. This is the in-place version of operator&=().

CImg operator| | ( | const T & | val | ) | const

  | Bitwise OR. Parameters:
  | val | Constant valued used for a bitwise OR on each image pixel.

CImg operator| | ( | const CImg< T > & | img | ) | const

  | Bitwise OR. Parameters:
  | img | Image whose values are used for the OR.

CImg& operator|= | ( | const T & | val | ) |

| In-place bitwise OR. This is the in-place version of operator|().

CImg& operator|= | ( | const CImg< T > & | img | ) |

| In-place bitwise OR. This is the in-place version of operator|().

CImg operator^ | ( | const T & | val | ) | const

  | Bitwise XOR. Parameters:
  | val | Constant valued used for a bitwise XOR on each image pixel.

CImg operator^ | ( | const CImg< T > & | img | ) | const

  | Bitwise XOR. Parameters:
  | img | Image whose values are used for the XOR.

CImg& operator^= | ( | const T & | val | ) |

| In-place bitwise XOR. This is the in-place version of operator^().

CImg& operator^= | ( | const CImg< T > & | img | ) |

| In-place bitwise XOR. This is the in-place version of operator^().

CImg& mul | ( | const CImg< t > & | img | ) |

| In-place pointwise multiplication between `*this` and `img`. This is the in-place version of get_mul(). See also: get_mul().

CImg<typename cimg::largest<T,t>::type> get_mul | ( | const CImg< t > & | img | ) | const

  | Pointwise multiplication between `*this` and `img`. Parameters:
  | img | Argument of the multiplication. if `*this` and `img` have different size, the multiplication is applied on the maximum possible range.
See also: get_div(),mul(),div()

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

CImg<typename cimg::largest<T,t>::type> 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()

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

CImg<typename cimg::largest<T,t>::type> 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()

CImg& max | ( | const T & | val | ) |

| Replace the image by the pointwise max operator between `*this` and `val`. This is the in-place version of get_max(). See also: get_max().

CImg get_max | ( | const T & | val | ) | const

  | Return the image corresponding to the max value for each pixel. Parameters:
  | val | = second argument of the max operator (the first one is *this).
See also: max(), min(), get_min()

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

CImg<typename cimg::largest<T,t>::type> 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()

CImg& min | ( | const T & | val | ) |

| Replace the image by the pointwise min operator between `*this` and `val`. This is the in-place version of get_min(). See also: get_min().

CImg get_min | ( | const T & | val | ) | const

  | Return the image corresponding to the min value for each pixel. Parameters:
  | val | = second argument of the min operator (the first one is *this).
See also: min(), max(), get_max()

CImg& sqrt | ( |  | ) |

| Replace each image pixel by its square root. See also: get_sqrt()

CImg<typename cimg::largest<T,float>::type> get_sqrt | ( |  | ) | const

| Return the image of the square root of the pixel values. See also: sqrt()

CImg& log | ( |  | ) |

| Replace each image pixel by its log. See also: get_log(), log10(), get_log10()

CImg<typename cimg::largest<T,float>::type> get_log | ( |  | ) | const

| Return the image of the log of the pixel values. See also: log(), log10(), get_log10()

CImg& log10 | ( |  | ) |

| Replace each image pixel by its log10. See also: get_log10(), log(), get_log()

CImg<typename cimg::largest<T,float>::type> get_log10 | ( |  | ) | const

| Return the image of the log10 of the pixel values. See also: log10(), log(), get_log()

CImg& pow | ( | const double | p | ) |

  | Replace each image pixel by its power by `p`. Parameters:
  | p | = power
See also: get_pow(), sqrt(), get_sqrt()

CImg<typename cimg::largest<T,float>::type> 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()

CImg& pow | ( | const CImg< t > & | img | ) |

| Return each image pixel (*this)(x,y,z,k) by its power by `img(x,y,z,k)`. In-place version

CImg& abs | ( |  | ) |

| Replace each pixel value by its absolute value. See also: get_abs()

CImg<typename cimg::largest<T,float>::type> get_abs | ( |  | ) | const

| Return the image of the absolute value of the pixel values. See also: abs()

CImg& cos | ( |  | ) |

| Replace each image pixel by its cosinus. See also: get_cos(), sin(), get_sin(), tan(), get_tan()

CImg<typename cimg::largest<T,float>::type> get_cos | ( |  | ) | const

| Return the image of the cosinus of the pixel values. See also: cos(), sin(), get_sin(), tan(), get_tan()

CImg& sin | ( |  | ) |

| Replace each image pixel by its sinus. See also: get_sin(), cos(), get_cos(), tan(), get_tan()

CImg<typename cimg::largest<T,float>::type> get_sin | ( |  | ) | const

| Return the image of the sinus of the pixel values. See also: sin(), cos(), get_cos(), tan(), get_tan()

CImg& tan | ( |  | ) |

| Replace each image pixel by its tangent. See also: get_tan(), cos(), get_cos(), sin(), get_sin()

CImg<typename cimg::largest<T,float>::type> get_tan | ( |  | ) | const

| Return the image of the tangent of the pixel values. See also: tan(), cos(), get_cos(), sin(), get_sin()

CImg& fill | ( | const T & | val | ) |

  | Fill an image by a value `val`. Parameters:
  | val | = fill value
Note: All pixel values of the instance image will be initialized by `val`. See also: operator=().

CImg& fill | ( | const T & | val0,
|  | const T & | val1
| ) |

  | Fill sequentially all pixel values with values val0 and val1 respectively. Parameters:
  | val0 | = fill value 1
  | val1 | = fill value 2

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

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

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

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

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

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

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

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

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

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

  | 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
  | val12 | = fill value 13

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

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,
|  | const T & | val16,
|  | const T & | val17,
|  | const T & | val18,
|  | const T & | val19,
|  | const T & | val20,
|  | const T & | val21,
|  | const T & | val22,
|  | const T & | val23,
|  | const T & | val24
| ) |

  | Fill sequentially all pixel values with values val0 and val1 and val2 and val3 and ... and val24. 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
  | val16 | = fill value 17
  | val17 | = fill value 18
  | val18 | = fill value 19
  | val19 | = fill value 20
  | val20 | = fill value 21
  | val21 | = fill value 22
  | val22 | = fill value 23
  | val23 | = fill value 24
  | val24 | = fill value 25

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

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

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

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

CImg& quantize | ( | const unsigned int | n = `256` | ) |

  | Quantize pixel values into levels. Parameters:
  | n | = number of quantification levels
See also: get_quantize().

CImg get_quantize | ( | const unsigned int | n = `256` | ) | const

  | Return a quantified image, with levels. Parameters:
  | n | = number of quantification levels
See also: quantize().

CImg& threshold | ( | const T & | thres | ) |

  | Threshold the image. Parameters:
  | thres | = threshold
See also: get_threshold().

CImg get_threshold | ( | const T & | thres | ) | const

  | Return a thresholded image. Parameters:
  | thres | = threshold.
See also: threshold().

CImg get_rotate | ( | const float | angle,
|  | const unsigned int | cond = `3`
| ) | 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()

CImg& rotate | ( | const float | angle,
|  | const unsigned int | cond = `3`
| ) |

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

CImg get_rotate | ( | const float | angle,
|  | const float | cx,
|  | const float | cy,
|  | const float | zoom = `1`,
|  | const unsigned int | cond = `3`
| ) | 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()

CImg& rotate | ( | const float | angle,
|  | const float | cx,
|  | const float | cy,
|  | const float | zoom = `1`,
|  | const unsigned int | cond = `3`
| ) |

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

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

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

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

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

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

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

CImg get_resize_halfXY | ( |  | ) | const

| Return an half-resized image, using a special filter. See also: resize_halfXY(), resize(), get_resize().

CImg& resize_halfXY | ( |  | ) |

| Half-resize the image, using a special filter. See also: get_resize_halfXY(), resize(), get_resize().

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

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: crop()

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: crop()

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: crop()

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: get_crop()

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: get_crop()

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: get_crop()

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.
  | border_condition | = determine the type of border condition if some of the desired region is outside the image.
See also: get_crop()

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

CImg& mirror | ( | const char | axe = `'x'` | ) |

| Mirror an image along the specified axis. This is the in-place version of get_mirror(). See also: get_mirror().

CImg get_mirror | ( | const char | axe = `'x'` | ) |

  | Get a mirrored version of the image, along the specified axis. Parameters:
  | axe | Axe used to mirror the image. Can be `'x'`, `'y'`, `'z'` or `'v'`.
See also: mirror().

CImg& scroll | ( | const int | scrollx,
|  | const int | scrolly = `0`,
|  | const int | scrollz = `0`,
|  | const int | scrollv = `0`,
|  | const int | border_condition = `0`
| ) |

| Scroll the image. This is the in-place version of get_scroll(). See also: get_scroll().

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. Parameters:
  | scrollx | Amount of displacement along the X-axis.
  | scrolly | Amount of displacement along the Y-axis.
  | scrollz | Amount of displacement along the Z-axis.
  | scrollv | Amount of displacement along the V-axis.
  | border_condition | Border condition.
`border_condition` can be : 0 : Zero border condition (Dirichlet). 1 : Nearest neighbors (Neumann). 2 : Repeat Pattern (Fourier style).

CImg<float> get_histogram | ( | const unsigned int | nblevels = `256`,
|  | const T | val_min = `(T)0`,
|  | const T | val_max = `(T)0`
| ) | const

  | Return the image histogram. The histogram H of an image I is a 1D-function where H(x) is the number of occurences of the value x in I. Parameters:
  | nblevels | = Number of different levels of the computed histogram. For classical images, this value is 256 (default value). You should specify more levels if you are working with CImg<float> or images with high range of pixel values.
  | val_min | = Minimum value considered for the histogram computation. All pixel values lower than val_min won't be counted.
  | val_max | = Maximum value considered for the histogram computation. All pixel values higher than val_max won't be counted.
Note: If val_min==val_max==0 (default values), the function first estimates the minimum and maximum pixel values of the current image, then uses these values for the histogram computation. Returns: The histogram is returned as a 1D CImg<float> image H, having a size of (nblevels,1,1,1) such that H(0) and H(nblevels-1) are respectively equal to the number of occurences of the values val_min and val_max in I. Note: Histogram computation always returns a 1D function. Histogram of multi-valued (such as color) images are not multi-dimensional. See also: get_equalize_histogram(), equalize_histogram()

CImg& equalize_histogram | ( | const unsigned int | nblevels = `256`,
|  | const T | val_min = `(T)0`,
|  | const T | val_max = `(T)0`
| ) |

| Equalize the image histogram. This is the in-place version of get_equalize_histogram()

CImg get_equalize_histogram | ( | const unsigned int | nblevels = `256`,
|  | const T | val_min = `(T)0`,
|  | const T | val_max = `(T)0`
| ) | const

  | Return the histogram-equalized version of the current image. The histogram equalization is a classical image processing algorithm that enhances the image contrast by expanding its histogram. Parameters:
  | nblevels | = Number of different levels of the computed histogram. For classical images, this value is 256 (default value). You should specify more levels if you are working with CImg<float> or images with high range of pixel values.
  | val_min | = Minimum value considered for the histogram computation. All pixel values lower than val_min won't be changed.
  | val_max | = Maximum value considered for the histogram computation. All pixel values higher than val_max won't be changed.
Note: If val_min==val_max==0 (default values), the function acts on all pixel values of the image. Returns: A new image with same size is returned, where pixels have been equalized. See also: get_histogram(), equalize_histogram()

CImg<typename cimg::largest<T,float>::type> get_norm_pointwise | ( | int | norm_type = `2` | ) | const

  | Return the scalar image of vector norms. When dealing with vector-valued images (i.e images with dimv()>1), this function computes the L1,L2 or Linf norm of each vector-valued pixel. Parameters:
  | norm_type | = Type of the norm being computed (1 = L1, 2 = L2, -1 = Linf).
Returns: A scalar-valued image CImg<float> with size (dimx(),dimy(),dimz(),1), where each pixel is the norm of the corresponding pixels in the original vector-valued image. See also: get_orientation_pointwise, orientation_pointwise, norm_pointwise.

CImg& norm_pointwise | ( |  | ) |

| Replace each pixel value with its vector norm. This is the in-place version of get_norm_pointwise(). Note: Be careful when using this function on CImg<T> with T=char, unsigned char,unsigned int or int. The vector norm is usually a floating point value, and a rough cast will be done here.

CImg<typename cimg::largest<T,float>::type> get_orientation_pointwise | ( |  | ) | const

| Return the image of normalized vectors. When dealing with vector-valued images (i.e images with dimv()>1), this function return the image of normalized vectors (unit vectors). Null vectors are unchanged. The L2-norm is computed for the normalization. Returns: A new vector-valued image with same size, where each vector-valued pixels have been normalized. See also: get_norm_pointwise, norm_pointwise, orientation_pointwise.

CImg& orientation_pointwise | ( |  | ) |

| Replace each pixel value by its normalized vector. This is the in-place version of get_orientation_pointwise()

CImgl<typename cimg::largest<T,float>::type> get_gradientXY | ( | const int | scheme = `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.

CImgl<typename cimg::largest<T,float>::type> get_gradientXYZ | ( | const int | scheme = `0` | ) | const

| Return a list of images, corresponding to the XYZ-gradients of an image. See also: get_gradientXY().

const CImg& marching_cubes | ( | const float | isovalue,
|  | const float | resx,
|  | const float | resy,
|  | const float | resz,
|  | CImgl< tp > & | points,
|  | CImgl< tf > & | primitives,
|  | const bool | invert_faces = `false`
| ) | const

| Get a triangularization of an implicit function defined by the instance image. This version allows to specify the marching cube resolution along x,y and z.

const CImg& marching_squares | ( | const float | isovalue,
|  | const float | resx,
|  | const float | resy,
|  | CImgl< tp > & | points,
|  | CImgl< tf > & | primitives
| ) | const

| Get a vectorization of an implicit function defined by the instance image. This version allows to specify the marching squares resolution along x,y, and z.

static CImg<T> get_default_LUT8 | ( |  | ) | `[static]`

| Return the default 256 colors palette. The default color palette is used by CImg when displaying images on 256 colors displays. It consists in the quantification of the (R,G,B) color space using 3:3:2 bits for color coding (i.e 8 levels for the Red and Green and 4 levels for the Blue). Returns: A 256x1x1x3 color image defining the palette entries.

CImg<t> get_RGBtoLUT | ( | const CImg< t > & | palette,
|  | const bool | dithering = `true`,
|  | const bool | indexing = `false`
| ) | const

  | Convert color pixels from (R,G,B) to match a specified palette. This function return a (R,G,B) image where colored pixels are constrained to match entries of the specified color `palette`. Parameters:
  | palette | User-defined palette that will constraint the color conversion.
  | dithering | Enable/Disable Floyd-Steinberg dithering.
  | indexing | If `true`, each resulting image pixel is an index to the given color palette. Otherwise, (R,G,B) values of the palette are copied instead.

CImg<T> get_RGBtoLUT | ( | const bool | dithering = `true`,
|  | const bool | indexing = `false`
| ) | const

| Convert color pixels from (R,G,B) to match the default 256 colors palette. Same as get_RGBtoLUT() with the default color palette given by get_default_LUT8().

CImg& RGBtoLUT | ( | const CImg< T > & | palette,
|  | const bool | dithering = `true`,
|  | const bool | indexing = `false`
| ) |

| Convert color pixels from (R,G,B) to match the specified color palette. This is the in-place version of get_RGBtoLUT().

CImg& RGBtoLUT | ( | const bool | dithering = `true`,
|  | const bool | indexing = `false`
| ) |

| Convert color pixels from (R,G,B) to match the specified color palette. This is the in-place version of get_RGBtoLUT().

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.

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.

CImg& draw_line | ( | const int | x0,
|  | const int | y0,
|  | const int | x1,
|  | const int | y1,
|  | const T *const | color,
|  | const unsigned int | 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 | = An integer whose bits describes the line pattern.
  | opacity | = opacity of the drawing.
Note: Clipping is supported.

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 int | 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 | = An integer whose bits describes the line pattern.
  | opacity | = opacity of the drawing.
Note: Clipping is supported.

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.

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 int | 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 | = An integer whose bits describes the line pattern.
  | opacity | = opacity of the drawing.
Note: Clipping is supported.

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.

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.

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,
|  | const float | opacity = `1.0f`
| ) |

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

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.

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.

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`,
|  | const float | brightness = `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 (<1)
  | brightness | = brightness of the drawing (in [0,1])
Note: Clipping is supported.

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 | c0,
|  | const float | c1,
|  | const float | c2,
|  | const float | opacity = `1`
| ) |

  | Draw a 2D Gouraud-filled 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 global drawing color.
  | c0 | = brightness of the first corner.
  | c1 | = brightness of the second corner.
  | c2 | = brightness of the third corner.
  | opacity | = opacity of the drawing.
Note: Clipping is supported.

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 CImg< t > & | light,
|  | const int | lx0,
|  | const int | ly0,
|  | const int | lx1,
|  | const int | ly1,
|  | const int | lx2,
|  | const int | ly2,
|  | const float | opacity = `1.0f`
| ) |

  | Draw a 2D phong-shaded 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 global drawing color.
  | light | = light image.
  | lx0 | = X-coordinate of the first corner in the light image.
  | ly0 | = Y-coordinate of the first corner in the light image.
  | lx1 | = X-coordinate of the second corner in the light image.
  | ly1 | = Y-coordinate of the second corner in the light image.
  | lx2 | = X-coordinate of the third corner in the light image.
  | ly2 | = Y-coordinate of the third corner in the light image.
  | opacity | = opacity of the drawing.
Note: Clipping is supported, but texture coordinates do not support clipping.

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.0f`,
|  | const float | brightness = `1.0f`
| ) |

  | 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.
  | brightness | = brightness of the drawing.
Note: Clipping is supported, but texture coordinates do not support clipping.

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 | c0,
|  | const float | c1,
|  | const float | c2,
|  | const float | opacity = `1`
| ) |

  | Draw a 2D textured triangle with Gouraud-Shading 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.
  | c0 | = brightness value of the first corner.
  | c1 | = brightness value of the second corner.
  | c2 | = brightness value of the third corner.
  | opacity | = opacity of the drawing.
Note: Clipping is supported, but texture coordinates do not support clipping.

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 CImg< tl > & | light,
|  | const int | lx0,
|  | const int | ly0,
|  | const int | lx1,
|  | const int | ly1,
|  | const int | lx2,
|  | const int | ly2,
|  | const float | opacity = `1.0f`
| ) |

  | Draw a phong-shaded 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.
  | light | = light image.
  | lx0 | = X-coordinate of the first corner in the light image.
  | ly0 | = Y-coordinate of the first corner in the light image.
  | lx1 | = X-coordinate of the second corner in the light image.
  | ly1 | = Y-coordinate of the second corner in the light image.
  | lx2 | = X-coordinate of the third corner in the light image.
  | ly2 | = Y-coordinate of the third corner in the light image.
  | opacity | = opacity of the drawing.
Note: Clipping is supported, but texture coordinates do not support clipping.

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 unsigned int | pattern = `0L`,
|  | const float | opacity = `1`
| ) |

  | Draw an 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.
  | pattern | = If zero, the ellipse is filled, else pattern is an integer whose bits describe the outline pattern.
  | opacity | = opacity of the drawing.

CImg& draw_ellipse | ( | const int | x0,
|  | const int | y0,
|  | const CImg< t > & | tensor,
|  | const T * | color,
|  | const unsigned int | pattern = `0L`,
|  | const float | opacity = `1`
| ) |

  | Draw an 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.
  | pattern | = If zero, the ellipse is filled, else pattern is an integer whose bits describe the outline pattern.
  | opacity | = opacity of the drawing.

CImg& draw_circle | ( | const int | x0,
|  | const int | y0,
|  | float | r,
|  | const T *const | color,
|  | const unsigned int | pattern = `0L`,
|  | const float | opacity = `1`
| ) |

  | Draw a 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.
  | pattern | = If zero, the circle is filled, else pattern is an integer whose bits describe the outline pattern.
  | opacity | = opacity of the drawing.

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 (0 means 'transparent').
  | bgcolor | = an array of dimv() values of type `T`, defining the background color (0 means 'transparent').
  | font | = List of font characters used for the drawing.
  | opacity | = opacity of the drawing.
Note: Clipping is supported. See also: get_font().

CImg& draw_text | ( | const char *const | text,
|  | const int | x0,
|  | const int | y0,
|  | const T *const | fgcolor,
|  | const T *const | bgcolor = `0`,
|  | const unsigned int | font_size = `11`,
|  | const float | opacity = `1.0f`
| ) |

  | 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 (0 means 'transparent').
  | bgcolor | = an array of dimv() values of type `T`, defining the background color (0 means 'transparent').
  | font_size | = Height of the desired font (11,13,24,38 or 57)
  | opacity | = opacity of the drawing.
Note: Clipping is supported. See also: get_font().

CImg& draw_text | ( | const int | x0,
|  | const int | y0,
|  | const T *const | fgcolor,
|  | const T *const | bgcolor,
|  | const unsigned int | font_size,
|  | 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 (0 means 'transparent').
  | bgcolor | = an array of dimv() values of type `T`, defining the background color (0 means 'transparent').
  | opacity | = opacity of the drawing.
  | format | = a 'printf'-style format, followed by arguments.
Note: Clipping is supported.

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.

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.

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

CImg& draw_axe | ( | const CImg< t > & | xvalues,
|  | const int | y,
|  | const T *const | color,
|  | const int | precision = `-1`,
|  | const float | opacity = `1.0f`
| ) |

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

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.

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.

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.

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.

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.

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 | = Standard variation of the gaussian distribution.
  | color | = array of dimv() values of type `T`, defining the drawing color.
  | opacity | = opacity of the drawing.

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.

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 | = standard variation of the gaussian distribution.
  | color | = array of dimv() values of type `T`, defining the drawing color.
  | opacity | = opacity of the drawing.

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.

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 | = standard variation of the gaussian distribution.
  | color | = array of dimv() values of type `T`, defining the drawing color.
  | opacity | = opacity of the drawing.

CImg& draw_object3d | ( | const float | X,
|  | const float | Y,
|  | const float | Z,
|  | const CImg< tp > & | points,
|  | const CImgl< tf > & | primitives,
|  | const CImgl< T > & | colors,
|  | const CImg< to > & | opacities,
|  | const unsigned int | render_type = `4`,
|  | const bool | double_sided = `false`,
|  | const float | focale = `500`,
|  | const float | lightx = `0`,
|  | const float | lighty = `0`,
|  | const float | lightz = `-5000`,
|  | const float | ambiant_light = `0.05f`
| ) |

  | Draw a 3D object in the instance image. Parameters:
  | X | = X-coordinate of the 3d object position
  | Y | = Y-coordinate of the 3d object position
  | Z | = Z-coordinate of the 3d object position
  | points | = Image N*3 describing 3D point coordinates
  | primitives | = List of P primitives
  | colors | = List of P color (or textures)
  | opacities | = Image of P opacities
  | render_type | = Render type (0=Points, 1=Lines, 2=Faces (no light), 3=Faces (flat), 4=Faces(Gouraud)
  | double_sided | = Tell if object faces have two sides or are oriented.
  | focale | = length of the focale
  | lightx | = X-coordinate of the light
  | lighty | = Y-coordinate of the light
  | lightz | = Z-coordinate of the light
  | ambiant_light | = Brightness (between 0..1) of the ambiant light

CImg<typename cimg::largest<T,t>::type> 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.

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

CImg<typename cimg::largest<T,t>::type> 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.

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

CImg& erode | ( | const CImg< t > & | mask,
|  | const unsigned int | cond = `1`,
|  | const bool | weighted_erosion = `false`
| ) |

| Erode the image by a structuring element. This is the in-place version of get_erode(). See also: get_erode()

CImg& dilate | ( | const CImg< t > & | mask,
|  | const unsigned int | cond = `1`,
|  | const bool | weighted_dilatation = `false`
| ) |

| Dilate the image by a structuring element. This is the in-place version of get_dilate(). See also: get_dilate()

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.

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.

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.

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

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

CImg& blur | ( | const float | sigma,
|  | const unsigned int | cond = `1`
| ) |

| Blur the image with a Canny-Deriche filter. This is the in-place version of get_blur().

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 Canny-Deriche filter. Blur the image with an anisotropic exponential filter (Deriche filter of order 0).

CImg& blur_anisotropic | ( | const CImg< t > & | G,
|  | const float | amplitude = `30.0f`,
|  | const float | dl = `0.8f`,
|  | const float | da = `30.0f`,
|  | const float | gauss_prec = `2.0f`,
|  | const unsigned int | interpolation = `0`,
|  | const bool | fast_approx = `true`
| ) |

| Blur an image following a field of diffusion tensors. This is the in-place version of get_blur_anisotropic().

CImg get_blur_anisotropic | ( | const CImg< t > & | G,
|  | const float | amplitude = `30.0f`,
|  | const float | dl = `0.8f`,
|  | const float | da = `30.0f`,
|  | const float | gauss_prec = `2.0f`,
|  | const unsigned int | interpolation = `0`,
|  | const bool | fast_approx = `true`
| ) | const

  | Get a blurred version of an image following a field of diffusion tensors. Parameters:
  | G | = Field of square roots of diffusion tensors used to drive the smoothing.
  | amplitude | = amplitude of the smoothing.
  | dl | = spatial discretization.
  | da | = angular discretization.
  | gauss_prec | = precision of the gaussian function.
  | interpolation | Used interpolation scheme (0 = nearest-neighbor, 1 = linear, 2 = Runge-Kutta)
  | fast_approx | = Tell to use the fast approximation or not.

CImg get_blur_anisotropic | ( | const float | amplitude,
|  | const float | sharpness = `0.8f`,
|  | const float | anisotropy = `0.3f`,
|  | const float | alpha = `1.2f`,
|  | const float | sigma = `0.8f`,
|  | const float | dl = `0.8f`,
|  | const float | da = `30.0f`,
|  | const float | gauss_prec = `2.0f`,
|  | const unsigned int | interpolation = `0`,
|  | const bool | fast_approx = `true`
| ) | const

  | Blur an image in an anisotropic way. Parameters:
  | amplitude | = amplitude of the anisotropic blur.
  | sharpness | = define the contour preservation.
  | anisotropy | = define the smoothing anisotropy.
  | alpha | = image pre-blurring (gaussian).
  | sigma | = regularity of the tensor-valued geometry.
  | dl | = spatial discretization.
  | da | = angular discretization.
  | gauss_prec | = precision of the gaussian function.
  | interpolation | Used interpolation scheme (0 = nearest-neighbor, 1 = linear, 2 = Runge-Kutta)
  | fast_approx | = Tell to use the fast approximation or not

const CImg& display | ( | const int | min_size = `128`,
|  | const int | max_size = `1024`
| ) | const

| Display an image in a window, with a default title. See also. See also: display() for details on parameters.

static CImg get_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>::get_load() will try to load a CRAW file (CImg Raw file).

CImg& load | ( | const char * | filename | ) |

| Load an image from a file. This is the in-place version of get_load().

CImg& load_ascii | ( | const char * | filename | ) |

| Load an image from an ASCII file (in-place version). This is the in-place version of get_load_ascii().

CImg& load_dlm | ( | const char * | filename | ) |

| Load an image from a DLM file (in-place version). This is the in-place version of get_load_dlm().

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.

const CImg& save_convert | ( | const char * | filename,
|  | const unsigned int | quality = `100`
| ) | 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 ).

const CImg& save_png | ( | const char * | filename | ) | const

  | Save an image to a PNG file. Parameters:
  | filename | = name of the png image file to load
Returns: *this Note: The png format specifies a variety of possible data formats. Grey scale, Grey scale with Alpha, RGB color, RGB color with Alpha, and Palletized color are supported. Per channel bit depths of 1, 2, 4, 8, and 16 are natively supported. The type of file saved depends on the number of channels in the CImg file. If there is 4 or more channels, the image will be saved as an RGB color with Alpha image using the bottom 4 channels. If there are 3 channels, the saved image will be an RGB color image. If 2 channels then the image saved will be Grey scale with Alpha, and if 1 channel will be saved as a Grey scale image.

The CImg Library - C++ Template Image Processing Library