![]()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CImg< T > Struct Template Reference Class representing an image (up to 4 dimensions wide), each pixel being of type
Detailed Descriptiontemplate<typename T>
|
typedef T* iterator |
Simple iterator type, to loop through each pixel value of an image instance.
CImg<T>::iterator
type is defined to be a T*
.CImg<T>
. CImg<float> img("reference.jpg"); // Load image from file. for (CImg<float>::iterator it = img.begin(), it<img.end(); ++it) *it = 0; // Set all pixels to '0', through a CImg iterator. img.fill(0); // Do the same with a built-in method.
typedef const T* const_iterator |
Simple const iterator type, to loop through each pixel value of a const
image instance.
CImg<T>::const_iterator
type is defined to be a const
T*
.CImg<T>
. const CImg<float> img("reference.jpg"); // Load image from file. float sum = 0; for (CImg<float>::iterator it = img.begin(), it<img.end(); ++it) sum+=*it; // Compute sum of all pixel values, through a CImg iterator. const float sum2 = img.sum(); // Do the same with a built-in method.
typedef T value_type |
Pixel value type.
Refer to the type of the pixel values of an image instance.
CImg<T>::value_type
type of a CImg<T>
is defined to be a T
.CImg<T>::value_type
is actually not used in CImg methods. It has been mainly defined for compatibility with STL naming conventions. ~CImg | ( | ) |
Destroy image.
CImg | ( | ) |
Construct empty image.
0
, as well as its pixel buffer pointer data().T
.CImg<float> img1, img2; // Construct two empty images. img1.assign(256,256,1,3); // Re-assign 'img1' to be a 256x256x1x3 (color) image. img2 = img1.get_rand(0,255); // Re-assign 'img2' to be a random-valued version of 'img1'. img2.assign(); // Re-assign 'img2' to be an empty image again.
CImg | ( | const unsigned int | size_x, |
const unsigned int | size_y = 1 , |
||
const unsigned int | size_z = 1 , |
||
const unsigned int | size_c = 1 |
||
) | [explicit] |
Construct image with specified size.
size_x | Image width(). |
size_y | Image height(). |
size_z | Image depth(). |
size_c | Image spectrum() (number of channels). |
size_x
,size_y
,size_z
or size_c
to 0
leads to the construction of an empty image.CImgInstanceException
is thrown when the pixel buffer cannot be allocated (e.g. when requested size is too big for available memory). 0
), use constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int,T) instead. CImg<float> img1(256,256,1,3); // Construct a 256x256x1x3 (color) image, filled with garbage values. CImg<float> img2(256,256,1,3,0); // Construct a 256x256x1x3 (color) image, filled with value '0'.
CImg | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const T | value | ||
) |
Construct image with specified size and initialize pixel values.
size_x | Image width(). |
size_y | Image height(). |
size_z | Image depth(). |
size_c | Image spectrum() (number of channels). |
value | Initialization value. |
value
. CImg | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const int | value0, | ||
const int | value1, | ||
... | |||
) |
Construct image with specified size and initialize pixel values from a sequence of integers.
Construct a new image instance of size size_x
x size_y
x size_z
x size_c
, with pixels of type T
, and initialize pixel values from the specified sequence of integers value0
,value1
,...
size_x | Image width(). |
size_y | Image height(). |
size_z | Image depth(). |
size_c | Image spectrum() (number of channels). |
value0 | First value of the initialization sequence (must be an integer). |
value1 | Second value of the initialization sequence (must be an integer). |
... |
size_x*size_y*size_z*size_c
integers
in
the
initialization sequence. Otherwise, the constructor may crash or fill your image pixels with garbage. const CImg<float> img(2,2,1,3, // Construct a 2x2 color (RGB) image. 0,255,0,255, // Set the 4 values for the red component. 0,0,255,255, // Set the 4 values for the green component. 64,64,64,64); // Set the 4 values for the blue component. img.resize(150,150).display();
CImg | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const double | value0, | ||
const double | value1, | ||
... | |||
) |
Construct image with specified size and initialize pixel values from a sequence of doubles.
Construct a new image instance of size size_x
x size_y
x size_z
x size_c
, with pixels of type T
, and initialize pixel values from the specified sequence of doubles value0
,value1
,...
size_x | Image width(). |
size_y | Image height(). |
size_z | Image depth(). |
size_c | Image spectrum() (number of channels). |
value0 | First value of the initialization sequence (must be a double). |
value1 | Second value of the initialization sequence (must be a double). |
... |
dx*dy*dz*dc
doubles
in
the
initialization sequence. Otherwise, the constructor may crash or fill your image with garbage. For instance, the code below will probably crash on most platforms: const CImg<float> img(2,2,1,1, 0.5,0.5,255,255); // FAIL: The two last arguments are 'int', not 'double'!
CImg | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const char *const | values, | ||
const bool | repeat_values | ||
) |
Construct image with specified size and initialize pixel values from a value string.
Construct a new image instance of size size_x
x size_y
x size_z
x size_c
, with pixels of type T
, and initializes pixel values from the specified string values
.
size_x | Image width(). |
size_y | Image height(). |
size_z | Image depth(). |
size_c | Image spectrum() (number of channels). |
values | Value string describing the way pixel values are set. |
repeat_values | Tells if the value filling process is repeated over the image. |
values
.values
may describe two different filling processes:values
is a sequences of values assigned to the image pixels, as in "1,2,3,7,8,2"
. In this case, set repeat_values
to true
to periodically fill the image with the value sequence.values
is a formula, as in "cos(x/10)*sin(y/20)"
. In this case, parameter repeat_values
is pointless.repeat_values
is mandatory. It disambiguates the possible overloading of constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int,T) with T
being a const char*
.CImgArgumentException
is thrown when an invalid value string values
is specified. const CImg<float> img1(129,129,1,3,"0,64,128,192,255",true), // Construct image filled from a value sequence. img2(129,129,1,3,"if(c==0,255*abs(cos(x/10)),1.8*y)",false); // Construct image filled from a formula. (img1,img2).display();
CImg | ( | const t *const | values, |
const unsigned int | size_x, | ||
const unsigned int | size_y = 1 , |
||
const unsigned int | size_z = 1 , |
||
const unsigned int | size_c = 1 , |
||
const bool | is_shared = false |
||
) |
Construct image with specified size and initialize pixel values from a memory buffer.
Construct a new image instance of size size_x
x size_y
x size_z
x size_c
, with pixels of type T
, and initializes pixel values from the specified t*
memory buffer.
values | Pointer to the input memory buffer. |
size_x | Image width(). |
size_y | Image height(). |
size_z | Image depth(). |
size_c | Image spectrum() (number of channels). |
is_shared | Tells if input memory buffer must be shared by the current instance. |
is_shared
is false
, the image instance allocates its own pixel buffer, and values from the specified input buffer are copied to the instance buffer. If buffer types T
and t
are different, a regular static cast is performed during buffer copy.T
and t
are the same. Later, destroying such a shared image will not deallocate the pixel buffer, this task being obviously charged to the initial buffer allocator.CImgInstanceException
is thrown when the pixel buffer cannot be allocated (e.g. when requested size is too big for available memory). unsigned char tab[256*256] = { 0 }; CImg<unsigned char> img1(tab,256,256,1,1,false), // Construct new non-shared image from buffer 'tab'. img2(tab,256,256,1,1,true); // Construct new shared-image from buffer 'tab'. tab[1024] = 255; // Here, 'img2' is indirectly modified, but not 'img1'.
CImg | ( | const char *const | filename | ) | [explicit] |
Construct image from reading an image file.
Construct a new image instance with pixels of type T
, and initialize pixel values with the data read from an image file.
filename | Filename, as a C-string. |
T
should better fit the file format specification, or data loss may occur during file load (e.g. constructing a CImg<unsigned char>
from a float-valued image file).CImgIOException
is thrown when the specified filename
cannot be read, or if the file format is not recognized. const CImg<float> img("reference.jpg"); img.display();
Construct image copy.
Construct a new image instance with pixels of type T
, as a copy of an existing CImg<t>
instance.
img | Input image to copy. |
img
.img
is shared and if types T
and t
are the same, the constructed copy is also shared, and shares its pixel buffer with img
. Modifying a pixel value in the constructed copy will thus also modifies it in the input image img
. This behavior is needful to allow functions to return shared images.img
into its buffer. The copied pixel values may be eventually statically casted if types T
and t
are different.img
when types t
and T
are the same is significantly faster than with different types.CImgInstanceException
is thrown when the pixel buffer cannot be allocated (e.g. not enough available memory). Advanced copy constructor.
Construct a new image instance with pixels of type T
, as a copy of an existing CImg<t>
instance, while forcing the shared state of the constructed copy.
img | Input image to copy. |
is_shared | Tells about the shared state of the constructed copy. |
img:
is_shared
is true
, the constructed copy will share its pixel buffer with the input image img
. For that case, the pixel types T
and t
must be the same.is_shared
is false
, the constructed copy will allocate its own pixel buffer, whether the input image img
is shared or not.CImgArgumentException
is thrown when a shared copy is requested with different pixel types T
and t
. Construct image with dimensions borrowed from another image.
Construct a new image instance with pixels of type T
, and size get from some dimensions of an existing CImg<t>
instance.
img | Input image from which dimensions are borrowed. |
dimensions | C-string describing the image size along the X,Y,Z and C-dimensions. |
CImg<t>
instance.0
), use constructor CImg(const CImg<t>&,const char*,T) instead. const CImg<float> img1(256,128,1,3), // 'img1' is a 256x128x1x3 image. img2(img1,"xyzc"), // 'img2' is a 256x128x1x3 image. img3(img1,"y,x,z,c"), // 'img3' is a 128x256x1x3 image. img4(img1,"c,x,y,3",0), // 'img4' is a 3x128x256x3 image (with pixels initialized to '0').
Construct image with dimensions borrowed from another image and initialize pixel values.
Construct a new image instance with pixels of type T
, and size get from the dimensions of an existing CImg<t>
instance, and set all pixel values to specified value
.
img | Input image from which dimensions are borrowed. |
dimensions | String describing the image size along the X,Y,Z and V-dimensions. |
value | Value used for initialization. |
value
. CImg | ( | const CImgDisplay & | disp | ) | [explicit] |
Construct image from a display window.
Construct a new image instance with pixels of type T
, as a snapshot of an existing CImgDisplay
instance.
disp | Input display window. |
CImgDisplay
.1
and 3
(i.e. a 2d color image).Construct empty image [in-place version].
In-place version of the default constructor CImg(). It simply resets the instance to an empty image.
CImg<T>& assign | ( | const unsigned int | size_x, |
const unsigned int | size_y = 1 , |
||
const unsigned int | size_z = 1 , |
||
const unsigned int | size_c = 1 |
||
) |
Construct image with specified size [in-place version].
In-place version of the constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int).
CImg<T>& assign | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const T | value | ||
) |
Construct image with specified size and initialize pixel values [in-place version].
In-place version of the constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int,T).
CImg<T>& assign | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const int | value0, | ||
const int | value1, | ||
... | |||
) |
Construct image with specified size and initialize pixel values from a sequence of integers [in-place version].
In-place version of the constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int,int,int,...).
CImg<T>& assign | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const double | value0, | ||
const double | value1, | ||
... | |||
) |
Construct image with specified size and initialize pixel values from a sequence of doubles [in-place version].
In-place version of the constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int,double,double,...).
CImg<T>& assign | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c, | ||
const char *const | values, | ||
const bool | repeat_values | ||
) |
Construct image with specified size and initialize pixel values from a value string [in-place version].
In-place version of the constructor CImg(unsigned int,unsigned int,unsigned int,unsigned int,const char*,bool).
CImg<T>& assign | ( | const t *const | values, |
const unsigned int | size_x, | ||
const unsigned int | size_y = 1 , |
||
const unsigned int | size_z = 1 , |
||
const unsigned int | size_c = 1 |
||
) |
Construct image with specified size and initialize pixel values from a memory buffer [in-place version].
In-place version of the constructor CImg(const t*,unsigned int,unsigned int,unsigned int,unsigned int).
Construct image from reading an image file [in-place version].
In-place version of the constructor CImg(const char*).
Construct image copy [in-place version].
In-place version of the constructor CImg(const CImg<t>&).
In-place version of the advanced copy constructor.
In-place version of the constructor CImg(const CImg<t>&,bool).
Construct image with dimensions borrowed from another image [in-place version].
In-place version of the constructor CImg(const CImg<t>&,const char*).
Construct image with dimensions borrowed from another image and initialize pixel values [in-place version].
In-place version of the constructor CImg(const CImg<t>&,const char*,T).
CImg<T>& assign | ( | const CImgDisplay & | disp | ) |
Construct image from a display window [in-place version].
In-place version of the constructor CImg(const CImgDisplay&).
Construct empty image [in-place version].
Equivalent to assign().
Transfer content of an image instance into another one.
Transfer the dimensions and the pixel buffer content of an image instance into another one, and replace instance by an empty image. It avoids the copy of the pixel buffer when possible.
img | Destination image. |
T
and t
of source and destination images can be different, though the process is designed to be instantaneous when T
and t
are the same. CImg<float> src(256,256,1,3,0), // Construct a 256x256x1x3 (color) image filled with value '0'. dest(16,16); // Construct a 16x16x1x1 (scalar) image. src.move_to(dest); // Now, 'src' is empty and 'dest' is the 256x256x1x3 image.
Transfer content of an image instance into a new image in an image list.
Transfer the dimensions and the pixel buffer content of an image instance into a newly inserted image at position pos
in specified CImgList<t>
instance.
list | Destination list. |
pos | Position of the newly inserted image in the list. |
pos
is ommited, the image instance is transfered as a new image at the end of the specified list
.CImgList<float> list; // Construct an empty image list. CImg<float> img("reference.jpg"); // Read image from filename. img.move_to(list); // Transfer image content as a new item in the list (no buffer copy).
Swap fields of two image instances.
img | Image to swap fields with. |
CImg<float> img1("lena.jpg"), img2("milla.jpg"); img1.swap(img2); // Now, 'img1' is 'milla' and 'img2' is 'lena'.
Return a reference to an empty image.
CImg<T>
in functions prototypes, e.g. void f(const int x=0, const int y=0, const CImg<float>& img=CImg<float>::empty());
T& operator() | ( | const unsigned int | x, |
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 , |
||
const unsigned int | c = 0 |
||
) |
Access to a pixel value.
Return a reference to a located pixel value of the image instance, being possibly const, whether the image instance is const or not. This is the standard method to get/set pixel values in CImg<T>
images.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
(0,0,0,0)
to (width()-1,height()-1,depth()-1,spectrum()-1)
.1
. For instance, pixels of a 2d image (depth() equal to 1
) can be accessed by img(x,y,c)
instead of img(x,y,0,c)
. 'cimg_verbosity'>=3
to enable additional boundary checking operations in this operator. In that case, warning messages will be printed on the error output when accessing out-of-bounds pixels. CImg<float> img(100,100,1,3,0); // Construct a 100x100x1x3 (color) image with pixels set to '0'. const float valR = img(10,10,0,0), // Read red value at coordinates (10,10). valG = img(10,10,0,1), // Read green value at coordinates (10,10) valB = img(10,10,2), // Read blue value at coordinates (10,10) (Z-coordinate can be omitted). avg = (valR + valG + valB)/3; // Compute average pixel value. img(10,10,0) = img(10,10,1) = img(10,10,2) = avg; // Replace the color pixel (10,10) by the average grey value.
T& operator() | ( | const unsigned int | x, |
const unsigned int | y, | ||
const unsigned int | z, | ||
const unsigned int | c, | ||
const unsigned long | wh, | ||
const unsigned long | whd = 0 |
||
) |
Access to a pixel value.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
wh | Precomputed offset, must be equal to width()*height() . |
whd | Precomputed offset, must be equal to width()*height()*depth() . |
operator T * | ( | ) |
Implicitely cast an image into a T*
.
Implicitely cast a CImg<T>
instance into a T*
or const
T*
pointer, whether the image instance is const or not. The returned pointer points on the first value of the image pixel buffer.
0
in this case), e.g. CImg<float> img1(100,100), img2; // 'img1' is a 100x100 image, 'img2' is an empty image. if (img1) { // Test succeeds, 'img1' is not an empty image. if (!img2) { // Test succeeds, 'img2' is an empty image. std::printf("'img1' is not empty, 'img2' is empty."); } }
CImg<T>::operator[]()
, e.g. CImg<float> img(100,100); const float value = img[99]; // Access to value of the last pixel on the first row. img[510] = 255; // Set pixel value at (10,5).
CImg<T>& operator= | ( | const T | value | ) |
Assign a value to all image pixels.
Assign specified value
to each pixel value of the image instance.
value | Value that will be assigned to image pixels. |
value
may be casted to pixel type T
if necessary. CImg<char> img(100,100); // Declare image (with garbage values). img = 0; // Set all pixel values to '0'. img = 1.2; // Set all pixel values to '1' (cast of '1.2' as a 'char').
CImg<T>& operator= | ( | const char *const | expression | ) |
Assign pixels values from a specified expression.
Initialize all pixel values from the specified string expression
.
expression | Value string describing the way pixel values are set. |
expression
may describe different things:expression
is a list of values (as in "1,2,3,8,3,2"
), or a formula (as in "(x*y)%255"
), the pixel values are set from specified expression
and the image size is not modified.expression
is a filename (as in "reference.jpg"
), the corresponding image file is loaded and replace the image instance. The image size is modified if necessary. CImg<float> img1(100,100), img2(img1), img3(img1); // Declare three 100x100 scalar images with unitialized pixel values. img1 = "0,50,100,150,200,250,200,150,100,50"; // Set pixel values of 'img1' from a value sequence. img2 = "10*((x*y)%25)"; // Set pixel values of 'img2' from a formula. img3 = "reference.jpg"; // Set pixel values of 'img3' from a file (image size is modified). (img1,img2,img3).display();
Copy an image into the current image instance.
Similar to the in-place copy constructor assign(const CImg<t>&).
CImg<T>& operator= | ( | const CImgDisplay & | disp | ) |
Copy the content of a display window to the current image instance.
Similar to assign(const CImgDisplay&).
CImg<T>& operator+= | ( | const t | value | ) |
In-place addition operator.
Add specified value
to all pixels of an image instance.
value | Value to add. |
T
. For instance, adding 0.2
to a CImg<char>
is possible but does nothing indeed.CImg<unsigned char> img(100,100,1,1,255); // Construct a 100x100 image with pixel values '255'. img+=1; // Add '1' to each pixels -> Overflow. // here all pixels of image 'img' are equal to '0'.
T
as float
or double
, and use cut() after addition. CImg<unsigned char> img1("reference.jpg"); // Load a 8-bits RGB image (values in [0,255]). CImg<float> img2(img1); // Construct a float-valued copy of 'img1'. img2+=100; // Add '100' to pixel values -> goes out of [0,255] but no problems with floats. img2.cut(0,255); // Cut values in [0,255] to fit the 'unsigned char' constraint. img1 = img2; // Rewrite safe result in 'unsigned char' version 'img1'. const CImg<unsigned char> img3 = (img1 + 100).cut(0,255); // Do the same in a more simple and elegant way. (img1,img2,img3).display();
CImg<T>& operator+= | ( | const char *const | expression | ) |
In-place addition operator.
Add values to image pixels, according to the specified string expression
.
expression | Value string describing the way pixel values are added. |
In-place addition operator.
Add values to image pixels, according to the values of the input image img
.
img | Input image to add. |
img
has the same size as the image instance. If less values are available in img
, then the values are added cyclically. For instance, adding one WxH scalar image (spectrum() equal to 1
) to one WxH color image (spectrum() equal to 3
) means each color channel will be incremented with the same values at the same locations. CImg<float> img1("reference.jpg"); // Load a RGB color image (img1.spectrum()==3) const CImg<float> img2(img1.width(),img.height(),1,1,"255*(x/w)^2"); // Construct a scalar shading (img2.spectrum()==1). img1+=img2; // Add shading to each channel of 'img1'. img1.cut(0,255); // Prevent [0,255] overflow. (img2,img1).display();
CImg<T>& operator++ | ( | ) |
In-place increment operator (prefix).
Add 1
to all image pixels, and return a reference to the current incremented image instance.
++img
is equivalent to img+=1
. CImg<T> operator++ | ( | int | ) |
In-place increment operator (postfix).
Add 1
to all image pixels, and return a new copy of the initial (pre-incremented) image instance.
CImg<T> operator+ | ( | ) | const |
Return a non-shared copy of the image instance.
T
. Indeed, the usual copy constructor CImg<T>(const CImg<T>&) returns a shared copy of a shared input image, and it may be not desirable to work on a regular copy (e.g. for a resize operation) if you have no informations about the shared state of the input image.
(+img) is equivalent to CImg<T>(img,false)
. CImg< typename cimg::superset<T,t>::type > operator+ | ( | const t | value | ) | const |
Addition operator.
Similar to operator+=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<Tfloat> operator+ | ( | const char *const | expression | ) | const |
Addition operator.
Similar to operator+=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
Addition operator.
Similar to operator+=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<T>& operator-= | ( | const t | value | ) |
In-place substraction operator.
Similar to operator+=(const t), except that it performs a substraction instead of an addition.
CImg<T>& operator-= | ( | const char *const | expression | ) |
In-place substraction operator.
Similar to operator+=(const char*), except that it performs a substraction instead of an addition.
In-place substraction operator.
Similar to operator+=(const CImg<t>&), except that it performs a substraction instead of an addition.
CImg<T>& operator-- | ( | ) |
In-place decrement operator (prefix).
Similar to operator++(), except that it performs a decrement instead of an increment.
CImg<T> operator-- | ( | int | ) |
In-place decrement operator (postfix).
Similar to operator++(int), except that it performs a decrement instead of an increment.
CImg<T> operator- | ( | ) | const |
Replace each pixel by its opposite value.
unsigned
char
opposite of 1
is 255
. const CImg<unsigned char> img1("reference.jpg"), // Load a RGB color image. img2 = -img1; // Compute its opposite (in 'unsigned char'). (img1,img2).display();
CImg< typename cimg::superset<T,t>::type > operator- | ( | const t | value | ) | const |
Substraction operator.
Similar to operator-=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<Tfloat> operator- | ( | const char *const | expression | ) | const |
Substraction operator.
Similar to operator-=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
Substraction operator.
Similar to operator-=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<T>& operator*= | ( | const t | value | ) |
In-place multiplication operator.
Similar to operator+=(const t), except that it performs a multiplication instead of an addition.
CImg<T>& operator*= | ( | const char *const | expression | ) |
In-place multiplication operator.
Similar to operator+=(const char*), except that it performs a multiplication instead of an addition.
In-place multiplication operator.
Replace the image instance by the matrix multiplication between the image instance and the specified matrix img
.
img | Second operand of the matrix multiplication. |
CImg<float> A(2,2,1,1, 1,2,3,4); // Construct 2x2 matrix A = [1,2;3,4]. const CImg<float> X(1,2,1,1, 1,2); // Construct 1x2 vector X = [1;2]. A*=X; // Assign matrix multiplication A*X to 'A'. // 'A' is now a 1x2 vector whose values are [5;11].
CImg< typename cimg::superset<T,t>::type > operator* | ( | const t | value | ) | const |
Multiplication operator.
Similar to operator*=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<Tfloat> operator* | ( | const char *const | expression | ) | const |
Multiplication operator.
Similar to operator*=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
Multiplication operator.
Similar to operator*=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<T>& operator/= | ( | const t | value | ) |
In-place division operator.
Similar to operator+=(const t), except that it performs a division instead of an addition.
CImg<T>& operator/= | ( | const char *const | expression | ) |
In-place division operator.
Similar to operator+=(const char*), except that it performs a division instead of an addition.
In-place division operator.
Replace the image instance by the (right) matrix division between the image instance and the specified matrix img
.
img | Second operand of the matrix division. |
A*inverse
(img).CImg< typename cimg::superset<T,t>::type > operator/ | ( | const t | value | ) | const |
Division operator.
Similar to operator/=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<Tfloat> operator/ | ( | const char *const | expression | ) | const |
Division operator.
Similar to operator/=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
Division operator.
Similar to operator/=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<T>& operator%= | ( | const t | value | ) |
In-place modulo operator.
Similar to operator+=(const t), except that it performs a modulo operation instead of an addition.
CImg<T>& operator%= | ( | const char *const | expression | ) |
In-place modulo operator.
Similar to operator+=(const char*), except that it performs a modulo operation instead of an addition.
In-place modulo operator.
Similar to operator+=(const CImg<t>&), except that it performs a modulo operation instead of an addition.
CImg< typename cimg::superset<T,t>::type > operator% | ( | const t | value | ) | const |
Modulo operator.
Similar to operator%=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<Tfloat> operator% | ( | const char *const | expression | ) | const |
Modulo operator.
Similar to operator%=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
Modulo operator.
Similar to operator%=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image may be a superset of the initial pixel type T
, if necessary.
CImg<T>& operator&= | ( | const t | value | ) |
In-place bitwise AND operator.
Similar to operator+=(const t), except that it performs a bitwise AND operation instead of an addition.
CImg<T>& operator&= | ( | const char *const | expression | ) |
In-place bitwise AND operator.
Similar to operator+=(const char*), except that it performs a bitwise AND operation instead of an addition.
In-place bitwise AND operator.
Similar to operator+=(const CImg<t>&), except that it performs a bitwise AND operation instead of an addition.
CImg<T> operator& | ( | const t | value | ) | const |
Bitwise AND operator.
Similar to operator&=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T> operator& | ( | const char *const | expression | ) | const |
Bitwise AND operator.
Similar to operator&=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
Bitwise AND operator.
Similar to operator&=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T>& operator|= | ( | const t | value | ) |
In-place bitwise OR operator.
Similar to operator+=(const t), except that it performs a bitwise OR operation instead of an addition.
CImg<T>& operator|= | ( | const char *const | expression | ) |
In-place bitwise OR operator.
Similar to operator+=(const char*), except that it performs a bitwise OR operation instead of an addition.
In-place bitwise OR operator.
Similar to operator+=(const CImg<t>&), except that it performs a bitwise OR operation instead of an addition.
CImg<T> operator| | ( | const t | value | ) | const |
Bitwise OR operator.
Similar to operator|=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T> operator| | ( | const char *const | expression | ) | const |
Bitwise OR operator.
Similar to operator|=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
Bitwise OR operator.
Similar to operator|=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T>& operator^= | ( | const t | value | ) |
In-place bitwise XOR operator.
Similar to operator+=(const t), except that it performs a bitwise XOR operation instead of an addition.
CImg<T>& operator^= | ( | const char *const | expression | ) |
In-place bitwise XOR operator.
Similar to operator+=(const char*), except that it performs a bitwise XOR operation instead of an addition.
In-place bitwise XOR operator.
Similar to operator+=(const CImg<t>&), except that it performs a bitwise XOR operation instead of an addition.
CImg<T> operator^ | ( | const t | value | ) | const |
Bitwise XOR operator.
Similar to operator^=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T> operator^ | ( | const char *const | expression | ) | const |
Bitwise XOR operator.
Similar to operator^=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
Bitwise XOR operator.
Similar to operator^=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T>& operator<<= | ( | const t | value | ) |
In-place bitwise left shift operator.
Similar to operator+=(const t), except that it performs a bitwise left shift instead of an addition.
CImg<T>& operator<<= | ( | const char *const | expression | ) |
In-place bitwise left shift operator.
Similar to operator+=(const char*), except that it performs a bitwise left shift instead of an addition.
In-place bitwise left shift operator.
Similar to operator+=(const CImg<t>&), except that it performs a bitwise left shift instead of an addition.
CImg<T> operator<< | ( | const t | value | ) | const |
Bitwise left shift operator.
Similar to operator<<=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T> operator<< | ( | const char *const | expression | ) | const |
Bitwise left shift operator.
Similar to operator<<=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
Bitwise left shift operator.
Similar to operator<<=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T>& operator>>= | ( | const t | value | ) |
In-place bitwise right shift operator.
Similar to operator+=(const t), except that it performs a bitwise right shift instead of an addition.
CImg<T>& operator>>= | ( | const char *const | expression | ) |
In-place bitwise right shift operator.
Similar to operator+=(const char*), except that it performs a bitwise right shift instead of an addition.
In-place bitwise right shift operator.
Similar to operator+=(const CImg<t>&), except that it performs a bitwise right shift instead of an addition.
CImg<T> operator>> | ( | const t | value | ) | const |
Bitwise right shift operator.
Similar to operator>>=(const t), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
CImg<T> operator>> | ( | const char *const | expression | ) | const |
Bitwise right shift operator.
Similar to operator>>=(const char*), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
Bitwise right shift operator.
Similar to operator>>=(const CImg<t>&), except that it returns a new image instance instead of operating in-place. The pixel type of the returned image is T
.
Bitwise inversion operator.
Similar to operator-(), except that it compute the bitwise inverse instead of the opposite value.
bool operator== | ( | const t | value | ) | const |
Test if all pixels of an image have the same value.
Return true
is all pixels of the image instance are equal to the specified value
.
value | Reference value to compare with. |
bool operator== | ( | const char *const | expression | ) | const |
Test if all pixel values of an image follow a specified expression.
Return true
is all pixels of the image instance are equal to the specified expression
.
expression | Value string describing the way pixel values are compared. |
bool operator== | ( | const CImg< t > & | img | ) | const |
Test if two images have the same size and values.
Return true
if the image instance and the input image img
have the same dimensions and pixel values, and false
otherwise.
img | Input image to compare with. |
true
. Only the dimensions and the pixel values matter. Thus, the comparison can be true
even for different pixel types T
and t
. const CImg<float> img1(1,3,1,1, 0,1,2); // Construct a 1x3 vector [0;1;2] (with 'float' pixel values). const CImg<char> img2(1,3,1,1, 0,1,2); // Construct a 1x3 vector [0;1;2] (with 'char' pixel values). if (img1==img2) { // Test succeeds, image dimensions and values are the same. std::printf("'img1' and 'img2' have same dimensions and values."); }
bool operator!= | ( | const t | value | ) | const |
Test if pixels of an image are all different from a value.
Return true
is all pixels of the image instance are different than the specified value
.
value | Reference value to compare with. |
bool operator!= | ( | const char *const | expression | ) | const |
Test if all pixel values of an image are different from a specified expression.
Return true
is all pixels of the image instance are different to the specified expression
.
expression | Value string describing the way pixel values are compared. |
bool operator!= | ( | const CImg< t > & | img | ) | const |
Test if two images have different sizes or values.
Return true
if the image instance and the input image img
have different dimensions or pixel values, and false
otherwise.
img | Input image to compare with. |
img1!=img2
is equivalent to !
(img1==img2). Construct an image list from two images.
Return a new list of image (CImgList
instance) containing exactly two elements:
0
].img
, at position [1
].img | Input image that will be the second image of the resulting list. |
img
are shared, they are inserted as new non-shared copies in the resulting list.T
, if necessary. N
times will perform N
copies of the entire content of a (growing) image list. This may become very expensive in terms of speed and used memory. You should avoid using this technique to build a new CImgList instance from several images, if you are seeking for performance. Fast insertions of images in an image list are possible with CImgList<T>::insert(const CImg<t>&,unsigned int,bool) or move_to(CImgList<t>&,unsigned int). const CImg<float> img1("reference.jpg"), img2 = img1.get_mirror('x'), img3 = img2.get_blur(5); const CImgList<float> list = (img1,img2); // Create list of two elements from 'img1' and 'img2'. (list,img3).display(); // Display image list containing copies of 'img1','img2' and 'img3'.
Construct an image list from image instance and an input image list.
Return a new list of images (CImgList
instance) containing exactly list.size()
+
1
elements:
0
].list
, from positions [1
] to [list.size()
].list | Input image list that will be appended to the image instance. |
CImgList<T> operator< | ( | const char | axis | ) | const |
Split image along specified axis.
Return a new list of images (CImgList
instance) containing the splitted components of the instance image along the specified axis.
axis | Splitting axis (can be 'x' ,'y' ,'z' or 'c' ) |
const CImg<unsigned char> img("reference.jpg"); // Load a RGB color image. const CImgList<unsigned char> list = (img<'c'); // Get a list of its three R,G,B channels. (img,list).display();
static const char* pixel_type | ( | ) | [static] |
Return the type of image pixel values as a C string.
Return a char*
string containing the usual type name of the image pixel values (i.e. a stringified version of the template parameter T
).
"unsigned char"
).T
does not correspond to a registered type, the string "unknown"
is returned. int width | ( | ) | const |
Return the number of image columns.
Return the image width, i.e. the image dimension along the X-axis.
0
.1
when considering images as vectors for matrix calculations.int
, although the image width is internally stored as an unsigned
int
. Using an int
is safer and prevents arithmetic traps possibly encountered when doing calculations involving unsigned
int
variables. Access to the initial unsigned
int
variable is possible (though not recommended) by (*this)._width
. int height | ( | ) | const |
Return the number of image rows.
Return the image height, i.e. the image dimension along the Y-axis.
0
.int
, although the image height is internally stored as an unsigned
int
. Using an int
is safer and prevents arithmetic traps possibly encountered when doing calculations involving unsigned
int
variables. Access to the initial unsigned
int
variable is possible (though not recommended) by (*this)._height
. int depth | ( | ) | const |
Return the number of image slices.
Return the image depth, i.e. the image dimension along the Z-axis.
0
.1
when considering usual 2d images. When depth()>
1
, the image is said to be volumetric.int
, although the image depth is internally stored as an unsigned
int
. Using an int
is safer and prevents arithmetic traps possibly encountered when doing calculations involving unsigned
int
variables. Access to the initial unsigned
int
variable is possible (though not recommended) by (*this)._depth
. int spectrum | ( | ) | const |
Return the number of image channels.
Return the number of image channels, i.e. the image dimension along the C-axis.
0
.1
when considering scalar-valued images, to 3
for RGB-coded color images, and to 4
for RGBA-coded color images (with alpha-channel). The number of channels of an image instance is not limited. The meaning of the pixel values is not linked up to the number of channels (e.g. a 4-channel image may indifferently stands for a RGBA or CMYK color image).int
, although the image spectrum is internally stored as an unsigned
int
. Using an int
is safer and prevents arithmetic traps possibly encountered when doing calculations involving unsigned
int
variables. Access to the initial unsigned
int
variable is possible (though not recommended) by (*this)._spectrum
. unsigned long size | ( | ) | const |
Return the total number of pixel values.
Return width()*height()*depth()*spectrum()
, i.e. the total number of values of type T
in the pixel buffer of the image instance.
const CImg<float> img(100,100,1,3); // Construct new 100x100 color image. if (img.size()==30000) // Test succeeds. std::printf("Pixel buffer uses %lu bytes", img.size()*sizeof(float));
T* data | ( | ) |
Return a pointer to the first pixel value.
Return a T*
, or a const
T*
pointer to the first value in the pixel buffer of the image instance, whether the instance is const
or not.
0
(null pointer).data()
and goes to data()+size()-1
(included).T* data | ( | const unsigned int | x, |
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 , |
||
const unsigned int | c = 0 |
||
) |
Return a pointer to a located pixel value.
Return a T*
, or a const
T*
pointer to the value located at (x
,y
,z
,c
) in the pixel buffer of the image instance, whether the instance is const
or not.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
img.data(x,y,z,c)
is equivalent to &(img(x,y,z,c))
. Thus, this method has the same properties as operator()(unsigned int,unsigned int,unsigned int,unsigned int). long offset | ( | const int | x, |
const int | y = 0 , |
||
const int | z = 0 , |
||
const int | c = 0 |
||
) | const |
Return the offset to a located pixel value, with respect to the beginning of the pixel buffer.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
img.data(x,y,z,c)
is equivalent to &(img(x,y,z,c)) - img.data()
. Thus, this method has the same properties as operator()(unsigned int,unsigned int,unsigned int,unsigned int). const CImg<float> img(100,100,1,3); // Define a 100x100 RGB-color image. const long off = img.offset(10,10,0,2); // Get the offset of the blue value of the pixel located at (10,10). const float val = img[off]; // Get the blue value of this pixel.
Return a CImg<T>::iterator pointing to the first pixel value.
Return a CImg<T>::iterator pointing next to the last pixel value.
img.end()
is equivalent to img.data() + img.size()
.CImg<float> img(100,100,1,3); // Define a 100x100 RGB color image. for (CImg<float>::iterator it = img.begin(); it<img.end(); ++it) // 'img.end()' used here as an upper bound for the iterator. *it = 0;
T& front | ( | ) |
Return a reference to the first pixel value.
img.front()
is equivalent to img[0]
, or img(0,0,0,0)
.T& back | ( | ) |
Return a reference to the last pixel value.
img.end()
is equivalent to img[img.size()-1]
, or img(img.width()-1,img.height()-1,img.depth()-1,img.spectrum()-1)
.T& at | ( | const int | offset, |
const T | out_value | ||
) |
Access to a pixel value at a specified offset, using Dirichlet boundary conditions.
Return a reference to the pixel value of the image instance located at a specified offset
, or to a specified default value in case of out-of-bounds access.
offset | Offset to the desired pixel value. |
out_value | Default value returned if offset is outside image bounds. |
img.at(offset,out_value)
is similar to img[offset]
, except that if offset
is outside bounds (e.g. offset<0
or offset>=img.size()
), a reference to a value out_value
is safely returned instead.T& at | ( | const int | offset | ) |
Access to a pixel value at a specified offset, using Neumann boundary conditions.
Return a reference to the pixel value of the image instance located at a specified offset
, or to the nearest pixel location in the image instance in case of out-of-bounds access.
offset | Offset to the desired pixel value. |
offset<0
, then img
[0] is returned.offset>=img.size()
, then img
[img.size()-1] is returned._at(int)
. T& atX | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) |
Access to a pixel value, using Dirichlet boundary conditions for the X-coordinate.
Return a reference to the pixel value of the image instance located at (x
,y
,z
,c
), or to a specified default value in case of out-of-bounds access along the X-axis.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
out_value | Default value returned if (x ,y ,z ,c ) is outside image bounds. |
out_value
.T& atX | ( | const int | x, |
const int | y = 0 , |
||
const int | z = 0 , |
||
const int | c = 0 |
||
) |
Access to a pixel value, using Neumann boundary conditions for the X-coordinate.
Return a reference to the pixel value of the image instance located at (x
,y
,z
,c
), or to the nearest pixel location in the image instance in case of out-of-bounds access along the X-axis.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
_at(int,int,int,int)
. T& atXY | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) |
Access to a pixel value, using Dirichlet boundary conditions for the X and Y-coordinates.
Similar to atX(int,int,int,int,const T), except that boundary checking is performed both on X and Y-coordinates.
T& atXY | ( | const int | x, |
const int | y, | ||
const int | z = 0 , |
||
const int | c = 0 |
||
) |
Access to a pixel value, using Neumann boundary conditions for the X and Y-coordinates.
Similar to atX(int,int,int,int), except that boundary checking is performed both on X and Y-coordinates.
_atXY(int,int,int,int)
. T& atXYZ | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) |
Access to a pixel value, using Dirichlet boundary conditions for the X,Y and Z-coordinates.
Similar to atX(int,int,int,int,const T), except that boundary checking is performed both on X,Y and Z-coordinates.
T& atXYZ | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const int | c = 0 |
||
) |
Access to a pixel value, using Neumann boundary conditions for the X,Y and Z-coordinates.
Similar to atX(int,int,int,int), except that boundary checking is performed both on X,Y and Z-coordinates.
_atXYZ(int,int,int,int)
. T& atXYZC | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) |
Access to a pixel value, using Dirichlet boundary conditions.
Similar to atX(int,int,int,int,const T), except that boundary checking is performed on all X,Y,Z and C-coordinates.
T& atXYZC | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const int | c | ||
) |
Access to a pixel value, using Neumann boundary conditions.
Similar to atX(int,int,int,int), except that boundary checking is performed on all X,Y,Z and C-coordinates.
_atXYZC(int,int,int,int)
. Tfloat linear_atX | ( | const float | fx, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) | const |
Return pixel value, using linear interpolation and Dirichlet boundary conditions for the X-coordinate.
Return a linearly-interpolated pixel value of the image instance located at (fx
,y
,z
,c
), or a specified default value in case of out-of-bounds access along the X-axis.
fx | X-coordinate of the pixel value (float-valued). |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
out_value | Default value returned if (fx ,y ,z ,c ) is outside image bounds. |
float
, if the pixel type T
is not float-valued. Tfloat linear_atX | ( | const float | fx, |
const int | y = 0 , |
||
const int | z = 0 , |
||
const int | c = 0 |
||
) | const |
Return pixel value, using linear interpolation and Neumann boundary conditions for the X-coordinate.
Return a linearly-interpolated pixel value of the image instance located at (fx
,y
,z
,c
), or the value of the nearest pixel location in the image instance in case of out-of-bounds access along the X-axis.
fx | X-coordinate of the pixel value (float-valued). |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
_linear_atX(float,int,int,int)
. Tfloat linear_atXY | ( | const float | fx, |
const float | fy, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) | const |
Return pixel value, using linear interpolation and Dirichlet boundary conditions for the X and Y-coordinates.
Similar to linear_atX(float,int,int,int,const T) const, except that the linear interpolation and the boundary checking are achieved both for X and Y-coordinates.
Tfloat linear_atXY | ( | const float | fx, |
const float | fy, | ||
const int | z = 0 , |
||
const int | c = 0 |
||
) | const |
Return pixel value, using linear interpolation and Neumann boundary conditions for the X and Y-coordinates.
Similar to linear_atX(float,int,int,int) const, except that the linear interpolation and the boundary checking are achieved both for X and Y-coordinates.
_linear_atXY(float,float,int,int)
. Tfloat linear_atXYZ | ( | const float | fx, |
const float | fy, | ||
const float | fz, | ||
const int | c, | ||
const T | out_value | ||
) | const |
Return pixel value, using linear interpolation and Dirichlet boundary conditions for the X,Y and Z-coordinates.
Similar to linear_atX(float,int,int,int,const T) const, except that the linear interpolation and the boundary checking are achieved both for X,Y and Z-coordinates.
Tfloat linear_atXYZ | ( | const float | fx, |
const float | fy = 0 , |
||
const float | fz = 0 , |
||
const int | c = 0 |
||
) | const |
Return pixel value, using linear interpolation and Neumann boundary conditions for the X,Y and Z-coordinates.
Similar to linear_atX(float,int,int,int) const, except that the linear interpolation and the boundary checking are achieved both for X,Y and Z-coordinates.
_linear_atXYZ(float,float,float,int)
. Tfloat linear_atXYZC | ( | const float | fx, |
const float | fy, | ||
const float | fz, | ||
const float | fc, | ||
const T | out_value | ||
) | const |
Return pixel value, using linear interpolation and Dirichlet boundary conditions for all X,Y,Z and C-coordinates.
Similar to linear_atX(float,int,int,int,const T) const, except that the linear interpolation and the boundary checking are achieved for all X,Y,Z and C-coordinates.
Tfloat linear_atXYZC | ( | const float | fx, |
const float | fy = 0 , |
||
const float | fz = 0 , |
||
const float | fc = 0 |
||
) | const |
Return pixel value, using linear interpolation and Neumann boundary conditions for all X,Y,Z and C-coordinates.
Similar to linear_atX(float,int,int,int) const, except that the linear interpolation and the boundary checking are achieved for all X,Y,Z and C-coordinates.
_linear_atXYZC(float,float,float,float)
. Tfloat cubic_atX | ( | const float | fx, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) | const |
Return pixel value, using cubic interpolation and Dirichlet boundary conditions for the X-coordinate.
Return a cubicly-interpolated pixel value of the image instance located at (fx
,y
,z
,c
), or a specified default value in case of out-of-bounds access along the X-axis.
fx | d X-coordinate of the pixel value (float-valued). |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
out_value | Default value returned if (fx ,y ,z ,c ) is outside image bounds. |
float
, if the pixel type T
is not float-valued. Tfloat cubic_atX | ( | const float | fx, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const T | out_value, | ||
const Tfloat | min_value, | ||
const Tfloat | max_value | ||
) | const |
Return damped pixel value, using cubic interpolation and Dirichlet boundary conditions for the X-coordinate.
Similar to cubic_atX(float,int,int,int,const T) const, except that you can specify the authorized minimum and maximum of the returned value.
Tfloat cubic_atX | ( | const float | fx, |
const int | y = 0 , |
||
const int | z = 0 , |
||
const int | c = 0 |
||
) | const |
Return pixel value, using cubic interpolation and Neumann boundary conditions for the X-coordinate.
Return a cubicly-interpolated pixel value of the image instance located at (fx
,y
,z
,c
), or the value of the nearest pixel location in the image instance in case of out-of-bounds access along the X-axis.
fx | X-coordinate of the pixel value (float-valued). |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
_cubic_atX(float,int,int,int)
. Tfloat cubic_atX | ( | const float | fx, |
const int | y, | ||
const int | z, | ||
const int | c, | ||
const Tfloat | min_value, | ||
const Tfloat | max_value | ||
) | const |
Return damped pixel value, using cubic interpolation and Neumann boundary conditions for the X-coordinate.
Similar to cubic_atX(float,int,int,int) const, except that you can specify the authorized minimum and maximum of the returned value.
Tfloat cubic_atXY | ( | const float | fx, |
const float | fy, | ||
const int | z, | ||
const int | c, | ||
const T | out_value | ||
) | const |
Return pixel value, using cubic interpolation and Dirichlet boundary conditions for the X and Y-coordinates.
Similar to cubic_atX(float,int,int,int,const T) const, except that the cubic interpolation and boundary checking are achieved both for X and Y-coordinates.
Tfloat cubic_atXY | ( | const float | fx, |
const float | fy, | ||
const int | z, | ||
const int | c, | ||
const T | out_value, | ||
const Tfloat | min_value, | ||
const Tfloat | max_value | ||
) | const |
Return damped pixel value, using cubic interpolation and Dirichlet boundary conditions for the X and Y-coordinates.
Similar to cubic_atXY(float,float,int,int,const T) const, except that you can specify the authorized minimum and maximum of the returned value.
Tfloat cubic_atXY | ( | const float | fx, |
const float | fy, | ||
const int | z = 0 , |
||
const int | c = 0 |
||
) | const |
Return pixel value, using cubic interpolation and Neumann boundary conditions for the X and Y-coordinates.
Similar to cubic_atX(float,int,int,int) const, except that the cubic interpolation and boundary checking are achieved for both X and Y-coordinates.
_cubic_atXY(float,float,int,int)
. Tfloat cubic_atXY | ( | const float | fx, |
const float | fy, | ||
const int | z, | ||
const int | c, | ||
const Tfloat | min_value, | ||
const Tfloat | max_value | ||
) | const |
Return damped pixel value, using cubic interpolation and Neumann boundary conditions for the X and Y-coordinates.
Similar to cubic_atXY(float,float,int,int) const, except that you can specify the authorized minimum and maximum of the returned value.
Tfloat cubic_atXYZ | ( | const float | fx, |
const float | fy, | ||
const float | fz, | ||
const int | c, | ||
const T | out_value | ||
) | const |
Return pixel value, using cubic interpolation and Dirichlet boundary conditions for the X,Y and Z-coordinates.
Similar to cubic_atX(float,int,int,int,const T) const, except that the cubic interpolation and boundary checking are achieved both for X,Y and Z-coordinates.
Tfloat cubic_atXYZ | ( | const float | fx, |
const float | fy, | ||
const float | fz, | ||
const int | c, | ||
const T | out_value, | ||
const Tfloat | min_value, | ||
const Tfloat | max_value | ||
) | const |
Return damped pixel value, using cubic interpolation and Dirichlet boundary conditions for the X,Y and Z-coordinates.
Similar to cubic_atXYZ(float,float,float,int,const T) const, except that you can specify the authorized minimum and maximum of the returned value.
Tfloat cubic_atXYZ | ( | const float | fx, |
const float | fy, | ||
const float | fz, | ||
const int | c = 0 |
||
) | const |
Return pixel value, using cubic interpolation and Neumann boundary conditions for the X,Y and Z-coordinates.
Similar to cubic_atX(float,int,int,int) const, except that the cubic interpolation and boundary checking are achieved both for X,Y and Z-coordinates.
_cubic_atXYZ(float,float,float,int)
. Tfloat cubic_atXYZ | ( | const float | fx, |
const float | fy, | ||
const float | fz, | ||
const int | c, | ||
const Tfloat | min_value, | ||
const Tfloat | max_value | ||
) | const |
Return damped pixel value, using cubic interpolation and Neumann boundary conditions for the X,Y and Z-coordinates.
Similar to cubic_atXYZ(float,float,float,int) const, except that you can specify the authorized minimum and maximum of the returned value.
CImg<T>& set_linear_atXY | ( | const T & | value, |
const float | fx, | ||
const float | fy = 0 , |
||
const int | z = 0 , |
||
const int | c = 0 , |
||
const bool | is_added = false |
||
) |
Set pixel value, using linear interpolation for the X and Y-coordinates.
Set pixel value at specified coordinates (fx
,fy
,z
,c
) in the image instance, in a way that the value is spread amongst several neighbors if the pixel coordinates are indeed float-valued.
value | Pixel value to set. |
fx | X-coordinate of the pixel value (float-valued). |
fy | Y-coordinate of the pixel value (float-valued). |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
is_added | Tells if the pixel value is added to (true ), or simply replace (false ) the current image pixel(s). |
CImg<T>& set_linear_atXYZ | ( | const T & | value, |
const float | fx, | ||
const float | fy = 0 , |
||
const float | fz = 0 , |
||
const int | c = 0 , |
||
const bool | is_added = false |
||
) |
Set pixel value, using linear interpolation for the X,Y and Z-coordinates.
Similar to set_linear_atXY(const T&,float,float,int,int,bool), except that the linear interpolation is achieved both for X,Y and Z-coordinates.
CImg<charT> value_string | ( | const char | separator = ',' , |
const unsigned int | max_size = 0 |
||
) | const |
Return a C-string containing a list of all values of the image instance.
Return a new CImg<char>
image whose buffer data() is a char*
string describing the list of all pixel values of the image instance (written in base 10), separated by specified separator
character.
separator | A char character which specifies the separator between values in the returned C-string. |
max_size | Maximum size of the returned image. |
""
.max_size
is equal to 0
, there are no limits on the size of the returned string.'\0'
. In that case, the returned image size is max_size + 1
. bool is_shared | ( | ) | const |
Test shared state of the pixel buffer.
Return true
if image instance has a shared memory buffer, and false
otherwise.
CImg<T>
image instance will not be shared.bool is_empty | ( | ) | const |
Test if image instance is empty.
Return true
, if image instance is empty, i.e. does not contain any pixel values, has dimensions 0
x 0
x 0
x 0
and a pixel buffer pointer set to 0
(null pointer), and false
otherwise.
bool is_inf | ( | ) | const |
Test if image instance contains a 'inf' value.
Return true
, if image instance contains a 'inf' value, and false
otherwise.
bool is_nan | ( | ) | const |
Test if image instance contains a 'nan' value.
Return true
, if image instance contains a 'nan' value, and false
otherwise.
bool is_sameXY | ( | const unsigned int | size_x, |
const unsigned int | size_y | ||
) | const |
Test if image width and height are equal to specified values.
Test if is_sameX(unsigned int) const and is_sameY(unsigned int) const are both verified.
Test if image width and height are the same as that of another image.
Test if is_sameX(const CImg<t>&) const and is_sameY(const CImg<t>&) const are both verified.
bool is_sameXY | ( | const CImgDisplay & | disp | ) | const |
Test if image width and height are the same as that of an existing display window.
Test if is_sameX(const CImgDisplay&) const and is_sameY(const CImgDisplay&) const are both verified.
bool is_sameXZ | ( | const unsigned int | size_x, |
const unsigned int | size_z | ||
) | const |
Test if image width and depth are equal to specified values.
Test if is_sameX(unsigned int) const and is_sameZ(unsigned int) const are both verified.
Test if image width and depth are the same as that of another image.
Test if is_sameX(const CImg<t>&) const and is_sameZ(const CImg<t>&) const are both verified.
bool is_sameXC | ( | const unsigned int | size_x, |
const unsigned int | size_c | ||
) | const |
Test if image width and spectrum are equal to specified values.
Test if is_sameX(unsigned int) const and is_sameC(unsigned int) const are both verified.
Test if image width and spectrum are the same as that of another image.
Test if is_sameX(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool is_sameYZ | ( | const unsigned int | size_y, |
const unsigned int | size_z | ||
) | const |
Test if image height and depth are equal to specified values.
Test if is_sameY(unsigned int) const and is_sameZ(unsigned int) const are both verified.
Test if image height and depth are the same as that of another image.
Test if is_sameY(const CImg<t>&) const and is_sameZ(const CImg<t>&) const are both verified.
bool is_sameYC | ( | const unsigned int | size_y, |
const unsigned int | size_c | ||
) | const |
Test if image height and spectrum are equal to specified values.
Test if is_sameY(unsigned int) const and is_sameC(unsigned int) const are both verified.
Test if image height and spectrum are the same as that of another image.
Test if is_sameY(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool is_sameZC | ( | const unsigned int | size_z, |
const unsigned int | size_c | ||
) | const |
Test if image depth and spectrum are equal to specified values.
Test if is_sameZ(unsigned int) const and is_sameC(unsigned int) const are both verified.
Test if image depth and spectrum are the same as that of another image.
Test if is_sameZ(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool is_sameXYZ | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z | ||
) | const |
Test if image width, height and depth are equal to specified values.
Test if is_sameXY(unsigned int,unsigned int) const and is_sameZ(unsigned int) const are both verified.
bool is_sameXYZ | ( | const CImg< t > & | img | ) | const |
Test if image width, height and depth are the same as that of another image.
Test if is_sameXY(const CImg<t>&) const and is_sameZ(const CImg<t>&) const are both verified.
bool is_sameXYC | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_c | ||
) | const |
Test if image width, height and spectrum are equal to specified values.
Test if is_sameXY(unsigned int,unsigned int) const and is_sameC(unsigned int) const are both verified.
bool is_sameXYC | ( | const CImg< t > & | img | ) | const |
Test if image width, height and spectrum are the same as that of another image.
Test if is_sameXY(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool is_sameXZC | ( | const unsigned int | size_x, |
const unsigned int | size_z, | ||
const unsigned int | size_c | ||
) | const |
Test if image width, depth and spectrum are equal to specified values.
Test if is_sameXZ(unsigned int,unsigned int) const and is_sameC(unsigned int) const are both verified.
bool is_sameXZC | ( | const CImg< t > & | img | ) | const |
Test if image width, depth and spectrum are the same as that of another image.
Test if is_sameXZ(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool is_sameYZC | ( | const unsigned int | size_y, |
const unsigned int | size_z, | ||
const unsigned int | size_c | ||
) | const |
Test if image height, depth and spectrum are equal to specified values.
Test if is_sameYZ(unsigned int,unsigned int) const and is_sameC(unsigned int) const are both verified.
bool is_sameYZC | ( | const CImg< t > & | img | ) | const |
Test if image height, depth and spectrum are the same as that of another image.
Test if is_sameYZ(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool is_sameXYZC | ( | const unsigned int | size_x, |
const unsigned int | size_y, | ||
const unsigned int | size_z, | ||
const unsigned int | size_c | ||
) | const |
Test if image width, height, depth and spectrum are equal to specified values.
Test if is_sameXYZ(unsigned int,unsigned int,unsigned int) const and is_sameC(unsigned int) const are both verified.
bool is_sameXYZC | ( | const CImg< t > & | img | ) | const |
Test if image width, height, depth and spectrum are the same as that of another image.
Test if is_sameXYZ(const CImg<t>&) const and is_sameC(const CImg<t>&) const are both verified.
bool containsXYZC | ( | const int | x, |
const int | y = 0 , |
||
const int | z = 0 , |
||
const int | c = 0 |
||
) | const |
Test if specified coordinates are inside image bounds.
Return true
if pixel located at (x
,y
,z
,c
) is inside bounds of the image instance, and false
otherwise.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
c | C-coordinate of the pixel value. |
true
only if all these conditions are verified:0<=x<=width()-1
.0<=y<=height()-1
.0<=z<=depth()-1
.0<=c<=spectrum()-1
. bool contains | ( | const T & | pixel, |
t & | x, | ||
t & | y, | ||
t & | z, | ||
t & | c | ||
) | const |
Test if pixel value is inside image bounds and get its X,Y,Z and C-coordinates.
Return true
, if specified reference refers to a pixel value inside bounds of the image instance, and false
otherwise.
pixel | Reference to pixel value to test. | |
[out] | x | X-coordinate of the pixel value, if test succeeds. |
[out] | y | Y-coordinate of the pixel value, if test succeeds. |
[out] | z | Z-coordinate of the pixel value, if test succeeds. |
[out] | c | C-coordinate of the pixel value, if test succeeds. |
const CImg<float> img(100,100,1,3); // Construct a 100x100 RGB color image. const unsigned long offset = 1249; // Offset to the pixel (49,12,0,0). unsigned int x,y,z,c; if (img.contains(img[offset],x,y,z,c)) { // Convert offset to (x,y,z,c) coordinates. std::printf("Offset %u refers to pixel located at (%u,%u,%u,%u).\n", offset,x,y,z,c); }
bool contains | ( | const T & | pixel, |
t & | x, | ||
t & | y, | ||
t & | z | ||
) | const |
Test if pixel value is inside image bounds and get its X,Y and Z-coordinates.
Similar to contains(const T&,t&,t&,t&,t&) const, except that only the X,Y and Z-coordinates are set.
bool contains | ( | const T & | pixel, |
t & | x, | ||
t & | y | ||
) | const |
Test if pixel value is inside image bounds and get its X and Y-coordinates.
Similar to contains(const T&,t&,t&,t&,t&) const, except that only the X and Y-coordinates are set.
bool contains | ( | const T & | pixel, |
t & | x | ||
) | const |
Test if pixel value is inside image bounds and get its X-coordinate.
Similar to contains(const T&,t&,t&,t&,t&) const, except that only the X-coordinate is set.
bool contains | ( | const T & | pixel | ) | const |
Test if pixel value is inside image bounds.
Similar to contains(const T&,t&,t&,t&,t&) const, except that no pixel coordinates are set.
bool is_overlapped | ( | const CImg< t > & | img | ) | const |
Test if pixel buffers of instance and input images overlap.
Return true
, if pixel buffers attached to image instance and input image img
overlap, and false
otherwise.
img | Input image to compare with. |
CImg<T>
instances are non-shared and do not overlap between each others. const CImg<float> img1("reference.jpg"), // Load RGB-color image. img2 = img1.get_shared_channel(1); // Get shared version of the green channel. if (img1.is_overlapped(img2)) { // Test succeeds, 'img1' and 'img2' overlaps. std::printf("Buffers overlap!\n"); }
bool is_object3d | ( | const CImgList< tp > & | primitives, |
const CImgList< tc > & | colors, | ||
const to & | opacities, | ||
const bool | is_full_check = true , |
||
char *const | error_message = 0 |
||
) | const |
Test if the set {*this
,primitives
,colors
,opacities}
defines a valid 3d object.
Return true
is the 3d object represented by the set {*this
,primitives
,colors
,opacities}
defines a valid 3d object, and false
otherwise. The vertex coordinates are defined by the instance image.
primitives | List of primitives of the 3d object. | |
colors | List of colors of the 3d object. | |
opacities | List (or image) of opacities of the 3d object. | |
is_full_check | Tells if full checking of the 3d object must be performed. | |
[out] | error_message | C-string to contain the error message, if the test does not succeed. |
is_full_checking
to false
to speed-up the 3d object checking. In this case, only the size of each 3d object component is checked.error_message
should be at least 128-bytes long, to be able to contain the error message. bool is_CImg3d | ( | const bool | is_full_check = true , |
char *const | error_message = 0 |
||
) | const |
Test if image instance represents a valid serialization of a 3d object.
Return true
if the image instance represents a valid serialization of a 3d object, and false
otherwise.
is_full_check | Tells if full checking of the instance must be performed. | |
[out] | error_message | C-string to contain the error message, if the test does not succeed. |
is_full_checking
to false
to speed-up the 3d object checking. In this case, only the size of each 3d object component is checked.error_message
should be at least 128-bytes long, to be able to contain the error message. Compute the square value of each pixel value.
Replace each pixel value of the image instance by its square value
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. const CImg<float> img("reference.jpg"); (img,img.get_sqr().normalize(0,255)).display();
Compute the square root of each pixel value.
Replace each pixel value of the image instance by its square root
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. const CImg<float> img("reference.jpg"); (img,img.get_sqrt().normalize(0,255)).display();
Compute the exponential of each pixel value.
Replace each pixel value of the image instance by its exponential
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the logarithm of each pixel value.
Replace each pixel value of the image instance by its logarithm
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the base-2 logarithm of each pixel value.
Replace each pixel value of the image instance by its base-2 logarithm
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the base-10 logarithm of each pixel value.
Replace each pixel value of the image instance by its base-10 logarithm
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the absolute value of each pixel value.
Replace each pixel value of the image instance by its absolute value
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the sign of each pixel value.
Replace each pixel value of the image instance by its sign
.
1
if pixel value is strictly positive.-1
if pixel value is strictly negative.0
if pixel value is equal to 0
.T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the cosine of each pixel value.
Replace each pixel value of the image instance by its cosine
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the sine of each pixel value.
Replace each pixel value of the image instance by its sine
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the sinc of each pixel value.
Replace each pixel value of the image instance by its sinc
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the tangent of each pixel value.
Replace each pixel value of the image instance by its tangent
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the hyperbolic cosine of each pixel value.
Replace each pixel value of the image instance by its hyperbolic cosine
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the hyperbolic sine of each pixel value.
Replace each pixel value of the image instance by its hyperbolic sine
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the hyperbolic tangent of each pixel value.
Replace each pixel value of the image instance by its hyperbolic tangent
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the arccosine of each pixel value.
Replace each pixel value of the image instance by its arccosine
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the arcsine of each pixel value.
Replace each pixel value of the image instance by its arcsine
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the arctangent of each pixel value.
Replace each pixel value of the image instance by its arctangent
.
T
.CImg<float>
image, if the pixel type T
is not float-valued. Compute the arctangent2 of each pixel value.
Replace each pixel value of the image instance by its arctangent2
.
img | Image whose pixel values specify the second argument of the atan2() function. |
T
.CImg<float>
image, if the pixel type T
is not float-valued. const CImg<float> img_x(100,100,1,1,"x-w/2",false), // Define an horizontal centered gradient, from '-width/2' to 'width/2'. img_y(100,100,1,1,"y-h/2",false), // Define a vertical centered gradient, from '-height/2' to 'height/2'. img_atan2 = img_y.get_atan2(img_x); // Compute atan2(y,x) for each pixel value. (img_x,img_y,img_atan2).display();
In-place pointwise multiplication.
Compute the pointwise multiplication between the image instance and the specified input image img
.
img | Input image, as the second operand of the multiplication. |
CImg<float> img("reference.jpg"), shade(img.width,img.height(),1,1,"-(x-w/2)^2-(y-h/2)^2",false); shade.normalize(0,1); (img,shade,img.get_mul(shade)).display();
In-place pointwise division.
Similar to mul(const CImg<t>&), except that it performs a pointwise division instead of a multiplication.
Raise each pixel value to a specified power.
Replace each pixel value of the image instance by its power
.
p | Exponent value. |
T
.CImg<float>
image, if the pixel type T
is not float-valued. Raise each pixel value to a power, specified from an expression.
Similar to operator+=(const char*), except it performs a pointwise exponentiation instead of an addition.
Raise each pixel value to a power, pointwisely specified from another image.
Similar to operator+=(const CImg<t>& img), except that it performs an exponentiation instead of an addition.
Compute the bitwise left rotation of each pixel value.
Similar to operator<<=(unsigned int), except that it performs a left rotation instead of a left shift.
Compute the bitwise left rotation of each pixel value.
Similar to operator<<=(const char*), except that it performs a left rotation instead of a left shift.
Compute the bitwise left rotation of each pixel value.
Similar to operator<<=(const CImg<t>&), except that it performs a left rotation instead of a left shift.
Compute the bitwise right rotation of each pixel value.
Similar to operator>>=(unsigned int), except that it performs a right rotation instead of a right shift.
Compute the bitwise right rotation of each pixel value.
Similar to operator>>=(const char*), except that it performs a right rotation instead of a right shift.
Compute the bitwise right rotation of each pixel value.
Similar to operator>>=(const CImg<t>&), except that it performs a right rotation instead of a right shift.
Pointwise min operator between instance image and a value.
val | Value used as the reference argument of the min operator. |
Pointwise min operator between two images.
img | Image used as the reference argument of the min operator. |
Pointwise min operator between an image and an expression.
expression | Math formula as a C-string. |
Pointwise max operator between instance image and a value.
val | Value used as the reference argument of the max operator. |
Pointwise max operator between two images.
img | Image used as the reference argument of the max operator. |
Pointwise max operator between an image and an expression.
expression | Math formula as a C-string. |
T& min_max | ( | t & | max_val | ) |
Return a reference to the minimum pixel value as well as the maximum pixel value.
[out] | max_val | Maximum pixel value. |
T& max_min | ( | t & | min_val | ) |
Return a reference to the maximum pixel value as well as the minimum pixel value.
[out] | min_val | Minimum pixel value. |
T kth_smallest | ( | const unsigned int | k | ) | const |
Return the kth smallest pixel value.
k | Rank of the search smallest element. |
Tdouble variance | ( | const unsigned int | variance_method = 1 | ) | const |
Return the variance of the pixel values.
variance_method | Method used to estimate the variance. Can be:
|
Tdouble variance_mean | ( | const unsigned int | variance_method, |
t & | mean | ||
) | const |
Return the variance as well as the average of the pixel values.
variance_method | Method used to estimate the variance (see variance(const unsigned int) const). | |
[out] | mean | Average pixel value. |
Tdouble variance_noise | ( | const unsigned int | variance_method = 2 | ) | const |
Return estimated variance of the noise.
variance_method | Method used to compute the variance (see variance(const unsigned int) const). |
Compute the MSE (Mean-Squared Error) between two images.
img | Image used as the second argument of the MSE operator. |
Compute the PSNR (Peak Signal-to-Noise Ratio) between two images.
img | Image used as the second argument of the PSNR operator. |
max_value | Maximum theoretical value of the signal. |
double eval | ( | const char *const | expression, |
const double | x = 0 , |
||
const double | y = 0 , |
||
const double | z = 0 , |
||
const double | c = 0 |
||
) | const |
Evaluate math formula.
expression | Math formula, as a C-string. |
x | Value of the pre-defined variable x . |
y | Value of the pre-defined variable y . |
z | Value of the pre-defined variable z . |
c | Value of the pre-defined variable c . |
expression
to 0
to keep evaluating the last specified expression
. Compute statistics vector from the pixel values.
variance_method | Method used to compute the variance (see variance(const unsigned int) const). |
[min; max; mean; variance; xmin; ymin; zmin; cmin; xmax; ymax; zmax; cmax]
. Tdouble magnitude | ( | const int | magnitude_type = 2 | ) | const |
Compute norm of the image, viewed as a matrix.
magnitude_type | Norm type. Can be:
|
Compute the dot product between instance and argument, viewed as matrices.
img | Image used as a second argument of the dot product. |
CImg<T> get_vector_at | ( | const unsigned int | x, |
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) | const |
Get vector-valued pixel located at specified position.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
CImg<T> get_matrix_at | ( | const unsigned int | x = 0 , |
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) | const |
Get (square) matrix-valued pixel located at specified position.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
CImg<T> get_tensor_at | ( | const unsigned int | x, |
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) | const |
Get tensor-valued pixel located at specified position.
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
CImg<T>& set_vector_at | ( | const CImg< t > & | vec, |
const unsigned int | x, | ||
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) |
Set vector-valued pixel at specified position.
vec | Vector to put on the instance image. |
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
CImg<T>& set_matrix_at | ( | const CImg< t > & | mat, |
const unsigned int | x = 0 , |
||
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) |
Set (square) matrix-valued pixel at specified position.
mat | Matrix to put on the instance image. |
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
CImg<T>& set_tensor_at | ( | const CImg< t > & | ten, |
const unsigned int | x = 0 , |
||
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) |
Set tensor-valued pixel at specified position.
ten | Tensor to put on the instance image. |
x | X-coordinate of the pixel value. |
y | Y-coordinate of the pixel value. |
z | Z-coordinate of the pixel value. |
Resize image to become a diagonal matrix.
CImg<T>& identity_matrix | ( | ) |
Replace the image by an identity matrix.
Fill image with a linear sequence of values.
a0 | Starting value of the sequence. |
a1 | Ending value of the sequence. |
Transpose the image, viewed as a matrix.
permute_axes("yxzc");
Compute the cross product between two 1x3
images, viewed as 3d vectors.
img | Image used as the second argument of the cross product. |
*this
. Invert the instance image, viewed as a matrix.
use_LU | Choose the inverting algorithm. Can be:
|
Solve a system of linear equations.
A | Matrix of the linear system. |
AX=B
where B=*this
. CImg<T>& solve_tridiagonal | ( | const CImg< t > & | A | ) |
Solve a tridiagonal system of linear equations.
A | Coefficients of the tridiagonal system. A is a tridiagonal matrix A = [ b0,c0,0,...; a1,b1,c1,0,... ; ... ; ...,0,aN,bN ], stored as a 3 columns matrix |
B=*this
, using the Thomas algorithm. Compute eigenvalues and eigenvectors of the instance image, viewed as a matrix.
[out] | val | Vector of the estimated eigenvalues, in decreasing order. |
[out] | vec | Matrix of the estimated eigenvalues, sorted by columns. |
Compute eigenvalues and eigenvectors of the instance image, viewed as a matrix.
[val; vec]
, whose meaning is similar as in eigen(CImg<t>&,CImg<t>&) const. const CImg<T>& symmetric_eigen | ( | CImg< t > & | val, |
CImg< t > & | vec | ||
) | const |
Compute eigenvalues and eigenvectors of the instance image, viewed as a symmetric matrix.
[out] | val | Vector of the estimated eigenvalues, in decreasing order. |
[out] | vec | Matrix of the estimated eigenvalues, sorted by columns. |
CImgList<Tfloat> get_symmetric_eigen | ( | ) | const |
Compute eigenvalues and eigenvectors of the instance image, viewed as a symmetric matrix.
[val; vec]
, whose meaning are similar as in symmetric_eigen(CImg<t>&,CImg<t>&) const. Sort pixel values and get sorting permutations.
[out] | permutations | Permutation map used for the sorting. |
is_increasing | Tells if pixel values are sorted in an increasing (true ) or decreasing (false ) way. |
Sort pixel values.
is_increasing | Tells if pixel values are sorted in an increasing (true ) or decreasing (false ) way. |
axis | Tells if the value sorting must be done along a specific axis. Can be:
|
const CImg<T>& SVD | ( | CImg< t > & | U, |
CImg< t > & | S, | ||
CImg< t > & | V, | ||
const bool | sorting = true , |
||
const unsigned int | max_iteration = 40 , |
||
const float | lambda = 0 |
||
) | const |
Compute the SVD of the instance image, viewed as a general matrix.
Compute the SVD decomposition *this=U*S*V'
where U
and V
are orthogonal matrices and S
is a diagonal matrix. V'
denotes the matrix transpose of V
.
[out] | U | First matrix of the SVD product. |
[out] | S | Coefficients of the second (diagonal) matrix of the SVD product. These coefficients are stored as a vector. |
[out] | V | Third matrix of the SVD product. |
sorting | Tells if the diagonal coefficients are sorted (in decreasing order). | |
max_iteration | Maximum number of iterations considered for the algorithm convergence. | |
lambda | Epsilon used for the algorithm convergence. |
U
,S
and V
by const CImg<> A; // Input matrix (assumed to contain some values). CImg<> U,S,V; A.SVD(U,S,V)
CImgList<Tfloat> get_SVD | ( | const bool | sorting = true , |
const unsigned int | max_iteration = 40 , |
||
const float | lambda = 0 |
||
) | const |
Compute the SVD of the instance image, viewed as a general matrix.
[U; S; V]
, whose meaning is similar as in SVD(CImg<t>&,CImg<t>&,CImg<t>&,bool,unsigned int,float) const. static CImg<T> dijkstra | ( | const tf & | distance, |
const unsigned int | nb_nodes, | ||
const unsigned int | starting_node, | ||
const unsigned int | ending_node, | ||
CImg< t > & | previous_node | ||
) | [static] |
Compute minimal path in a graph, using the Dijkstra algorithm.
distance | An object having operator()(unsigned int i, unsigned int j) which returns distance between two nodes (i,j). |
nb_nodes | Number of graph nodes. |
starting_node | Indice of the starting node. |
ending_node | Indice of the ending node (set to ~0U to ignore ending node). |
previous_node | Array that gives the previous node indice in the path to the starting node (optional parameter). |
CImg<T>& dijkstra | ( | const unsigned int | starting_node, |
const unsigned int | ending_node, | ||
CImg< t > & | previous_node | ||
) |
Return minimal path in a graph, using the Dijkstra algorithm.
starting_node | Indice of the starting node. |
ending_node | Indice of the ending node. |
previous_node | Array that gives the previous node indice in the path to the starting node (optional parameter). |
Return an image containing the ascii codes of the specified string.
str | input C-string to encode as an image. |
is_last_zero | Tells if the ending '0' character appear in the resulting image. |
Return a 1x1
image containing specified value.
a0 | First vector value. |
Return a 1x2
image containing specified values.
a0 | First vector value. |
a1 | Second vector value. |
Return a 1x3
image containing specified values.
a0 | First vector value. |
a1 | Second vector value. |
a2 | Third vector value. |
Return a 1x4
image containing specified values.
a0 | First vector value. |
a1 | Second vector value. |
a2 | Third vector value. |
a3 | Fourth vector value. |
Return a 1x1 matrix containing specified coefficients.
a0 | First matrix value. |
Return a 2x2 matrix containing specified coefficients.
a0 | First matrix value. |
a1 | Second matrix value. |
a2 | Third matrix value. |
a3 | Fourth matrix value. |
static CImg<T> matrix | ( | const T & | a0, |
const T & | a1, | ||
const T & | a2, | ||
const T & | a3, | ||
const T & | a4, | ||
const T & | a5, | ||
const T & | a6, | ||
const T & | a7, | ||
const T & | a8 | ||
) | [static] |
Return a 3x3 matrix containing specified coefficients.
a0 | First matrix value. |
a1 | Second matrix value. |
a2 | Third matrix value. |
a3 | Fourth matrix value. |
a4 | Fifth matrix value. |
a5 | Sixth matrix value. |
a6 | Seventh matrix value. |
a7 | Eighth matrix value. |
a8 | Nineth matrix value. |
Return a 1x1 symmetric matrix containing specified coefficients.
a0 | First matrix value. |
static CImg<T> identity_matrix | ( | const unsigned int | N | ) | [static] |
Return a NxN identity matrix.
N | Dimension of the matrix. |
Return a N-numbered sequence vector from a0
to a1
.
N | Size of the resulting vector. |
a0 | Starting value of the sequence. |
a1 | Ending value of the sequence. |
static CImg<T> rotation_matrix | ( | const float | x, |
const float | y, | ||
const float | z, | ||
const float | w, | ||
const bool | is_quaternion = false |
||
) | [static] |
Return a 3x3 rotation matrix along the (x,y,z)-axis with an angle w.
x | X-coordinate of the rotation axis, or first quaternion coordinate. |
y | Y-coordinate of the rotation axis, or second quaternion coordinate. |
z | Z-coordinate of the rotation axis, or third quaternion coordinate. |
w | Angle of the rotation axis, or fourth quaternion coordinate. |
is_quaternion | Tell is the four arguments denotes a set { axis + angle } or a quaternion. |
Fill sequentially all pixel values with specified values.
val0 | First fill value. |
val1 | Second fill value. |
Fill sequentially pixel values according to a given expression.
expression | C-string describing a math formula, or a list of values. |
repeat_flag | In case a list of values is provided, tells if this list must be repeated for the filling. |
Fill sequentially pixel values according to the values found in another image.
values | Image containing the values used for the filling. |
repeat_values | In case there are less values than necessary in values , tells if these values must be repeated for the filling. |
CImg<T>& fillX | ( | const unsigned int | y, |
const unsigned int | z, | ||
const unsigned int | c, | ||
const int | a0, | ||
... | |||
) |
Fill pixel values along the X-axis at a specified pixel position.
y | Y-coordinate of the filled column. |
z | Z-coordinate of the filled column. |
c | C-coordinate of the filled column. |
a0 | First fill value. |
CImg<T>& fillY | ( | const unsigned int | x, |
const unsigned int | z, | ||
const unsigned int | c, | ||
const int | a0, | ||
... | |||
) |
Fill pixel values along the Y-axis at a specified pixel position.
x | X-coordinate of the filled row. |
z | Z-coordinate of the filled row. |
c | C-coordinate of the filled row. |
a0 | First fill value. |
CImg<T>& fillZ | ( | const unsigned int | x, |
const unsigned int | y, | ||
const unsigned int | c, | ||
const int | a0, | ||
... | |||
) |
Fill pixel values along the Z-axis at a specified pixel position.
x | X-coordinate of the filled slice. |
y | Y-coordinate of the filled slice. |
c | C-coordinate of the filled slice. |
a0 | First fill value. |
CImg<T>& fillC | ( | const unsigned int | x, |
const unsigned int | y, | ||
const unsigned int | z, | ||
const int | a0, | ||
... | |||
) |
Fill pixel values along the C-axis at a specified pixel position.
x | X-coordinate of the filled channel. |
y | Y-coordinate of the filled channel. |
z | Z-coordinate of the filled channel. |
a0 | First filling value. |
Discard specified value in the image buffer.
value | Value to discard. |
Discard specified sequence of values in the image buffer.
values | Sequence of values to discard. |
Fill image with random values in specified range.
val_min | Minimal random value. |
val_max | Maximal random value. |
Round pixel values.
y | Rounding precision. |
rounding_type | Rounding type. Can be:
|
Add random noise to pixel values.
sigma | Amplitude of the random additive noise. If sigma<0 , it stands for a percentage of the global value range. |
noise_type | Type of additive noise (can be 0=gaussian , 1=uniform , 2=Salt and Pepper, 3=Poisson or 4=Rician ). |
noise_type=3
), parameter sigma
is ignored, as Poisson noise only depends on the image value itself.CImg<T>::get_noise()
is also defined. It returns a non-shared modified copy of the image instance. const CImg<float> img("reference.jpg"), res = img.get_noise(40); (img,res.normalize(0,255)).display();
Linearly normalize pixel values.
min_value | Minimum desired value of the resulting image. |
max_value | Maximum desired value of the resulting image. |
const CImg<float> img("reference.jpg"), res = img.get_normalize(160,220); (img,res).display();
Normalize multi-valued pixels of the image instance, with respect to their L2-norm.
const CImg<float> img("reference.jpg"), res = img.get_normalize(); (img,res.normalize(0,255)).display();
Compute L2-norm of each multi-valued pixel of the image instance.
norm_type | Type of computed vector norm (can be 0=Linf , 1=L1 or 2=L2 ). |
const CImg<float> img("reference.jpg"), res = img.get_norm(); (img,res.normalize(0,255)).display();
Cut pixel values in specified range.
min_value | Minimum desired value of the resulting image. |
max_value | Maximum desired value of the resulting image. |
const CImg<float> img("reference.jpg"), res = img.get_cut(160,220); (img,res).display();
Uniformly quantize pixel values.
nb_levels | Number of quantization levels. |
keep_range | Tells if resulting values keep the same range as the original ones. |
const CImg<float> img("reference.jpg"), res = img.get_quantize(4); (img,res).display();
CImg<T>& threshold | ( | const T | value, |
const bool | soft_threshold = false , |
||
const bool | strict_threshold = false |
||
) |
Threshold pixel values.
value | Threshold value |
soft_threshold | Tells if soft thresholding must be applied (instead of hard one). |
strict_threshold | Tells if threshold value is strict. |
const CImg<float> img("reference.jpg"), res = img.get_threshold(128); (img,res.normalize(0,255)).display();
CImg<T>& histogram | ( | const unsigned int | nb_levels, |
const T | min_value = (T)0 , |
||
const T | max_value = (T)0 |
||
) |
Compute the histogram of pixel values.
nb_levels | Number of desired histogram levels. |
min_value | Minimum pixel value considered for the histogram computation. All pixel values lower than min_value will not be counted. |
max_value | Maximum pixel value considered for the histogram computation. All pixel values higher than max_value will not be counted. |
min_value==max_value==0
(default behavior), the function first estimates the whole range of pixel values then uses it to compute the histogram.const CImg<float> img = CImg<float>("reference.jpg").histogram(256); img.display_graph(0,3);
CImg<T>& equalize | ( | const unsigned int | nb_levels, |
const T | min_value = (T)0 , |
||
const T | max_value = (T)0 |
||
) |
Equalize histogram of pixel values.
nb_levels | Number of histogram levels used for the equalization. |
min_value | Minimum pixel value considered for the histogram computation. All pixel values lower than min_value will not be counted. |
max_value | Maximum pixel value considered for the histogram computation. All pixel values higher than max_value will not be counted. |
min_value==max_value==0
(default behavior), the function first estimates the whole range of pixel values then uses it to equalize the histogram. const CImg<float> img("reference.jpg"), res = img.get_equalize(256); (img,res).display();
CImg<T>& index | ( | const CImg< t > & | colormap, |
const float | dithering = 1 , |
||
const bool | map_indexes = false |
||
) |
Index multi-valued pixels regarding to a specified colormap.
colormap | Multi-valued colormap used as the basis for multi-valued pixel indexing. |
dithering | Level of dithering (0=disable, 1=standard level). |
map_indexes | Tell if the values of the resulting image are the colormap indices or the colormap vectors. |
img.index(colormap,dithering,1)
is equivalent to img.index(colormap,dithering,0).map(colormap)
. const CImg<float> img("reference.jpg"), colormap(3,1,1,3, 0,128,255, 0,128,255, 0,128,255); const CImg<float> res = img.get_index(colormap,1,true); (img,res).display();
Map predefined colormap on the scalar (indexed) image instance.
colormap | Multi-valued colormap used for mapping the indexes. |
const CImg<float> img("reference.jpg"), colormap1(3,1,1,3, 0,128,255, 0,128,255, 0,128,255), colormap2(3,1,1,3, 255,0,0, 0,255,0, 0,0,255), res = img.get_index(colormap1,0).map(colormap2); (img,res).display();
Label connected components.
is_high_connectivity | Boolean that choose between 4(false)- or 8(true)-connectivity in 2d case, and between 6(false)- or 26(true)-connectivity in 3d case. |
tolerance | Tolerance used to determine if two neighboring pixels belong to the same region. |
Label connected components [overloading].
connectivity_mask | Mask of the neighboring pixels. |
tolerance | Tolerance used to determine if two neighboring pixels belong to the same region. |
static const CImg<Tuchar>& default_LUT256 | ( | ) | [static] |
Return colormap "default", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& HSV_LUT256 | ( | ) | [static] |
Return colormap "HSV", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& lines_LUT256 | ( | ) | [static] |
Return colormap "lines", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& hot_LUT256 | ( | ) | [static] |
Return colormap "hot", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& cool_LUT256 | ( | ) | [static] |
Return colormap "cool", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& jet_LUT256 | ( | ) | [static] |
Return colormap "jet", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& flag_LUT256 | ( | ) | [static] |
Return colormap "flag", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: static const CImg<Tuchar>& cube_LUT256 | ( | ) | [static] |
Return colormap "cube", containing 256 colors entries in RGB.
256x1x1x3
colormap is returned: Convert pixel values from RGB to XYZ_709 color spaces.
CImg<T>& RGBtoBayer | ( | ) |
Convert RGB color image to a Bayer-coded scalar image.
CImg<T>& resize | ( | const int | size_x, |
const int | size_y = -100 , |
||
const int | size_z = -100 , |
||
const int | size_c = -100 , |
||
const int | interpolation_type = 1 , |
||
const unsigned int | boundary_conditions = 0 , |
||
const float | centering_x = 0 , |
||
const float | centering_y = 0 , |
||
const float | centering_z = 0 , |
||
const float | centering_c = 0 |
||
) |
Resize image to new dimensions.
size_x | Number of columns (new size along the X-axis). |
size_y | Number of rows (new size along the Y-axis). |
size_z | Number of slices (new size along the Z-axis). |
size_c | Number of vector-channels (new size along the C-axis). |
interpolation_type | Method of interpolation:
|
boundary_conditions | Border condition type. |
centering_x | Set centering type (only if interpolation_type=0 ). |
centering_y | Set centering type (only if interpolation_type=0 ). |
centering_z | Set centering type (only if interpolation_type=0 ). |
centering_c | Set centering type (only if interpolation_type=0 ). |
CImg<T>& resize | ( | const CImg< t > & | src, |
const int | interpolation_type = 1 , |
||
const unsigned int | boundary_conditions = 0 , |
||
const float | centering_x = 0 , |
||
const float | centering_y = 0 , |
||
const float | centering_z = 0 , |
||
const float | centering_c = 0 |
||
) |
Resize image to dimensions of another image.
src | Reference image used for dimensions. |
interpolation_type | Interpolation method. |
boundary_conditions | Boundary conditions. |
centering_x | Set centering type (only if interpolation_type=0 ). |
centering_y | Set centering type (only if interpolation_type=0 ). |
centering_z | Set centering type (only if interpolation_type=0 ). |
centering_c | Set centering type (only if interpolation_type=0 ). |
CImg<T>& resize | ( | const CImgDisplay & | disp, |
const int | interpolation_type = 1 , |
||
const unsigned int | boundary_conditions = 0 , |
||
const float | centering_x = 0 , |
||
const float | centering_y = 0 , |
||
const float | centering_z = 0 , |
||
const float | centering_c = 0 |
||
) |
Resize image to dimensions of a display window.
disp | Reference display window used for dimensions. |
interpolation_type | Interpolation method. |
boundary_conditions | Boundary conditions. |
centering_x | Set centering type (only if interpolation_type=0 ). |
centering_y | Set centering type (only if interpolation_type=0 ). |
centering_z | Set centering type (only if interpolation_type=0 ). |
centering_c | Set centering type (only if interpolation_type=0 ). |
CImg<T>& resize_doubleXY | ( | ) |
Resize image to double-size, using the Scale2X algorithm.
CImg<T>& resize_tripleXY | ( | ) |
Resize image to triple-size, using the Scale3X algorithm.
Mirror image content along specified axis.
axis | Mirror axis |
Mirror image content along specified axes.
axes | Mirror axes, as a C-string. |
axes
may contains multiple character, e.g. "xyz"
CImg<T>& shift | ( | const int | delta_x, |
const int | delta_y = 0 , |
||
const int | delta_z = 0 , |
||
const int | delta_c = 0 , |
||
const int | boundary_conditions = 0 |
||
) |
Shift image content.
delta_x | Amount of displacement along the X-axis. |
delta_y | Amount of displacement along the Y-axis. |
delta_z | Amount of displacement along the Z-axis. |
delta_c | Amount of displacement along the C-axis. |
boundary_conditions | Border condition. |
boundary_conditions
can be:CImg<T>& permute_axes | ( | const char *const | order | ) |
Permute axes order.
order | Axes permutations, as a C-string of 4 characters. This function permutes image content regarding the specified axes permutation. |
Unroll pixel values along specified axis.
axis | Unroll axis (can be 'x' , 'y' , 'z' or c 'c'). |
CImg<T>& rotate | ( | const float | angle, |
const unsigned int | boundary_conditions = 0 , |
||
const unsigned int | interpolation_type = 1 |
||
) |
Rotate image with arbitrary angle.
angle | Rotation angle, in degrees. |
boundary_conditions | Boundary conditions. Can be { 0=dirichlet | 1=neumann | 2=cyclic } . |
interpolation_type | Type of interpolation. Can be { 0=nearest | 1=linear | 2=cubic } . |
CImg<T>& rotate | ( | const float | angle, |
const float | cx, | ||
const float | cy, | ||
const float | zoom, | ||
const unsigned int | boundary_conditions = 3 , |
||
const unsigned int | interpolation_type = 1 |
||
) |
Rotate image with arbitrary angle, around a center point.
angle | Rotation angle, in degrees. |
cx | X-coordinate of the rotation center. |
cy | Y-coordinate of the rotation center. |
zoom | Zoom factor. |
boundary_conditions | Boundary conditions. Can be { 0=dirichlet | 1=neumann | 2=cyclic } . |
interpolation_type | Type of interpolation. Can be { 0=nearest | 1=linear | 2=cubic } . |
CImg<T>& warp | ( | const CImg< t > & | warp, |
const bool | is_relative = false , |
||
const bool | is_linear_interpolation = true , |
||
const unsigned int | boundary_conditions = 0 |
||
) |
Warp image content by a warping field.
warp | Warping field. |
is_relative | Tells if warping field gives absolute or relative warping coordinates. |
is_linear_interpolation | Tells if linear interpolation must be used (instead of nearest neighbors). |
boundary_conditions | Boundary conditions. Can be { 0=dirichlet | 1=neumann | 2=cyclic } . |
CImg<T> get_projections2d | ( | const unsigned int | x0, |
const unsigned int | y0, | ||
const unsigned int | z0 | ||
) | const |
Generate a 2d representation of a 3d image, with XY,XZ and YZ views.
x0 | X-coordinate of the projection point. |
y0 | Y-coordinate of the projection point. |
z0 | Z-coordinate of the projection point. |
CImg<T>& crop | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const int | c0, | ||
const int | x1, | ||
const int | y1, | ||
const int | z1, | ||
const int | c1, | ||
const bool | boundary_conditions = false |
||
) |
Crop image region.
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. |
c0 | = C-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. |
c1 | = C-coordinate of the lower-right crop rectangle corner. |
boundary_conditions | = Dirichlet (false) or Neumann border conditions. |
Autocrop image region, regarding the specified background color.
color | Color used for the crop. If 0 , color is guessed. |
axes | Axes used for the crop. |
CImg<T> get_column | ( | const int | x0 | ) | const |
Return specified image column.
x0 | Image column. |
Return specified range of image columns.
x0 | Starting image column. |
x1 | Ending image column. |
Return specified image row [in-place version].
y0 | Image row. |
Return specified range of image rows.
y0 | Starting image row. |
y1 | Ending image row. |
CImg<T> get_slices | ( | const int | z0, |
const int | z1 | ||
) | const |
Return specified range of image slices.
z0 | Starting image slice. |
z1 | Ending image slice. |
CImg<T> get_channel | ( | const int | c0 | ) | const |
Return specified image channel.
c0 | Image channel. |
CImg<T> get_channels | ( | const int | c0, |
const int | c1 | ||
) | const |
Return specified range of image channels.
c0 | Starting image channel. |
c1 | Ending image channel. |
static CImg<floatT> streamline | ( | const tfunc & | func, |
const float | x, | ||
const float | y, | ||
const float | z, | ||
const float | L = 256 , |
||
const float | dl = 0.1f , |
||
const unsigned int | interpolation_type = 2 , |
||
const bool | is_backward_tracking = false , |
||
const bool | is_oriented_only = false , |
||
const float | x0 = 0 , |
||
const float | y0 = 0 , |
||
const float | z0 = 0 , |
||
const float | x1 = 0 , |
||
const float | y1 = 0 , |
||
const float | z1 = 0 |
||
) | [static] |
Return stream line of a 3d vector field.
func | Vector field function. |
x | X-coordinate of the starting point of the streamline. |
y | Y-coordinate of the starting point of the streamline. |
z | Z-coordinate of the starting point of the streamline. |
L | Streamline length. |
dl | Streamline length increment. |
interpolation_type | Type of interpolation. Can be { 0=nearest int | 1=linear | 2=2nd-order RK | 3=4th-order RK. } . |
is_backward_tracking | Tells if the streamline is estimated forward or backward. |
is_oriented_only | Tells if the direction of the vectors must be ignored. |
x0 | X-coordinate of the first bounding-box vertex. |
y0 | Y-coordinate of the first bounding-box vertex. |
z0 | Z-coordinate of the first bounding-box vertex. |
x1 | X-coordinate of the second bounding-box vertex. |
y1 | Y-coordinate of the second bounding-box vertex. |
z1 | Z-coordinate of the second bounding-box vertex. |
CImg<T> get_shared_points | ( | const unsigned int | x0, |
const unsigned int | x1, | ||
const unsigned int | y0 = 0 , |
||
const unsigned int | z0 = 0 , |
||
const unsigned int | c0 = 0 |
||
) |
Return a shared-memory image referencing a range of pixels of the image instance.
x0 | X-coordinate of the starting pixel. |
x1 | X-coordinate of the ending pixel. |
y0 | Y-coordinate. |
z0 | Z-coordinate. |
c0 | C-coordinate. |
CImg<T> get_shared_rows | ( | const unsigned int | y0, |
const unsigned int | y1, | ||
const unsigned int | z0 = 0 , |
||
const unsigned int | c0 = 0 |
||
) |
Return a shared-memory image referencing a range of rows of the image instance.
y0 | Y-coordinate of the starting row. |
y1 | Y-coordinate of the ending row. |
z0 | Z-coordinate. |
c0 | C-coordinate. |
CImg<T> get_shared_row | ( | const unsigned int | y0, |
const unsigned int | z0 = 0 , |
||
const unsigned int | c0 = 0 |
||
) |
Return a shared-memory image referencing one row of the image instance.
y0 | Y-coordinate. |
z0 | Z-coordinate. |
c0 | C-coordinate. |
CImg<T> get_shared_slices | ( | const unsigned int | z0, |
const unsigned int | z1, | ||
const unsigned int | c0 = 0 |
||
) |
Return a shared memory image referencing a range of slices of the image instance.
z0 | Z-coordinate of the starting slice. |
z1 | Z-coordinate of the ending slice. |
c0 | C-coordinate. |
CImg<T> get_shared_slice | ( | const unsigned int | z0, |
const unsigned int | c0 = 0 |
||
) |
Return a shared-memory image referencing one slice of the image instance.
z0 | Z-coordinate. |
c0 | C-coordinate. |
CImg<T> get_shared_channels | ( | const unsigned int | c0, |
const unsigned int | c1 | ||
) |
Return a shared-memory image referencing a range of channels of the image instance.
c0 | C-coordinate of the starting channel. |
c1 | C-coordinate of the ending channel. |
CImg<T> get_shared_channel | ( | const unsigned int | c0 | ) |
Return a shared-memory image referencing one channel of the image instance.
c0 | C-coordinate. |
Split image into a list along specified axis.
axis | Splitting axis. Can be { 'x' | 'y' | 'z' | 'c' } . |
nb | Number of splitted parts. |
nb==0
, there are as much splitted parts as the image size along the specified axis.nb<=0
, instance image is splitted into blocs of -nb
pixel wide.nb>0
, instance image is splitted into nb
blocs. Split image into a list of one-column vectors, according to a specified splitting value.
value | Splitting value. |
keep_values | Tells if the splitting value must be kept in the splitted blocs. |
is_shared | Tells if the splitted blocs have shared memory buffers. |
CImgList<T> get_split | ( | const CImg< t > & | values, |
const bool | keep_values, | ||
const bool | is_shared | ||
) | const |
Split image into a list of one-column vectors, according to a specified splitting value sequence.
values | Splitting value sequence. |
keep_values | Tells if the splitting sequence must be kept in the splitted blocs. |
is_shared | Tells if the splitted blocs have shared memory buffers. |
Append two images along specified axis.
img | Image to append with instance image. |
axis | Appending axis. Can be { 'x' | 'y' | 'z' | 'c' } . |
align | Append alignment in [0,1]. |
CImg<T>& correlate | ( | const CImg< t > & | mask, |
const unsigned int | boundary_conditions = 1 , |
||
const bool | is_normalized = false |
||
) |
Correlate image by a mask.
mask | = the correlation kernel. |
boundary_conditions | = the border condition type (0=zero, 1=dirichlet) |
is_normalized | = enable local normalization. |
*this
by the mask mask
is defined to be: res(x,y,z) = sum_{i,j,k} (*this)(x+i,y+j,z+k)*mask(i,j,k) CImg<T>& convolve | ( | const CImg< t > & | mask, |
const unsigned int | boundary_conditions = 1 , |
||
const bool | is_normalized = false |
||
) |
Convolve image by a mask.
mask | = the correlation kernel. |
boundary_conditions | = the border condition type (0=zero, 1=dirichlet) |
is_normalized | = enable local normalization. |
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) CImg<T>& erode | ( | const CImg< t > & | mask, |
const unsigned int | boundary_conditions = 1 , |
||
const bool | is_normalized = false |
||
) |
Erode image by a structuring element.
mask | Structuring element. |
boundary_conditions | Boundary conditions. |
is_normalized | Tells if the erosion is locally normalized. |
Erode image by a rectangular structuring element of specified size.
sx | Width of the structuring element. |
sy | Height of the structuring element. |
sz | Depth of the structuring element. |
Erode the image by a square structuring element of specified size.
s | Size of the structuring element. |
CImg<T>& dilate | ( | const CImg< t > & | mask, |
const unsigned int | boundary_conditions = 1 , |
||
const bool | is_normalized = false |
||
) |
Dilate image by a structuring element.
mask | Structuring element. |
boundary_conditions | Boundary conditions. |
is_normalized | Tells if the erosion is locally normalized. |
Dilate image by a rectangular structuring element of specified size.
sx | Width of the structuring element. |
sy | Height of the structuring element. |
sz | Depth of the structuring element. |
Dilate image by a square structuring element of specified size.
s | Size of the structuring element. |
Compute watershed transform.
priority | Priority map. |
fill_lines | Tells if watershed lines must be filled or not. |
CImg<T>& deriche | ( | const float | sigma, |
const int | order = 0 , |
||
const char | axis = 'x' , |
||
const bool | boundary_conditions = true |
||
) |
Apply recursive Deriche filter.
sigma | Standard deviation of the filter. |
order | Order of the filter. Can be { 0=smooth-filter | 1=1st-derivative | 2=2nd-derivative } . |
axis | Axis along which the filter is computed. Can be { 'x' | 'y' | 'z' | 'c' } . |
boundary_conditions | Boundary conditions. Can be { 0=dirichlet | 1=neumann } . |
CImg<T>& blur | ( | const float | sigma_x, |
const float | sigma_y, | ||
const float | sigma_z, | ||
const bool | boundary_conditions = true |
||
) |
Blur image.
sigma_x | Standard deviation of the blur, along the X-axis. |
sigma_y | Standard deviation of the blur, along the Y-axis. |
sigma_z | Standard deviation of the blur, along the Z-axis. |
boundary_conditions | Boundary conditions. Can be { 0=dirichlet | 1=neumann } . |
Blur image isotropically.
sigma | Standard deviation of the blur. |
boundary_conditions | Boundary conditions. Can be { 0=dirichlet | 1=neumann } .a |
CImg<T>& blur_anisotropic | ( | const CImg< t > & | G, |
const float | amplitude = 60 , |
||
const float | dl = 0.8f , |
||
const float | da = 30 , |
||
const float | gauss_prec = 2 , |
||
const unsigned int | interpolation_type = 0 , |
||
const bool | is_fast_approx = 1 |
||
) |
Blur image anisotropically, directed by a field of diffusion tensors.
G | Field of square roots of diffusion tensors/vectors used to drive the smoothing. |
amplitude | Amplitude of the smoothing. |
dl | Spatial discretization. |
da | Angular discretization. |
gauss_prec | Precision of the diffusion process. |
interpolation_type | Interpolation scheme. Can be { 0=nearest-neighbor | 1=linear | 2=Runge-Kutta } . |
is_fast_approx | Tells if a fast approximation of the gaussian function is used or not. |
CImg<T>& blur_anisotropic | ( | const float | amplitude, |
const float | sharpness = 0.7f , |
||
const float | anisotropy = 0.6f , |
||
const float | alpha = 0.6f , |
||
const float | sigma = 1.1f , |
||
const float | dl = 0.8f , |
||
const float | da = 30 , |
||
const float | gauss_prec = 2 , |
||
const unsigned int | interpolation_type = 0 , |
||
const bool | is_fast_approx = true |
||
) |
Blur image anisotropically, in an edge-preserving way.
amplitude | Amplitude of the smoothing. |
sharpness | Sharpness. |
anisotropy | Anisotropy. |
alpha | Standard deviation of the gradient blur. |
sigma | Standard deviation of the structure tensor blur. |
dl | Spatial discretization. |
da | Angular discretization. |
gauss_prec | Precision of the diffusion process. |
interpolation_type | Interpolation scheme. Can be { 0=nearest-neighbor | 1=linear | 2=Runge-Kutta } . |
is_fast_approx | Tells if a fast approximation of the gaussian function is used or not. |
CImg<T>& blur_bilateral | ( | const float | sigma_x, |
const float | sigma_y, | ||
const float | sigma_z, | ||
const float | sigma_r, | ||
const int | bgrid_x, | ||
const int | bgrid_y, | ||
const int | bgrid_z, | ||
const int | bgrid_r, | ||
const bool | interpolation_type = true |
||
) |
Blur image, with the bilateral filter.
sigma_x | Amount of blur along the X-axis. |
sigma_y | Amount of blur along the Y-axis. |
sigma_z | Amount of blur along the Z-axis. |
sigma_r | Amount of blur along the value axis. |
bgrid_x | Size of the bilateral grid along the X-axis. |
bgrid_y | Size of the bilateral grid along the Y-axis. |
bgrid_z | Size of the bilateral grid along the Z-axis. |
bgrid_r | Size of the bilateral grid along the value axis. |
interpolation_type | Use interpolation for image slicing. |
CImg<T>& blur_bilateral | ( | const float | sigma_s, |
const float | sigma_r, | ||
const int | bgrid_s = -33 , |
||
const int | bgrid_r = 32 , |
||
const bool | interpolation_type = true |
||
) |
Blur image using the bilateral filter.
sigma_s | Amount of blur along the XYZ-axes. |
sigma_r | Amount of blur along the value axis. |
bgrid_s | Size of the bilateral grid along the XYZ-axes. |
bgrid_r | Size of the bilateral grid along the value axis. |
interpolation_type | Use interpolation for image slicing. |
CImg<T>& blur_patch | ( | const float | sigma_s, |
const float | sigma_p, | ||
const unsigned int | patch_size = 3 , |
||
const unsigned int | lookup_size = 4 , |
||
const float | smoothness = 0 , |
||
const bool | is_fast_approx = true |
||
) |
Blur image using patch-based space.
sigma_s | Amount of blur along the XYZ-axes. |
sigma_p | Amount of blur along the value axis. |
patch_size | Size of the patchs. |
lookup_size | Size of the window to search similar patchs. |
smoothness | Smoothness for the patch comparison. |
is_fast_approx | Tells if a fast approximation of the gaussian function is used or not. |
CImg<T>& blur_median | ( | const unsigned int | n | ) |
Blur image with the median filter.
n | Size of the median filter. |
CImg<T>& sharpen | ( | const float | amplitude, |
const bool | sharpen_type = false , |
||
const float | edge = 1 , |
||
const float | alpha = 0 , |
||
const float | sigma = 0 |
||
) |
Sharpen image.
amplitude | Sharpening amplitude |
sharpen_type | Select sharpening method. Can be { false=inverse diffusion | true=shock filters } . |
edge | Edge threshold (shock filters only). |
alpha | Gradient smoothness (shock filters only). |
sigma | Tensor smoothness (shock filters only). |
CImgList<Tfloat> get_gradient | ( | const char *const | axes = 0 , |
const int | scheme = 3 |
||
) | const |
Return image gradient.
axes | Axes considered for the gradient computation, as a C-string (e.g "xy"). |
scheme | = Numerical scheme used for the gradient computation:
|
CImgList<Tfloat> get_hessian | ( | const char *const | axes = 0 | ) | const |
Return image hessian.
axes | Axes considered for the hessian computation, as a C-string (e.g "xy"). |
CImg<T>& structure_tensors | ( | const unsigned int | scheme = 2 | ) |
Compute the structure tensor field of an image.
scheme | Numerical scheme. Can be { 0=central | 1=fwd/bwd1 | 2=fwd/bwd2 } |
CImg<T>& diffusion_tensors | ( | const float | sharpness = 0.7f , |
const float | anisotropy = 0.6f , |
||
const float | alpha = 0.6f , |
||
const float | sigma = 1.1f , |
||
const bool | is_sqrt = false |
||
) |
Compute field of diffusion tensors for edge-preserving smoothing.
sharpness | Sharpness |
anisotropy | Anisotropy |
alpha | Standard deviation of the gradient blur. |
sigma | Standard deviation of the structure tensor blur. |
is_sqrt | Tells if the square root of the tensor field is computed instead. |
CImg<T>& displacement | ( | const CImg< T > & | source, |
const float | smoothness = 0.1f , |
||
const float | precision = 5.0f , |
||
const unsigned int | nb_scales = 0 , |
||
const unsigned int | iteration_max = 10000 , |
||
const bool | is_backward = false |
||
) |
Estimate displacement field between two images.
source | Reference image. |
smoothness | Smoothness of estimated displacement field. |
precision | Precision required for algorithm convergence. |
nb_scales | Number of scales used to estimate the displacement field. |
iteration_max | Maximum number of iterations allowed for one scale. |
is_backward | If false, match I2(X+U(X)) = I1(X), else match I2(X) = I1(X-U(X)). |
Compute distance to a specified value.
value | Reference value. |
metric | Type of metric. Can be { 0=Chebyshev | 1=Manhattan | 2=Euclidean | 3=Squared-euclidean } . |
Compute chamfer distance to a specified value, with a custom metric.
value | Reference value. |
metric_mask | Metric mask. |
CImg<T>& distance_dijkstra | ( | const unsigned int | x = 0 , |
const unsigned int | y = 0 , |
||
const unsigned int | z = 0 |
||
) |
Compute distance map to one source point.
x | X-coordinate of the source point. |
y | Y-coordinate of the source point. |
z | Z-coordinate of the source point. |
CImg<T>& distance_eikonal | ( | const unsigned int | nb_iterations, |
const float | band_size = 0 , |
||
const float | time_step = 0.5f |
||
) |
Compute distance function to 0-valued isophotes, using the Eikonal PDE.
nb_iterations | Number of PDE iterations. |
band_size | Size of the narrow band. |
time_step | Time step of the PDE iterations. |
Compute Haar multiscale wavelet transform.
axis | Axis considered for the transform. |
invert | Set inverse of direct transform. |
nb_scales | Number of scales used for the transform. |
Compute Haar multiscale wavelet transform [overloading].
invert | Set inverse of direct transform. |
nb_scales | Number of scales used for the transform. |
Compute 1d Fast Fourier Transform, along a specified axis.
axis | Axis along which the FFT is computed. |
is_invert | Tells if the forward (false ) or inverse (true ) FFT is computed. |
static void FFT | ( | CImg< T > & | real, |
CImg< T > & | imag, | ||
const char | axis, | ||
const bool | is_invert = false |
||
) | [static] |
Compute 1d Fast Fourier Transform, along a specified axis.
[in,out] | real | Real part of the pixel values. |
[in,out] | imag | Imaginary part of the pixel values. |
axis | Axis along which the FFT is computed. | |
is_invert | Tells if the forward (false ) or inverse (true ) FFT is computed. |
Compute n-d Fast Fourier Transform.
[in,out] | real | Real part of the pixel values. |
[in,out] | imag | Imaginary part of the pixel values. |
is_invert | Tells if the forward (false ) or inverse (true ) FFT is computed. |
CImg<T>& shift_object3d | ( | const float | tx, |
const float | ty = 0 , |
||
const float | tz = 0 |
||
) |
Shift 3d object's vertices.
tx | X-coordinate of the 3d displacement vector. |
ty | Y-coordinate of the 3d displacement vector. |
tz | Z-coordinate of the 3d displacement vector. |
CImg<T>& shift_object3d | ( | ) |
Shift 3d object's vertices, so that it becomes centered.
CImg<T>& resize_object3d | ( | const float | sx, |
const float | sy = -100 , |
||
const float | sz = -100 |
||
) |
Resize 3d object.
sx | Width of the 3d object's bounding box. |
sy | Height of the 3d object's bounding box. |
sz | Depth of the 3d object's bounding box. |
CImg<T>& append_object3d | ( | CImgList< tf > & | primitives, |
const CImg< tp > & | obj_vertices, | ||
const CImgList< tff > & | obj_primitives | ||
) |
Merge two 3d objects together.
[in,out] | primitives | Primitives data of the current 3d object. |
obj_vertices | Vertices data of the additional 3d object. | |
obj_primitives | Primitives data of the additional 3d object. |
const CImg<T>& texturize_object3d | ( | CImgList< tp > & | primitives, |
CImgList< tc > & | colors, | ||
const CImg< tt > & | texture, | ||
const CImg< tx > & | coords = CImg<tx>::empty() |
||
) | const |
Texturize primitives of a 3d object.
[in,out] | primitives | Primitives data of the 3d object. |
[in,out] | colors | Colors data of the 3d object. |
texture | Texture image to map to 3d object. | |
coords | Texture-mapping coordinates. |
CImg<floatT> get_elevation3d | ( | CImgList< tf > & | primitives, |
CImgList< tc > & | colors, | ||
const CImg< te > & | elevation | ||
) | const |
Generate a 3d elevation of the image instance.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
[out] | colors | The returned list of the 3d object colors. |
elevation | The input elevation map. |
const CImg<float> img("reference.jpg"); CImgList<unsigned int> faces3d; CImgList<unsigned char> colors3d; const CImg<float> points3d = img.get_elevation3d(faces3d,colors,img.get_norm()*0.2); CImg<unsigned char>().display_object3d("Elevation3d",points3d,faces3d,colors3d);
CImg<floatT> get_projections3d | ( | CImgList< tf > & | primitives, |
CImgList< tc > & | colors, | ||
const unsigned int | x0, | ||
const unsigned int | y0, | ||
const unsigned int | z0, | ||
const bool | normalize_colors = false |
||
) | const |
Generate the 3d projection planes of the image instance.
[out] | primitives | Primitives data of the returned 3d object. |
[out] | colors | Colors data of the returned 3d object. |
x0 | X-coordinate of the projection point. | |
y0 | Y-coordinate of the projection point. | |
z0 | Z-coordinate of the projection point. | |
normalize_colors | Tells if the created textures have normalized colors. |
CImg<floatT> get_isoline3d | ( | CImgList< tf > & | primitives, |
const float | isovalue, | ||
const int | size_x = -100 , |
||
const int | size_y = -100 |
||
) | const |
Generate a isoline of the image instance as a 3d object.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
isovalue | The returned list of the 3d object colors. | |
size_x | The number of subdivisions along the X-axis. | |
size_y | The number of subdisivions along the Y-axis. |
const CImg<float> img("reference.jpg"); CImgList<unsigned int> faces3d; const CImg<float> points3d = img.get_isoline3d(faces3d,100); CImg<unsigned char>().display_object3d("Isoline3d",points3d,faces3d,colors3d);
CImg<floatT> get_isosurface3d | ( | CImgList< tf > & | primitives, |
const float | isovalue, | ||
const int | size_x = -100 , |
||
const int | size_y = -100 , |
||
const int | size_z = -100 |
||
) | const |
Generate an isosurface of the image instance as a 3d object.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
isovalue | The returned list of the 3d object colors. | |
size_x | Number of subdivisions along the X-axis. | |
size_y | Number of subdisivions along the Y-axis. | |
size_z | Number of subdisivions along the Z-axis. |
const CImg<float> img = CImg<unsigned char>("reference.jpg").resize(-100,-100,20); CImgList<unsigned int> faces3d; const CImg<float> points3d = img.get_isosurface3d(faces3d,100); CImg<unsigned char>().display_object3d("Isosurface3d",points3d,faces3d,colors3d);
static CImg<floatT> elevation3d | ( | CImgList< tf > & | primitives, |
const tfunc & | func, | ||
const float | x0, | ||
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const int | size_x = 256 , |
||
const int | size_y = 256 |
||
) | [static] |
Compute 3d elevation of a function as a 3d object.
[out] | primitives | Primitives data of the resulting 3d object. |
func | Elevation function. Is of type float (*func)(const float x,const float y) . | |
x0 | X-coordinate of the starting point. | |
y0 | Y-coordinate of the starting point. | |
x1 | X-coordinate of the ending point. | |
y1 | Y-coordinate of the ending point. | |
size_x | Resolution of the function along the X-axis. | |
size_y | Resolution of the function along the Y-axis. |
static CImg<floatT> isoline3d | ( | CImgList< tf > & | primitives, |
const tfunc & | func, | ||
const float | isovalue, | ||
const float | x0, | ||
const float | y0, | ||
const float | x1, | ||
const float | y1, | ||
const int | size_x = 256 , |
||
const int | size_y = 256 |
||
) | [static] |
Compute 0-isolines of a function, as a 3d object.
[out] | primitives | Primitives data of the resulting 3d object. |
func | Elevation function. Is of type float (*func)(const float x,const float y) . | |
isovalue | Isovalue to extract from function. | |
x0 | X-coordinate of the starting point. | |
y0 | Y-coordinate of the starting point. | |
x1 | X-coordinate of the ending point. | |
y1 | Y-coordinate of the ending point. | |
size_x | Resolution of the function along the X-axis. | |
size_y | Resolution of the function along the Y-axis. |
static CImg<floatT> isosurface3d | ( | CImgList< tf > & | primitives, |
const tfunc & | func, | ||
const float | isovalue, | ||
const float | x0, | ||
const float | y0, | ||
const float | z0, | ||
const float | x1, | ||
const float | y1, | ||
const float | z1, | ||
const int | size_x = 32 , |
||
const int | size_y = 32 , |
||
const int | size_z = 32 |
||
) | [static] |
Compute isosurface of a function, as a 3d object.
[out] | primitives | Primitives data of the resulting 3d object. |
func | Implicit function. Is of type float (*func)(const float x, const float y, const float z) . | |
isovalue | Isovalue to extract. | |
x0 | X-coordinate of the starting point. | |
y0 | Y-coordinate of the starting point. | |
z0 | Z-coordinate of the starting point. | |
x1 | X-coordinate of the ending point. | |
y1 | Y-coordinate of the ending point. | |
z1 | Z-coordinate of the ending point. | |
size_x | Resolution of the elevation function along the X-axis. | |
size_y | Resolution of the elevation function along the Y-axis. | |
size_z | Resolution of the elevation function along the Z-axis. |
static CImg<floatT> box3d | ( | CImgList< tf > & | primitives, |
const float | size_x = 200 , |
||
const float | size_y = 100 , |
||
const float | size_z = 100 |
||
) | [static] |
Generate a 3d box object.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
size_x | The width of the box (dimension along the X-axis). | |
size_y | The height of the box (dimension along the Y-axis). | |
size_z | The depth of the box (dimension along the Z-axis). |
CImgList<unsigned int> faces3d; const CImg<float> points3d = CImg<float>::box3d(faces3d,10,20,30); CImg<unsigned char>().display_object3d("Box3d",points3d,faces3d);
static CImg<floatT> cone3d | ( | CImgList< tf > & | primitives, |
const float | radius = 50 , |
||
const float | size_z = 100 , |
||
const unsigned int | subdivisions = 24 |
||
) | [static] |
Generate a 3d cone.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
radius | The radius of the cone basis. | |
size_z | The cone's height. | |
subdivisions | The number of basis angular subdivisions. |
CImgList<unsigned int> faces3d; const CImg<float> points3d = CImg<float>::cone3d(faces3d,50); CImg<unsigned char>().display_object3d("Cone3d",points3d,faces3d);
static CImg<floatT> cylinder3d | ( | CImgList< tf > & | primitives, |
const float | radius = 50 , |
||
const float | size_z = 100 , |
||
const unsigned int | subdivisions = 24 |
||
) | [static] |
Generate a 3d cylinder.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
radius | The radius of the cylinder basis. | |
size_z | The cylinder's height. | |
subdivisions | The number of basis angular subdivisions. |
CImgList<unsigned int> faces3d; const CImg<float> points3d = CImg<float>::cylinder3d(faces3d,50); CImg<unsigned char>().display_object3d("Cylinder3d",points3d,faces3d);
static CImg<floatT> torus3d | ( | CImgList< tf > & | primitives, |
const float | radius1 = 100 , |
||
const float | radius2 = 30 , |
||
const unsigned int | subdivisions1 = 24 , |
||
const unsigned int | subdivisions2 = 12 |
||
) | [static] |
Generate a 3d torus.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
radius1 | The large radius. | |
radius2 | The small radius. | |
subdivisions1 | The number of angular subdivisions for the large radius. | |
subdivisions2 | The number of angular subdivisions for the small radius. |
CImgList<unsigned int> faces3d; const CImg<float> points3d = CImg<float>::torus3d(faces3d,20,4); CImg<unsigned char>().display_object3d("Torus3d",points3d,faces3d);
static CImg<floatT> plane3d | ( | CImgList< tf > & | primitives, |
const float | size_x = 100 , |
||
const float | size_y = 100 , |
||
const unsigned int | subdivisions_x = 10 , |
||
const unsigned int | subdivisions_y = 10 |
||
) | [static] |
Generate a 3d XY-plane.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
size_x | The width of the plane (dimension along the X-axis). | |
size_y | The height of the plane (dimensions along the Y-axis). | |
subdivisions_x | The number of planar subdivisions along the X-axis. | |
subdivisions_y | The number of planar subdivisions along the Y-axis. |
CImgList<unsigned int> faces3d; const CImg<float> points3d = CImg<float>::plane3d(faces3d,100,50); CImg<unsigned char>().display_object3d("Plane3d",points3d,faces3d);
static CImg<floatT> sphere3d | ( | CImgList< tf > & | primitives, |
const float | radius = 50 , |
||
const unsigned int | subdivisions = 3 |
||
) | [static] |
Generate a 3d sphere.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
radius | The radius of the sphere (dimension along the X-axis). | |
subdivisions | The number of recursive subdivisions from an initial icosahedron. |
CImgList<unsigned int> faces3d; const CImg<float> points3d = CImg<float>::sphere3d(faces3d,100,4); CImg<unsigned char>().display_object3d("Sphere3d",points3d,faces3d);
static CImg<floatT> ellipsoid3d | ( | CImgList< tf > & | primitives, |
const CImg< t > & | tensor, | ||
const unsigned int | subdivisions = 3 |
||
) | [static] |
Generate a 3d ellipsoid.
[out] | primitives | The returned list of the 3d object primitives (template type tf should be at least unsigned int). |
tensor | The tensor which gives the shape and size of the ellipsoid. | |
subdivisions | The number of recursive subdivisions from an initial stretched icosahedron. |
CImgList<unsigned int> faces3d; const CImg<float> tensor = CImg<float>::diagonal(10,7,3), points3d = CImg<float>::ellipsoid3d(faces3d,tensor,4); CImg<unsigned char>().display_object3d("Ellipsoid3d",points3d,faces3d);
CImg<T>& object3dtoCImg3d | ( | const CImgList< tp > & | primitives, |
const CImgList< tc > & | colors, | ||
const to & | opacities | ||
) |
Convert 3d object into a CImg3d representation.
primitives | Primitives data of the 3d object. |
colors | Colors data of the 3d object. |
opacities | Opacities data of the 3d object. |
CImg<T>& CImg3dtoobject3d | ( | CImgList< tp > & | primitives, |
CImgList< tc > & | colors, | ||
CImgList< to > & | opacities | ||
) |
Convert CImg3d representation into a 3d object.
[out] | primitives | Primitives data of the 3d object. |
[out] | colors | Colors data of the 3d object. |
[out] | opacities | Opacities data of the 3d object. |
CImg<T>& draw_point | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a 3d point.
x0 | X-coordinate of the point. |
y0 | Y-coordinate of the point. |
z0 | Z-coordinate of the point. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<unsigned char> img(100,100,1,3,0); const unsigned char color[] = { 255,128,64 }; img.draw_point(50,50,color);
CImg<T>& draw_point | ( | const CImg< t > & | points, |
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
points | Image of vertices coordinates. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_line | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a 2d line.
x0 | X-coordinate of the starting line point. |
y0 | Y-coordinate of the starting line point. |
x1 | X-coordinate of the ending line point. |
y1 | Y-coordinate of the ending line point. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | Tells if a reinitialization of the hash state must be done. |
init_hatch
= false to draw consecutive hatched segments without breaking the line pattern. CImg<unsigned char> img(100,100,1,3,0); const unsigned char color[] = { 255,128,64 }; img.draw_line(40,40,80,70,color);
CImg<T>& draw_line | ( | CImg< tz > & | zbuffer, |
const int | x0, | ||
const int | y0, | ||
const float | z0, | ||
const int | x1, | ||
const int | y1, | ||
const float | z1, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a 2d line, with z-buffering.
zbuffer | Zbuffer image. |
x0 | X-coordinate of the starting point. |
y0 | Y-coordinate of the starting point. |
z0 | Z-coordinate of the starting point |
x1 | X-coordinate of the ending point. |
y1 | Y-coordinate of the ending point. |
z1 | Z-coordinate of the ending point. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | Tells if a reinitialization of the hash state must be done. |
CImg<T>& draw_line | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const int | x1, | ||
const int | y1, | ||
const int | z1, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a 3d line.
x0 | X-coordinate of the starting point. |
y0 | Y-coordinate of the starting point. |
z0 | Z-coordinate of the starting point |
x1 | X-coordinate of the ending point. |
y1 | Y-coordinate of the ending point. |
z1 | Z-coordinate of the ending point. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | Tells if a reinitialization of the hash state must be done. |
CImg<T>& draw_line | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const CImg< tc > & | texture, | ||
const int | tx0, | ||
const int | ty0, | ||
const int | tx1, | ||
const int | ty1, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a textured 2d line.
x0 | X-coordinate of the starting line point. |
y0 | Y-coordinate of the starting line point. |
x1 | X-coordinate of the ending line point. |
y1 | Y-coordinate of the ending line point. |
texture | Texture image defining the pixel colors. |
tx0 | X-coordinate of the starting texture point. |
ty0 | Y-coordinate of the starting texture point. |
tx1 | X-coordinate of the ending texture point. |
ty1 | Y-coordinate of the ending texture point. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | Tells if the hash variable must be reinitialized. |
CImg<unsigned char> img(100,100,1,3,0), texture("texture256x256.ppm"); const unsigned char color[] = { 255,128,64 }; img.draw_line(40,40,80,70,texture,0,0,255,255);
CImg<T>& draw_line | ( | const int | x0, |
const int | y0, | ||
const float | z0, | ||
const int | x1, | ||
const int | y1, | ||
const float | z1, | ||
const CImg< tc > & | texture, | ||
const int | tx0, | ||
const int | ty0, | ||
const int | tx1, | ||
const int | ty1, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a textured 2d line, with perspective correction.
x0 | X-coordinate of the starting point. |
y0 | Y-coordinate of the starting point. |
z0 | Z-coordinate of the starting point |
x1 | X-coordinate of the ending point. |
y1 | Y-coordinate of the ending point. |
z1 | Z-coordinate of the ending point. |
texture | Texture image defining the pixel colors. |
tx0 | X-coordinate of the starting texture point. |
ty0 | Y-coordinate of the starting texture point. |
tx1 | X-coordinate of the ending texture point. |
ty1 | Y-coordinate of the ending texture point. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | Tells if the hash variable must be reinitialized. |
CImg<T>& draw_line | ( | CImg< tz > & | zbuffer, |
const int | x0, | ||
const int | y0, | ||
const float | z0, | ||
const int | x1, | ||
const int | y1, | ||
const float | z1, | ||
const CImg< tc > & | texture, | ||
const int | tx0, | ||
const int | ty0, | ||
const int | tx1, | ||
const int | ty1, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a textured 2d line, with perspective correction and z-buffering.
zbuffer | Z-buffer image. |
x0 | X-coordinate of the starting point. |
y0 | Y-coordinate of the starting point. |
z0 | Z-coordinate of the starting point |
x1 | X-coordinate of the ending point. |
y1 | Y-coordinate of the ending point. |
z1 | Z-coordinate of the ending point. |
texture | Texture image defining the pixel colors. |
tx0 | X-coordinate of the starting texture point. |
ty0 | Y-coordinate of the starting texture point. |
tx1 | X-coordinate of the ending texture point. |
ty1 | Y-coordinate of the ending texture point. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | Tells if the hash variable must be reinitialized. |
CImg<T>& draw_line | ( | const CImg< t > & | points, |
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a set of consecutive lines.
points | Coordinates of vertices, stored as a list of vectors. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | If set to true, init hatch motif. |
points
. CImg<unsigned char> img(100,100,1,3,0); const unsigned char color[] = { 255,128,64 }; CImgList<int> points; points.insert(CImg<int>::vector(0,0)). .insert(CImg<int>::vector(70,10)). .insert(CImg<int>::vector(80,60)). .insert(CImg<int>::vector(10,90)); img.draw_line(points,color);
CImg<T>& draw_arrow | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const float | angle = 30 , |
||
const float | length = -10 , |
||
const unsigned int | pattern = ~0U |
||
) |
Draw a 2d arrow.
x0 | X-coordinate of the starting arrow point (tail). |
y0 | Y-coordinate of the starting arrow point (tail). |
x1 | X-coordinate of the ending arrow point (head). |
y1 | Y-coordinate of the ending arrow point (head). |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
angle | Aperture angle of the arrow head. |
length | Length of the arrow head. If negative, describes a percentage of the arrow length. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
CImg<T>& draw_spline | ( | const int | x0, |
const int | y0, | ||
const float | u0, | ||
const float | v0, | ||
const int | x1, | ||
const int | y1, | ||
const float | u1, | ||
const float | v1, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const float | precision = 0.25 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a 2d spline.
x0 | X-coordinate of the starting curve point |
y0 | Y-coordinate of the starting curve point |
u0 | X-coordinate of the starting velocity |
v0 | Y-coordinate of the starting velocity |
x1 | X-coordinate of the ending curve point |
y1 | Y-coordinate of the ending curve point |
u1 | X-coordinate of the ending velocity |
v1 | Y-coordinate of the ending velocity |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
precision | Curve drawing precision. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | If true , init hatch motif. |
precision
parameter sets the average number of pixels in each drawn segment.x0
,y0
), (xa
,ya
), (xb
,yb
), (x1
,y1
) } where (x0
,y0
) is the starting point, (x1
,y1
) is the ending point and (xa
,ya
), (xb
,yb
) are two control points. The starting and ending velocities (u0
,v0
) and (u1
,v1
) can be deduced easily from the control points as u0
= (xa
- x0
), v0
= (ya
- y0
), u1
= (x1
- xb
) and v1
= (y1
- yb
). CImg<unsigned char> img(100,100,1,3,0); const unsigned char color[] = { 255,255,255 }; img.draw_spline(30,30,0,100,90,40,0,-100,color);
CImg<T>& draw_spline | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const float | u0, | ||
const float | v0, | ||
const float | w0, | ||
const int | x1, | ||
const int | y1, | ||
const int | z1, | ||
const float | u1, | ||
const float | v1, | ||
const float | w1, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const float | precision = 4 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a 3d spline [overloading].
CImg<T>& draw_spline | ( | const int | x0, |
const int | y0, | ||
const float | u0, | ||
const float | v0, | ||
const int | x1, | ||
const int | y1, | ||
const float | u1, | ||
const float | v1, | ||
const CImg< t > & | texture, | ||
const int | tx0, | ||
const int | ty0, | ||
const int | tx1, | ||
const int | ty1, | ||
const float | opacity = 1 , |
||
const float | precision = 4 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a textured 2d spline.
x0 | X-coordinate of the starting curve point |
y0 | Y-coordinate of the starting curve point |
u0 | X-coordinate of the starting velocity |
v0 | Y-coordinate of the starting velocity |
x1 | X-coordinate of the ending curve point |
y1 | Y-coordinate of the ending curve point |
u1 | X-coordinate of the ending velocity |
v1 | Y-coordinate of the ending velocity |
texture | Texture image defining line pixel colors. |
tx0 | X-coordinate of the starting texture point. |
ty0 | Y-coordinate of the starting texture point. |
tx1 | X-coordinate of the ending texture point. |
ty1 | Y-coordinate of the ending texture point. |
precision | Curve drawing precision. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | if true , reinit hatch motif. |
CImg<T>& draw_spline | ( | const CImg< tp > & | points, |
const CImg< tt > & | tangents, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const bool | is_closed_set = false , |
||
const float | precision = 4 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a set of consecutive splines.
points | Vertices data. |
tangents | Tangents data. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
is_closed_set | Tells if the drawn spline set is closed. |
precision | Precision of the drawing. |
pattern | An integer whose bits describe the line pattern. |
init_hatch | If true , init hatch motif. |
CImg<T>& draw_spline | ( | const CImg< tp > & | points, |
const tc *const | color, | ||
const float | opacity = 1 , |
||
const bool | is_closed_set = false , |
||
const float | precision = 4 , |
||
const unsigned int | pattern = ~0U , |
||
const bool | init_hatch = true |
||
) |
Draw a set of consecutive splines [overloading].
Similar to previous function, with the point tangents automatically estimated from the given points set.
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 2d triangle.
x0 | X-coordinate of the first vertex. |
y0 | Y-coordinate of the first vertex. |
x1 | X-coordinate of the second vertex. |
y1 | Y-coordinate of the second vertex. |
x2 | X-coordinate of the third vertex. |
y2 | Y-coordinate of the third vertex. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const tc *const | color, | ||
const float | opacity, | ||
const unsigned int | pattern | ||
) |
Draw a outlined 2d triangle.
x0 | X-coordinate of the first vertex. |
y0 | Y-coordinate of the first vertex. |
x1 | X-coordinate of the second vertex. |
y1 | Y-coordinate of the second vertex. |
x2 | X-coordinate of the third vertex. |
y2 | Y-coordinate of the third vertex. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the outline pattern. |
CImg<T>& draw_triangle | ( | CImg< tz > & | zbuffer, |
const int | x0, | ||
const int | y0, | ||
const float | z0, | ||
const int | x1, | ||
const int | y1, | ||
const float | z1, | ||
const int | x2, | ||
const int | y2, | ||
const float | z2, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const float | brightness = 1 |
||
) |
Draw a filled 2d triangle, with z-buffering.
zbuffer | Z-buffer image. |
x0 | X-coordinate of the first vertex. |
y0 | Y-coordinate of the first vertex. |
z0 | Z-coordinate of the first vertex. |
x1 | X-coordinate of the second vertex. |
y1 | Y-coordinate of the second vertex. |
z1 | Z-coordinate of the second vertex. |
x2 | X-coordinate of the third vertex. |
y2 | Y-coordinate of the third vertex. |
z2 | Z-coordinate of the third vertex. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
brightness | Brightness factor. |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const tc *const | color, | ||
const float | brightness0, | ||
const float | brightness1, | ||
const float | brightness2, | ||
const float | opacity = 1 |
||
) |
Draw a Gouraud-shaded 2d triangle.
x0 | X-coordinate of the first vertex in the image instance. |
y0 | Y-coordinate of the first vertex in the image instance. |
x1 | X-coordinate of the second vertex in the image instance. |
y1 | Y-coordinate of the second vertex in the image instance. |
x2 | X-coordinate of the third vertex in the image instance. |
y2 | Y-coordinate of the third vertex in the image instance. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
brightness0 | Brightness factor of the first vertex (in [0,2]). |
brightness1 | brightness factor of the second vertex (in [0,2]). |
brightness2 | brightness factor of the third vertex (in [0,2]). |
opacity | Drawing opacity. |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const tc1 *const | color1, | ||
const tc2 *const | color2, | ||
const tc3 *const | color3, | ||
const float | opacity = 1 |
||
) |
Draw a color-interpolated 2d triangle.
x0 | X-coordinate of the first vertex in the image instance. |
y0 | Y-coordinate of the first vertex in the image instance. |
x1 | X-coordinate of the second vertex in the image instance. |
y1 | Y-coordinate of the second vertex in the image instance. |
x2 | X-coordinate of the third vertex in the image instance. |
y2 | Y-coordinate of the third vertex in the image instance. |
color1 | Pointer to spectrum() consecutive values of type T , defining the color of the first vertex. |
color2 | Pointer to spectrum() consecutive values of type T , defining the color of the seconf vertex. |
color3 | Pointer to spectrum() consecutive values of type T , defining the color of the third vertex. |
opacity | Drawing opacity. |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const CImg< tc > & | texture, | ||
const int | tx0, | ||
const int | ty0, | ||
const int | tx1, | ||
const int | ty1, | ||
const int | tx2, | ||
const int | ty2, | ||
const float | opacity = 1 , |
||
const float | brightness = 1 |
||
) |
Draw a textured 2d triangle.
x0 | X-coordinate of the first vertex in the image instance. |
y0 | Y-coordinate of the first vertex in the image instance. |
x1 | X-coordinate of the second vertex in the image instance. |
y1 | Y-coordinate of the second vertex in the image instance. |
x2 | X-coordinate of the third vertex in the image instance. |
y2 | Y-coordinate of the third vertex in the image instance. |
texture | Texture image used to fill the triangle. |
tx0 | X-coordinate of the first vertex in the texture image. |
ty0 | Y-coordinate of the first vertex in the texture image. |
tx1 | X-coordinate of the second vertex in the texture image. |
ty1 | Y-coordinate of the second vertex in the texture image. |
tx2 | X-coordinate of the third vertex in the texture image. |
ty2 | Y-coordinate of the third vertex in the texture image. |
opacity | Drawing opacity. |
brightness | Brightness factor of the drawing (in [0,2]). |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const tc *const | color, | ||
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 |
||
) |
Draw a Phong-shaded 2d triangle.
x0 | X-coordinate of the first vertex in the image instance. |
y0 | Y-coordinate of the first vertex in the image instance. |
x1 | X-coordinate of the second vertex in the image instance. |
y1 | Y-coordinate of the second vertex in the image instance. |
x2 | X-coordinate of the third vertex in the image instance. |
y2 | Y-coordinate of the third vertex in the image instance. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
light | Light image. |
lx0 | X-coordinate of the first vertex in the light image. |
ly0 | Y-coordinate of the first vertex in the light image. |
lx1 | X-coordinate of the second vertex in the light image. |
ly1 | Y-coordinate of the second vertex in the light image. |
lx2 | X-coordinate of the third vertex in the light image. |
ly2 | Y-coordinate of the third vertex in the light image. |
opacity | Drawing opacity. |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const CImg< tc > & | texture, | ||
const int | tx0, | ||
const int | ty0, | ||
const int | tx1, | ||
const int | ty1, | ||
const int | tx2, | ||
const int | ty2, | ||
const float | brightness0, | ||
const float | brightness1, | ||
const float | brightness2, | ||
const float | opacity = 1 |
||
) |
Draw a textured Gouraud-shaded 2d triangle.
x0 | X-coordinate of the first vertex in the image instance. |
y0 | Y-coordinate of the first vertex in the image instance. |
x1 | X-coordinate of the second vertex in the image instance. |
y1 | Y-coordinate of the second vertex in the image instance. |
x2 | X-coordinate of the third vertex in the image instance. |
y2 | Y-coordinate of the third vertex in the image instance. |
texture | Texture image used to fill the triangle. |
tx0 | X-coordinate of the first vertex in the texture image. |
ty0 | Y-coordinate of the first vertex in the texture image. |
tx1 | X-coordinate of the second vertex in the texture image. |
ty1 | Y-coordinate of the second vertex in the texture image. |
tx2 | X-coordinate of the third vertex in the texture image. |
ty2 | Y-coordinate of the third vertex in the texture image. |
brightness0 | Brightness factor of the first vertex. |
brightness1 | Brightness factor of the second vertex. |
brightness2 | Brightness factor of the third vertex. |
opacity | Drawing opacity. |
CImg<T>& draw_triangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const int | x2, | ||
const int | y2, | ||
const CImg< tc > & | 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 |
||
) |
Draw a textured Phong-shaded 2d triangle.
x0 | X-coordinate of the first vertex in the image instance. |
y0 | Y-coordinate of the first vertex in the image instance. |
x1 | X-coordinate of the second vertex in the image instance. |
y1 | Y-coordinate of the second vertex in the image instance. |
x2 | X-coordinate of the third vertex in the image instance. |
y2 | Y-coordinate of the third vertex in the image instance. |
texture | Texture image used to fill the triangle. |
tx0 | X-coordinate of the first vertex in the texture image. |
ty0 | Y-coordinate of the first vertex in the texture image. |
tx1 | X-coordinate of the second vertex in the texture image. |
ty1 | Y-coordinate of the second vertex in the texture image. |
tx2 | X-coordinate of the third vertex in the texture image. |
ty2 | Y-coordinate of the third vertex in the texture image. |
light | Light image. |
lx0 | X-coordinate of the first vertex in the light image. |
ly0 | Y-coordinate of the first vertex in the light image. |
lx1 | X-coordinate of the second vertex in the light image. |
ly1 | Y-coordinate of the second vertex in the light image. |
lx2 | X-coordinate of the third vertex in the light image. |
ly2 | Y-coordinate of the third vertex in the light image. |
opacity | Drawing opacity. |
CImg<T>& draw_rectangle | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const int | c0, | ||
const int | x1, | ||
const int | y1, | ||
const int | z1, | ||
const int | c1, | ||
const T | val, | ||
const float | opacity = 1 |
||
) |
Draw a filled 4d rectangle.
x0 | X-coordinate of the upper-left rectangle corner. |
y0 | Y-coordinate of the upper-left rectangle corner. |
z0 | Z-coordinate of the upper-left rectangle corner. |
c0 | C-coordinate of the upper-left rectangle corner. |
x1 | X-coordinate of the lower-right rectangle corner. |
y1 | Y-coordinate of the lower-right rectangle corner. |
z1 | Z-coordinate of the lower-right rectangle corner. |
c1 | C-coordinate of the lower-right rectangle corner. |
val | Scalar value used to fill the rectangle area. |
opacity | Drawing opacity. |
CImg<T>& draw_rectangle | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const int | x1, | ||
const int | y1, | ||
const int | z1, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 3d rectangle.
x0 | X-coordinate of the upper-left rectangle corner. |
y0 | Y-coordinate of the upper-left rectangle corner. |
z0 | Z-coordinate of the upper-left rectangle corner. |
x1 | X-coordinate of the lower-right rectangle corner. |
y1 | Y-coordinate of the lower-right rectangle corner. |
z1 | Z-coordinate of the lower-right rectangle corner. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_rectangle | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 2d rectangle.
x0 | X-coordinate of the upper-left rectangle corner. |
y0 | Y-coordinate of the upper-left rectangle corner. |
x1 | X-coordinate of the lower-right rectangle corner. |
y1 | Y-coordinate of the lower-right rectangle corner. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_polygon | ( | const CImg< t > & | points, |
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 2d polygon.
points | Set of polygon vertices. |
color | Pointer to spectrum() consecutive values of type T , defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_ellipse | ( | const int | x0, |
const int | y0, | ||
const float | r1, | ||
const float | r2, | ||
const float | angle, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 2d ellipse.
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. |
angle | Angle of the first radius. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_ellipse | ( | const int | x0, |
const int | y0, | ||
const CImg< t > & | tensor, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 2d ellipse [overloading].
x0 | X-coordinate of the ellipse center. |
y0 | Y-coordinate of the ellipse center. |
tensor | Diffusion tensor describing the ellipse. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_ellipse | ( | const int | x0, |
const int | y0, | ||
const float | r1, | ||
const float | r2, | ||
const float | angle, | ||
const tc *const | color, | ||
const float | opacity, | ||
const unsigned int | pattern | ||
) |
Draw an outlined 2d ellipse.
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. |
angle | Angle of the first radius. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the outline pattern. |
CImg<T>& draw_ellipse | ( | const int | x0, |
const int | y0, | ||
const CImg< t > & | tensor, | ||
const tc *const | color, | ||
const float | opacity, | ||
const unsigned int | pattern | ||
) |
Draw an outlined 2d ellipse [overloading].
x0 | X-coordinate of the ellipse center. |
y0 | Y-coordinate of the ellipse center. |
tensor | Diffusion tensor describing the ellipse. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the outline pattern. |
CImg<T>& draw_circle | ( | const int | x0, |
const int | y0, | ||
int | radius, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a filled 2d circle.
x0 | X-coordinate of the circle center. |
y0 | Y-coordinate of the circle center. |
radius | Circle radius. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_circle | ( | const int | x0, |
const int | y0, | ||
int | radius, | ||
const tc *const | color, | ||
const float | opacity, | ||
const unsigned int | pattern | ||
) |
Draw an outlined 2d circle.
x0 | X-coordinate of the circle center. |
y0 | Y-coordinate of the circle center. |
radius | Circle radius. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern | An integer whose bits describe the outline pattern. |
CImg<T>& draw_image | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const int | c0, | ||
const CImg< t > & | sprite, | ||
const float | opacity = 1 |
||
) |
Draw an image.
sprite | Sprite image. |
x0 | X-coordinate of the sprite position. |
y0 | Y-coordinate of the sprite position. |
z0 | Z-coordinate of the sprite position. |
c0 | C-coordinate of the sprite position. |
opacity | Drawing opacity. |
CImg<T>& draw_image | ( | const int | x0, |
const int | y0, | ||
const int | z0, | ||
const int | c0, | ||
const CImg< ti > & | sprite, | ||
const CImg< tm > & | mask, | ||
const float | opacity = 1 , |
||
const float | mask_max_value = 1 |
||
) |
Draw a masked image.
sprite | Sprite image. |
mask | Mask image. |
x0 | X-coordinate of the sprite position in the image instance. |
y0 | Y-coordinate of the sprite position in the image instance. |
z0 | Z-coordinate of the sprite position in the image instance. |
c0 | C-coordinate of the sprite position in the image instance. |
mask_max_value | Maximum pixel value of the mask image mask . |
opacity | Drawing opacity. |
mask
set the opacity of the corresponding pixels in sprite
.sprite
and mask
must be the same. CImg<T>& draw_text | ( | const int | x0, |
const int | y0, | ||
const char *const | text, | ||
const tc1 *const | foreground_color, | ||
const tc2 *const | background_color, | ||
const float | opacity, | ||
const CImgList< t > & | font, | ||
... | |||
) |
Draw a text string.
x0 | X-coordinate of the text in the image instance. |
y0 | Y-coordinate of the text in the image instance. |
text | Format of the text ('printf'-style format string). |
foreground_color | Pointer to spectrum() consecutive values, defining the foreground drawing color. |
background_color | Pointer to spectrum() consecutive values, defining the background drawing color. |
opacity | Drawing opacity. |
font | Font used for drawing text. |
CImg<T>& draw_text | ( | const int | x0, |
const int | y0, | ||
const char *const | text, | ||
const tc *const | foreground_color, | ||
const int | , | ||
const float | opacity, | ||
const CImgList< t > & | font, | ||
... | |||
) |
Draw a text string [overloading].
CImg<T>& draw_text | ( | const int | x0, |
const int | y0, | ||
const char *const | text, | ||
const int | , | ||
const tc *const | background_color, | ||
const float | opacity, | ||
const CImgList< t > & | font, | ||
... | |||
) |
Draw a text string [overloading].
CImg<T>& draw_text | ( | const int | x0, |
const int | y0, | ||
const char *const | text, | ||
const tc1 *const | foreground_color, | ||
const tc2 *const | background_color, | ||
const float | opacity = 1 , |
||
const unsigned int | font_height = 13 , |
||
... | |||
) |
Draw a text string [overloading].
x0 | X-coordinate of the text in the image instance. |
y0 | Y-coordinate of the text in the image instance. |
text | Format of the text ('printf'-style format string). |
foreground_color | Array of spectrum() values of type T , defining the foreground color (0 means 'transparent'). |
background_color | Array of spectrum() values of type T , defining the background color (0 means 'transparent'). |
opacity | Drawing opacity. |
font_height | Height of the text font (exact match for 13,24,32,57, interpolated otherwise). |
CImg<T>& draw_quiver | ( | const CImg< t1 > & | flow, |
const t2 *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | sampling = 25 , |
||
const float | factor = -20 , |
||
const bool | is_arrow = true , |
||
const unsigned int | pattern = ~0U |
||
) |
Draw a 2d vector field.
flow | Image of 2d vectors used as input data. |
color | Image of spectrum()-D vectors corresponding to the color of each arrow. |
opacity | Drawing opacity. |
sampling | Length (in pixels) between each arrow. |
factor | Length factor of each arrow (if <0, computed as a percentage of the maximum length). |
is_arrow | Tells if arrows must be drawn, instead of oriented segments. |
pattern | Used pattern to draw lines. |
CImg<T>& draw_quiver | ( | const CImg< t1 > & | flow, |
const CImg< t2 > & | color, | ||
const float | opacity = 1 , |
||
const unsigned int | sampling = 25 , |
||
const float | factor = -20 , |
||
const bool | is_arrow = true , |
||
const unsigned int | pattern = ~0U |
||
) |
Draw a 2d vector field, using a field of colors.
flow | Image of 2d vectors used as input data. |
color | Image of spectrum()-D vectors corresponding to the color of each arrow. |
opacity | Opacity of the drawing. |
sampling | Length (in pixels) between each arrow. |
factor | Length factor of each arrow (if <0, computed as a percentage of the maximum length). |
is_arrow | Tells if arrows must be drawn, instead of oriented segments. |
pattern | Used pattern to draw lines. |
CImg<T>& draw_axis | ( | const CImg< t > & | values_x, |
const int | y, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const unsigned int | font_height = 13 , |
||
const bool | allow_zero = true |
||
) |
Draw a labeled horizontal axis.
values_x | Values along the horizontal axis. |
y | Y-coordinate of the horizontal axis in the image instance. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern | Drawing pattern. |
font_height | Height of the labels (exact match for 13,24,32,57, interpolated otherwise). |
allow_zero | Enable/disable the drawing of label '0' if found. |
CImg<T>& draw_axis | ( | const int | x, |
const CImg< t > & | values_y, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern = ~0U , |
||
const unsigned int | font_height = 13 , |
||
const bool | allow_zero = true |
||
) |
Draw a labeled vertical axis.
x | X-coordinate of the vertical axis in the image instance. |
values_y | Values along the Y-axis. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern | Drawing pattern. |
font_height | Height of the labels (exact match for 13,24,32,57, interpolated otherwise). |
allow_zero | Enable/disable the drawing of label '0' if found. |
CImg<T>& draw_axes | ( | const CImg< tx > & | values_x, |
const CImg< ty > & | values_y, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern_x = ~0U , |
||
const unsigned int | pattern_y = ~0U , |
||
const unsigned int | font_height = 13 , |
||
const bool | allow_zero = true |
||
) |
Draw labeled horizontal and vertical axes.
values_x | Values along the X-axis. |
values_y | Values along the Y-axis. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern_x | Drawing pattern for the X-axis. |
pattern_y | Drawing pattern for the Y-axis. |
font_height | Height of the labels (exact match for 13,24,32,57, interpolated otherwise). |
allow_zero | Enable/disable the drawing of label '0' if found. |
CImg<T>& draw_grid | ( | const CImg< tx > & | values_x, |
const CImg< ty > & | values_y, | ||
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | pattern_x = ~0U , |
||
const unsigned int | pattern_y = ~0U |
||
) |
Draw 2d grid.
values_x | X-coordinates of the vertical lines. |
values_y | Y-coordinates of the horizontal lines. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
pattern_x | Drawing pattern for vertical lines. |
pattern_y | Drawing pattern for horizontal lines. |
CImg<T>& draw_graph | ( | const CImg< t > & | data, |
const tc *const | color, | ||
const float | opacity = 1 , |
||
const unsigned int | plot_type = 1 , |
||
const int | vertex_type = 1 , |
||
const double | ymin = 0 , |
||
const double | ymax = 0 , |
||
const unsigned int | pattern = ~0U |
||
) |
Draw 1d graph.
data | Image containing the graph values I = f(x). |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
plot_type | Define the type of the plot:
|
vertex_type | Define the type of points:
|
ymin | Lower bound of the y-range. |
ymax | Upper bound of the y-range. |
pattern | Drawing pattern. |
ymin==ymax==0
, the y-range is computed automatically from the input samples. CImg<T>& draw_fill | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const tc *const | color, | ||
const float | opacity, | ||
CImg< t > & | region, | ||
const float | sigma = 0 , |
||
const bool | is_high_connexity = false |
||
) |
Draw filled 3d region with the flood fill algorithm.
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 | Pointer to spectrum() consecutive values, defining the drawing color. | |
[out] | 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. | |
is_high_connexity | Tells if 8-connexity must be used (only for 2d images). |
region
is initialized with the binary mask of the filled region. CImg<T>& draw_plasma | ( | const float | alpha = 1 , |
const float | beta = 0 , |
||
const unsigned int | scale = 8 |
||
) |
Draw a random plasma texture.
alpha | Alpha-parameter. |
beta | Beta-parameter. |
scale | Scale-parameter. |
CImg<T>& draw_mandelbrot | ( | const int | x0, |
const int | y0, | ||
const int | x1, | ||
const int | y1, | ||
const CImg< tc > & | colormap, | ||
const float | opacity = 1 , |
||
const double | z0r = -2 , |
||
const double | z0i = -2 , |
||
const double | z1r = 2 , |
||
const double | z1i = 2 , |
||
const unsigned int | iteration_max = 255 , |
||
const bool | is_normalized_iteration = false , |
||
const bool | is_julia_set = false , |
||
const double | param_r = 0 , |
||
const double | param_i = 0 |
||
) |
Draw a quadratic Mandelbrot or Julia 2d fractal.
x0 | X-coordinate of the upper-left pixel. |
y0 | Y-coordinate of the upper-left pixel. |
x1 | X-coordinate of the lower-right pixel. |
y1 | Y-coordinate of the lower-right pixel. |
colormap | Colormap. |
opacity | Drawing opacity. |
z0r | Real part of the upper-left fractal vertex. |
z0i | Imaginary part of the upper-left fractal vertex. |
z1r | Real part of the lower-right fractal vertex. |
z1i | Imaginary part of the lower-right fractal vertex. |
iteration_max | Maximum number of iterations for each estimated point. |
is_normalized_iteration | Tells if iterations are normalized. |
is_julia_set | Tells if the Mandelbrot or Julia set is rendered. |
param_r | Real part of the Julia set parameter. |
param_i | Imaginary part of the Julia set parameter. |
CImg<T>& draw_gaussian | ( | const float | xc, |
const float | sigma, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a 1d gaussian function.
xc | X-coordinate of the gaussian center. |
sigma | Standard variation of the gaussian distribution. |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_gaussian | ( | const float | xc, |
const float | yc, | ||
const CImg< t > & | tensor, | ||
const tc *const | color, | ||
const float | opacity = 1 |
||
) |
Draw a 2d gaussian function.
xc | X-coordinate of the gaussian center. |
yc | Y-coordinate of the gaussian center. |
tensor | Covariance matrix (must be 2x2). |
color | Pointer to spectrum() consecutive values, defining the drawing color. |
opacity | Drawing opacity. |
CImg<T>& draw_object3d | ( | const float | x0, |
const float | y0, | ||
const float | z0, | ||
const CImg< tp > & | vertices, | ||
const CImgList< tf > & | primitives, | ||
const CImgList< tc > & | colors, | ||
const CImg< to > & | opacities, | ||
const unsigned int | render_type = 4 , |
||
const bool | is_double_sided = false , |
||
const float | focale = 500 , |
||
const float | lightx = 0 , |
||
const float | lighty = 0 , |
||
const float | lightz = -5e8 , |
||
const float | specular_lightness = 0.2f , |
||
const float | specular_shininess = 0.1f |
||
) |
Draw a 3d object.
x0 | X-coordinate of the 3d object position |
y0 | Y-coordinate of the 3d object position |
z0 | Z-coordinate of the 3d object position |
vertices | Image Nx3 describing 3d point coordinates |
primitives | List of P primitives |
colors | List of P color (or textures) |
opacities | Image or list of P opacities |
render_type | d Render type (0=Points, 1=Lines, 2=Faces (no light), 3=Faces (flat), 4=Faces(Gouraud) |
is_double_sided | Tells if object faces have two sides or are oriented. |
focale | length of the focale (0 for parallel projection) |
lightx | X-coordinate of the light |
lighty | Y-coordinate of the light |
lightz | Z-coordinate of the light |
specular_lightness | Amount of specular light. |
specular_shininess | Shininess of the object |
CImg<T>& select | ( | CImgDisplay & | disp, |
const unsigned int | feature_type = 2 , |
||
unsigned int *const | XYZ = 0 |
||
) |
Launch simple interface to select a shape from an image.
disp | Display window to use. |
feature_type | Type of feature to select. Can be { 0=point | 1=line | 2=rectangle | 3=ellipse } . |
XYZ | Pointer to 3 values X,Y,Z which tells about the projection point coordinates, for volumetric images. |
Load image from a file.
filename | Filename, as a C-string. |
filename
defines the file format. If no filename extension is provided, CImg<T>::get_load() will try to load the file as a .cimg or .cimgz file. CImg<T>& load_ascii | ( | const char *const | filename | ) |
Load image from an ascii file.
filename | Filename, as a C -string. |
Load image from a DLM file.
filename | Filename, as a C-string. |
Load image from a BMP file.
filename | Filename, as a C-string. |
Load image from a JPEG file.
filename | Filename, as a C-string. |
CImg<T>& load_magick | ( | const char *const | filename | ) |
Load image from a file, using Magick++ library.
filename | Filename, as a C-string. |
Load image from a PNG file.
filename | Filename, as a C-string. |
Load image from a PNM file.
filename | Filename, as a C-string. |
Load image from a PFM file.
filename | Filename, as a C-string. |
CImg<T>& load_rgb | ( | const char *const | filename, |
const unsigned int | dimw, | ||
const unsigned int | dimh = 1 |
||
) |
Load image from a RGB file.
filename | Filename, as a C-string. |
dimw | Width of the image buffer. |
dimh | Height of the image buffer. |
CImg<T>& load_rgba | ( | const char *const | filename, |
const unsigned int | dimw, | ||
const unsigned int | dimh = 1 |
||
) |
Load image from a RGBA file.
filename | Filename, as a C-string. |
dimw | Width of the image buffer. |
dimh | Height of the image buffer. |
CImg<T>& load_tiff | ( | const char *const | filename, |
const unsigned int | first_frame = 0 , |
||
const unsigned int | last_frame = ~0U , |
||
const unsigned int | step_frame = 1 |
||
) |
Load image from a TIFF file.
filename | Filename, as a C-string. |
first_frame | First frame to read (for multi-pages tiff). |
last_frame | Last frame to read (for multi-pages tiff). |
step_frame | Step value of frame reading. |
cimg_use_tif
.char,uchar,short,ushort,float
and double
pixel types.cimg_use_tif
is not defined at compilation time the function uses CImg<T>& load_other(const char*). CImg<T>& load_minc2 | ( | const char *const | filename | ) |
Load image from a MINC2 file.
filename | Filename, as a C-string. |
CImg<T>& load_analyze | ( | const char *const | filename, |
float *const | voxel_size = 0 |
||
) |
Load image from an ANALYZE7.5/NIFTI file.
filename | Filename, as a C-string. | |
[out] | voxel_size | Pointer to the three voxel sizes read from the file. |
Load image from a .cimg[z] file.
filename | Filename, as a C-string. |
axis | Appending axis, if file contains multiple images. Can be { 'x' | 'y' | 'z' | 'c' } . |
align | Appending alignment. |
CImg<T>& load_cimg | ( | const char *const | filename, |
const unsigned int | n0, | ||
const unsigned int | n1, | ||
const unsigned int | x0, | ||
const unsigned int | y0, | ||
const unsigned int | z0, | ||
const unsigned int | c0, | ||
const unsigned int | x1, | ||
const unsigned int | y1, | ||
const unsigned int | z1, | ||
const unsigned int | c1, | ||
const char | axis = 'z' , |
||
const float | align = 0 |
||
) |
Load sub-images of a .cimg file.
filename | Filename, as a C-string. |
n0 | Starting frame. |
n1 | Ending frame. |
x0 | X-coordinate of the starting sub-image vertex. |
y0 | Y-coordinate of the starting sub-image vertex. |
z0 | Z-coordinate of the starting sub-image vertex. |
c0 | C-coordinate of the starting sub-image vertex. |
x1 | X-coordinate of the ending sub-image vertex. |
y1 | Y-coordinate of the ending sub-image vertex. |
z1 | Z-coordinate of the ending sub-image vertex. |
c1 | C-coordinate of the ending sub-image vertex. |
axis | Appending axis, if file contains multiple images. Can be { 'x' | 'y' | 'z' | 'c' } . |
align | Appending alignment. |
Load image from an INRIMAGE-4 file.
filename | Filename, as a C-string. | |
[out] | voxel_size | Pointer to the three voxel sizes read from the file. |
Load image from a EXR file.
filename | Filename, as a C-string. |
CImg<T>& load_pandore | ( | const char *const | filename | ) |
Load image from a PANDORE-5 file.
filename | Filename, as a C-string. |
CImg<T>& load_parrec | ( | const char *const | filename, |
const char | axis = 'c' , |
||
const float | align = 0 |
||
) |
Load image from a PAR-REC (Philips) file.
filename | Filename, as a C-string. |
axis | Appending axis, if file contains multiple images. Can be { 'x' | 'y' | 'z' | 'c' } . |
align | Appending alignment. |
CImg<T>& load_raw | ( | const char *const | filename, |
const unsigned int | size_x = 0 , |
||
const unsigned int | size_y = 1 , |
||
const unsigned int | size_z = 1 , |
||
const unsigned int | size_c = 1 , |
||
const bool | is_multiplexed = false , |
||
const bool | invert_endianness = false |
||
) |
Load image from a raw binary file.
filename | Filename, as a C-string. |
size_x | Width of the image buffer. |
size_y | Height of the image buffer. |
size_z | Depth of the image buffer. |
size_c | Spectrum of the image buffer. |
is_multiplexed | Tells if the image values are multiplexed along the C-axis. |
invert_endianness | Tells if the endianness of the image buffer must be inverted. |
CImg<T>& load_ffmpeg | ( | const char *const | filename, |
const unsigned int | first_frame = 0 , |
||
const unsigned int | last_frame = ~0U , |
||
const unsigned int | step_frame = 1 , |
||
const bool | pixel_format = true , |
||
const bool | resume = false , |
||
const char | axis = 'z' , |
||
const float | align = 0 |
||
) |
Load image sequence using FFMPEG av's libraries.
filename | Filename, as a C-string. |
first_frame | Index of the first frame to read. |
last_frame | Index of the last frame to read. |
step_frame | Step value for frame reading. |
pixel_format | To be documented. |
resume | To be documented. |
axis | Appending axis, if file contains multiple images. Can be { 'x' | 'y' | 'z' | 'c' } . |
align | Appending alignment. |
CImg<T>& load_yuv | ( | const char *const | filename, |
const unsigned int | size_x, | ||
const unsigned int | size_y = 1 , |
||
const unsigned int | first_frame = 0 , |
||
const unsigned int | last_frame = ~0U , |
||
const unsigned int | step_frame = 1 , |
||
const bool | yuv2rgb = true , |
||
const char | axis = 'z' |
||
) |
Load image sequence from a YUV file.
filename | Filename, as a C-string. |
size_x | Width of the frames. |
size_y | Height of the frames. |
first_frame | Index of the first frame to read. |
last_frame | Index of the last frame to read. |
step_frame | Step value for frame reading. |
yuv2rgb | Tells if the YUV to RGB transform must be applied. |
axis | Appending axis, if file contains multiple images. Can be { 'x' | 'y' | 'z' | 'c' } . |
CImg<T>& load_off | ( | CImgList< tf > & | primitives, |
CImgList< tc > & | colors, | ||
const char *const | filename | ||
) |
Load 3d object from a .OFF file.
[out] | primitives | Primitives data of the 3d object. |
[out] | colors | Colors data of the 3d object. |
filename | Filename, as a C-string. |
CImg<T>& load_ffmpeg_external | ( | const char *const | filename, |
const char | axis = 'z' , |
||
const float | align = 0 |
||
) |
Load image sequence using FFMPEG's external tool 'ffmpeg'.
filename | Filename, as a C-string. |
axis | Appending axis, if file contains multiple images. Can be { 'x' | 'y' | 'z' | 'c' } . |
align | Appending alignment. |
CImg<T>& load_graphicsmagick_external | ( | const char *const | filename | ) |
Load image using GraphicsMagick's external tool 'gm'.
filename | Filename, as a C-string. |
CImg<T>& load_gzip_external | ( | const char *const | filename | ) |
Load gzipped image file, using external tool 'gunzip'.
filename | Filename, as a C-string. |
CImg<T>& load_imagemagick_external | ( | const char *const | filename | ) |
Load image using ImageMagick's external tool 'convert'.
filename | Filename, as a C-string. |
CImg<T>& load_medcon_external | ( | const char *const | filename | ) |
Load image from a DICOM file, using XMedcon's external tool 'medcon'.
filename | Filename, as a C-string. |
CImg<T>& load_dcraw_external | ( | const char *const | filename | ) |
Load image from a RAW Color Camera file, using external tool 'dcraw'.
filename | Filename, as a C-string. |
CImg<T>& load_camera | ( | const int | camera_index = -1 , |
const unsigned int | skip_frames = 0 , |
||
const bool | release_camera = false |
||
) |
Load image from a camera stream, using OpenCV.
camera_index | Index of the camera to capture images from. |
skip_frames | Number of frames to skip before the capture. |
release_camera | Tells if the camera ressource must be released at the end of the method. |
CImg<T>& load_other | ( | const char *const | filename | ) |
Load image using various non-native ways.
filename | Filename, as a C-string. |
Display informations about the image data on the standard error output.
title | Name for the considered image. |
display_stats | Tells to compute and display image statistics. |
const CImg<T>& display | ( | CImgDisplay & | disp | ) | const |
Display image into a CImgDisplay window.
disp | Display window. |
const CImg<T>& display | ( | CImgDisplay & | disp, |
const bool | display_info, | ||
unsigned int *const | XYZ = 0 |
||
) | const |
Display image into a CImgDisplay window, in an interactive way.
disp | Display window. |
display_info | Tells if image informations are displayed on the standard output. |
const CImg<T>& display | ( | const char *const | title = 0 , |
const bool | display_info = true , |
||
unsigned int *const | XYZ = 0 |
||
) | const |
Display image into an interactive window.
title | Window title |
display_info | Tells if image informations are displayed on the standard output. |
const CImg<T>& display_object3d | ( | CImgDisplay & | disp, |
const CImg< tp > & | vertices, | ||
const CImgList< tf > & | primitives, | ||
const CImgList< tc > & | colors, | ||
const to & | opacities, | ||
const bool | centering = true , |
||
const int | render_static = 4 , |
||
const int | render_motion = 1 , |
||
const bool | is_double_sided = true , |
||
const float | focale = 500 , |
||
const float | light_x = 0 , |
||
const float | light_y = 0 , |
||
const float | light_z = -5000 , |
||
const float | specular_lightness = 0.2f , |
||
const float | specular_shininess = 0.1f , |
||
const bool | display_axes = true , |
||
float *const | pose_matrix = 0 |
||
) | const |
Display object 3d in an interactive window.
disp | Display window. |
vertices | Vertices data of the 3d object. |
primitives | Primitives data of the 3d object. |
colors | Colors data of the 3d object. |
opacities | Opacities data of the 3d object. |
centering | Tells if the 3d object must be centered for the display. |
render_static | Rendering mode. |
render_motion | Rendering mode, when the 3d object is moved. |
is_double_sided | Tells if the object primitives are double-sided. |
focale | Focale |
light_x | X-coordinate of the light source. |
light_y | Y-coordinate of the light source. |
light_z | Z-coordinate of the light source. |
specular_lightness | Amount of specular light. |
specular_shininess | Shininess of the object material. |
display_axes | Tells if the 3d axes are displayed. |
pose_matrix | Pointer to 12 values, defining a 3d pose (as a 4x3 matrix). |
const CImg<T>& display_graph | ( | CImgDisplay & | disp, |
const unsigned int | plot_type = 1 , |
||
const unsigned int | vertex_type = 1 , |
||
const char *const | labelx = 0 , |
||
const double | xmin = 0 , |
||
const double | xmax = 0 , |
||
const char *const | labely = 0 , |
||
const double | ymin = 0 , |
||
const double | ymax = 0 |
||
) | const |
Display 1d graph in an interactive window.
disp | Display window. |
plot_type | Plot type. Can be { 0=points | 1=segments | 2=splines | 3=bars } . |
vertex_type | Vertex type. |
labelx | Title for the horizontal axis, as a C-string. |
xmin | Minimum value along the X-axis. |
xmax | Maximum value along the X-axis. |
labely | Title for the vertical axis, as a C-string. |
ymin | Minimum value along the X-axis. |
ymax | Maximum value along the X-axis. |
Save image as a file.
filename | Filename, as a C-string. |
number | When positive, represents an index added to the filename. |
filename
.number
can be used to add a 6-digit number to the filename before saving. const CImg<T>& save_ascii | ( | const char *const | filename | ) | const |
Save image as an ascii file.
filename | Filename, as a C-string. |
Save image as a .cpp source file.
filename | Filename, as a C-string. |
Save image as a DLM file.
filename | Filename, as a C-string. |
Save image as a BMP file.
filename | Filename, as a C-string. |
Save image as a JPEG file.
filename | Filename, as a C-string. |
quality | Image quality (in %) |
const CImg<T>& save_magick | ( | const char *const | filename, |
const unsigned int | bytes_per_pixel = 0 |
||
) | const |
Save image, using built-in ImageMagick++ library.
filename | Filename, as a C-string. |
bytes_per_pixel | Force the number of bytes per pixel for the saving, when possible. |
const CImg<T>& save_png | ( | const char *const | filename, |
const unsigned int | bytes_per_pixel = 0 |
||
) | const |
Save image as a PNG file.
filename | Filename, as a C-string. |
bytes_per_pixel | Force the number of bytes per pixels for the saving, when possible. |
const CImg<T>& save_pnm | ( | const char *const | filename, |
const unsigned int | bytes_per_pixel = 0 |
||
) | const |
Save image as a PNM file.
filename | Filename, as a C-string. |
bytes_per_pixel | Force the number of bytes per pixels for the saving. |
Save image as a PNK file.
filename | Filename, as a C-string. |
Save image as a PFM file.
filename | Filename, as a C-string. |
Save image as a RGB file.
filename | Filename, as a C-string. |
Save image as a RGBA file.
filename | Filename, as a C-string. |
const CImg<T>& save_tiff | ( | const char *const | filename, |
const unsigned int | compression_type = 0 |
||
) | const |
Save image as a TIFF file.
filename | Filename, as a C-string. |
compression_type | Type of data compression. Can be { 1=None | 2=CCITTRLE | 3=CCITTFAX3 | 4=CCITTFAX4 | 5=LZW | 6=JPEG } . |
cimg_use_tif
.char,uchar,short,ushort,float
and double
pixel types.cimg_use_tif
is not defined at compilation time the function uses CImg<T>&save_other(const char*). const CImg<T>& save_minc2 | ( | const char *const | filename, |
const char *const | imitate_file = 0 |
||
) | const |
Save image as a MINC2 file.
filename | Filename, as a C-string. |
imitate_file | If non-zero, reference filename, as a C-string, to borrow header from. |
const CImg<T>& save_analyze | ( | const char *const | filename, |
const float *const | voxel_size = 0 |
||
) | const |
Save image as an ANALYZE7.5 or NIFTI file.
filename | Filename, as a C-string. |
voxel_size | Pointer to 3 consecutive values that tell about the voxel sizes along the X,Y and Z dimensions. |
Save image as a .cimg file.
filename | Filename, as a C-string. |
is_compressed | Tells if the file contains compressed image data. |
const CImg<T>& save_cimg | ( | const char *const | filename, |
const unsigned int | n0, | ||
const unsigned int | x0, | ||
const unsigned int | y0, | ||
const unsigned int | z0, | ||
const unsigned int | c0 | ||
) | const |
Save image as a sub-image into an existing .cimg file.
filename | Filename, as a C-string. |
n0 | Index of the image inside the file. |
x0 | X-coordinate of the sub-image location. |
y0 | Y-coordinate of the sub-image location. |
z0 | Z-coordinate of the sub-image location. |
c0 | C-coordinate of the sub-image location. |
static void save_empty_cimg | ( | const char *const | filename, |
const unsigned int | dx, | ||
const unsigned int | dy = 1 , |
||
const unsigned int | dz = 1 , |
||
const unsigned int | dc = 1 |
||
) | [static] |
Save blank image as a .cimg file.
filename | Filename, as a C-string. |
dx | Width of the image. |
dy | Height of the image. |
dz | Depth of the image. |
dc | Number of channels of the image. |
0
.static void save_empty_cimg | ( | std::FILE *const | file, |
const unsigned int | dx, | ||
const unsigned int | dy = 1 , |
||
const unsigned int | dz = 1 , |
||
const unsigned int | dc = 1 |
||
) | [static] |
Save blank image as a .cimg file [overloading].
Same as save_empty_cimg(const char *,unsigned int,unsigned int,unsigned int,unsigned int) with a file stream argument instead of a filename string.
Save image as an INRIMAGE-4 file.
filename | Filename, as a C-string. |
voxel_size | Pointer to 3 values specifying the voxel sizes along the X,Y and Z dimensions. |
Save image as an OpenEXR file.
filename | Filename, as a C-string. |
const CImg<T>& save_pandore | ( | const char *const | filename, |
const unsigned int | colorspace = 0 |
||
) | const |
Save image as a Pandore-5 file.
filename | Filename, as a C-string. |
colorspace | Colorspace data field in output file (see Pandore file specifications for more informations). |
const CImg<T>& save_pandore | ( | std::FILE *const | file, |
const unsigned int | colorspace = 0 |
||
) | const |
Save image as a Pandore-5 file [overloading].
Same as save_pandore(const char *,unsigned int) const with a file stream argument instead of a filename string.
Save image as a raw data file.
filename | Filename, as a C-string. |
is_multiplexed | Tells if the image channels are stored in a multiplexed way (true ) or not (false ). |
Save image as a raw data file [overloading].
Same as save_raw(const char *,bool) const with a file stream argument instead of a filename string.
const CImg<T>& save_ffmpeg | ( | const char *const | filename, |
const unsigned int | fps = 25 , |
||
const unsigned int | bitrate = 2048 |
||
) | const |
Save image as a video file, using the FFmpeg library.
filename | Filename, as a C-string. |
fps | Video framerate. |
bitrate | Video bitrate. |
cimg_use_ffmpeg
must be set for the method to succeed natively. Otherwise, the method calls save_ffmpeg_external(const char*,unsigned int,unsigned int,const char*,unsigned int,unsigned int) const. Save image as a .yuv video file.
filename | Filename, as a C-string. |
is_rgb | Tells if pixel values of the instance image are RGB-coded (true ) or YUV-coded (false ). |
Save image as a .yuv video file [overloading].
Same as save_yuv(const char*,bool) const with a file stream argument instead of a filename string.
const CImg<T>& save_off | ( | const CImgList< tf > & | primitives, |
const CImgList< tc > & | colors, | ||
const char *const | filename | ||
) | const |
Save 3d object as an Object File Format (.off) file.
filename | Filename, as a C-string. |
primitives | List of 3d object primitives. |
colors | List of 3d object colors. |
const CImg<T>& save_off | ( | const CImgList< tf > & | primitives, |
const CImgList< tc > & | colors, | ||
std::FILE *const | file | ||
) | const |
Save 3d object as an Object File Format (.off) file [overloading].
Same as save_off(const CImgList<tf>&,const CImgList<tc>&,const char*) const with a file stream argument instead of a filename string.
const CImg<T>& save_ffmpeg_external | ( | const char *const | filename, |
const char *const | codec = 0 , |
||
const unsigned int | fps = 25 , |
||
const unsigned int | bitrate = 2048 |
||
) | const |
Save volumetric image as a video, using ffmpeg external binary.
filename | Filename, as a C-string. |
codec | Video codec, as a C-string. |
fps | Video framerate. |
bitrate | Video bitrate. |
ffmpeg
, an external executable binary provided by FFmpeg. It must be installed for the method to succeed. const CImg<T>& save_gzip_external | ( | const char *const | filename | ) | const |
Save image using gzip external binary.
filename | Filename, as a C-string. |
gzip
, an external executable binary provided by gzip. It must be installed for the method to succeed. const CImg<T>& save_graphicsmagick_external | ( | const char *const | filename, |
const unsigned int | quality = 100 |
||
) | const |
Save image using GraphicsMagick's external binary.
filename | Filename, as a C-string. |
quality | Image quality (expressed in percent), when the file format supports it. |
gm
, an external executable binary provided by GraphicsMagick. It must be installed for the method to succeed. const CImg<T>& save_imagemagick_external | ( | const char *const | filename, |
const unsigned int | quality = 100 |
||
) | const |
Save image using ImageMagick's external binary.
filename | Filename, as a C-string. |
quality | Image quality (expressed in percent), when the file format supports it. |
convert
, an external executable binary provided by ImageMagick. It must be installed for the method to succeed. const CImg<T>& save_medcon_external | ( | const char *const | filename | ) | const |
Save image as a Dicom file.
filename | Filename, as a C-string. |
medcon
, an external executable binary provided by (X)Medcon. It must be installed for the method to succeed. const CImg<T>& save_other | ( | const char *const | filename, |
const unsigned int | quality = 100 |
||
) | const |
filename | Filename, as a C-string. |
quality | Image quality (expressed in percent), when the file format supports it. |