![]()
|
Functions | |
void | info () |
Print informations about CImg environement variables. | |
template<typename tfunc, typename tp, typename tf> | |
void | marching_cubes (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 float resx, const float resy, const float resz, CImgList< tp > &points, CImgList< tf > &primitives, const bool invert_faces) |
Polygonize an implicit function. | |
template<typename tfunc, typename tp, typename tf> | |
void | marching_squares (const tfunc &func, const float isovalue, const float x0, const float y0, const float x1, const float y1, const float resx, const float resy, CImgList< tp > &points, CImgList< tf > &primitives) |
Polygonize an implicit 2D function by the marching squares algorithm. | |
bool | endian () |
Return false for little endian CPUs (Intel), true for big endian CPUs (Motorola). | |
unsigned long | time () |
Get the value of a system timer with a millisecond precision. | |
void | sleep (const unsigned int milliseconds) |
Sleep for a certain numbers of milliseconds. | |
unsigned int | wait (const unsigned int milliseconds) |
Wait for a certain number of milliseconds since the last call. | |
const char * | imagemagick_path () |
Return path of the ImageMagick's convert tool. | |
const char * | graphicsmagick_path () |
Return path of the GraphicsMagick's gm tool. | |
const char * | medcon_path () |
Return path of the XMedcon tool. | |
const char * | temporary_path () |
Return path to store temporary files. | |
template<typename T> | |
T | abs (const T a) |
Return the absolute value of a . | |
template<typename t1, typename t2> | |
cimg::superset< t1, t2 >::type | min (const t1 &a, const t2 &b) |
Return the minimum between a and b . | |
template<typename t1, typename t2, typename t3> | |
cimg::superset2< t1, t2, t3 >::type | min (const t1 &a, const t2 &b, const t3 &c) |
Return the minimum between a ,b and c. | |
template<typename t1, typename t2, typename t3, typename t4> | |
cimg::superset3< t1, t2, t3, t4 >::type | min (const t1 &a, const t2 &b, const t3 &c, const t4 &d) |
Return the minimum between a ,b ,c and d . | |
template<typename t1, typename t2> | |
cimg::superset< t1, t2 >::type | max (const t1 &a, const t2 &b) |
Return the maximum between a and b . | |
template<typename t1, typename t2, typename t3> | |
cimg::superset2< t1, t2, t3 >::type | max (const t1 &a, const t2 &b, const t3 &c) |
Return the maximum between a ,b and c . | |
template<typename t1, typename t2, typename t3, typename t4> | |
cimg::superset3< t1, t2, t3, t4 >::type | max (const t1 &a, const t2 &b, const t3 &c, const t4 &d) |
Return the maximum between a ,b ,c and d . | |
template<typename T> | |
T | sign (const T x) |
Return the sign of x . | |
template<typename T> | |
unsigned long | nearest_pow2 (const T x) |
Return the nearest power of 2 higher than x . | |
template<typename T> | |
T | mod (const T &x, const T &m) |
Return x modulo m (generic modulo). | |
template<typename T> | |
T | minmod (const T a, const T b) |
Return minmod(a ,b ). | |
double | rand () |
Return a random variable between [0,1], followin a uniform distribution. | |
double | crand () |
Return a random variable between [-1,1], following a uniform distribution. | |
double | grand () |
Return a random variable following a gaussian distribution and a standard deviation of 1. | |
double | round (const double x, const double y, const unsigned int round_type=0) |
Return a rounded number. | |
template<typename t> | |
int | dialog (const char *title, const char *msg, const char *button1_txt, const char *button2_txt, const char *button3_txt, const char *button4_txt, const char *button5_txt, const char *button6_txt, const CImg< t > &logo, const bool centering=false) |
Display a dialog box, where a user can click standard buttons. | |
Variables | |
const double | valuePI = 3.14159265358979323846 |
Definition of the mathematical constant PI. |
Most of the functions and variables within this namespace are used by the library for low-level processing. Nevertheless, documented variables and functions of this namespace may be used safely in your own source code.
using namespace cimg_library::cimg;
in your source code, since a lot of functions of the cimg::
namespace have prototypes similar to standard C functions defined in the global namespace ::
. void info | ( | ) |
Print informations about CImg environement variables.
Printing is done on the standard error output.
void cimg_library::cimg::sleep | ( | const unsigned int | milliseconds | ) |
Sleep for a certain numbers of milliseconds.
This function frees the CPU ressources during the sleeping time. It may be used to temporize your program properly, without wasting CPU time.
unsigned int cimg_library::cimg::wait | ( | const unsigned int | milliseconds | ) |
const char* cimg_library::cimg::imagemagick_path | ( | ) |
Return path of the ImageMagick's convert
tool.
This function is used internally in imagemagick_path, graphicsmagick_path and medcon_path on Windows platforms If you have installed the ImageMagick package in a standard directory, this function should return the correct path of the convert
tool used by the CImg Library to load and save compressed image formats. Conversely, if the convert
executable is not auto-detected by the function, you can define the macro cimg_imagemagick_path
with the correct path of the convert
executable, before including CImg.h
in your program :
#define cimg_imagemagick_path "/users/thatsme/local/bin/convert" #include "CImg.h" int main() { CImg<> img("my_image.jpg"); // Read a JPEG image file. return 0; }
Note that non compressed image formats can be read without installing ImageMagick.
const char* cimg_library::cimg::graphicsmagick_path | ( | ) |
Return path of the GraphicsMagick's gm
tool.
If you have installed the GraphicsMagick package in a standard directory, this function should return the correct path of the gm
tool used by the CImg Library to load and save compressed image formats. Conversely, if the gm
executable is not auto-detected by the function, you can define the macro cimg_graphicsmagick_path
with the correct path of the gm
executable, before including CImg.h
in your program :
#define cimg_graphicsmagick_path "/users/thatsme/local/bin/gm" #include "CImg.h" int main() { CImg<> img("my_image.jpg"); // Read a JPEG image file. return 0; }
Note that non compressed image formats can be read without installing ImageMagick.
const char* cimg_library::cimg::medcon_path | ( | ) |
Return path of the XMedcon
tool.
If you have installed the XMedcon package in a standard directory, this function should return the correct path of the medcon
tool used by the CIg Library to load DICOM image formats. Conversely, if the medcon
executable is not auto-detected by the function, you can define the macro cimg_medcon_path
with the correct path of the medcon
executable, before including CImg.h
in your program :
#define cimg_medcon_path "/users/thatsme/local/bin/medcon" #include "CImg.h" int main() { CImg<> img("my_image.dcm"); // Read a DICOM image file. return 0; }
Note that medcon
is only needed if you want to read DICOM image formats.
const char* cimg_library::cimg::temporary_path | ( | ) |
Return path to store temporary files.
If you are running on a standard Unix or Windows system, this function should return a correct path where temporary files can be stored. If such a path is not auto-detected by this function, you can define the macro cimg_temporary_path
with a correct path, before including CImg.h
in your program :
#define cimg_temporary_path "/users/thatsme/tmp" #include "CImg.h" int main() { CImg<> img("my_image.jpg"); // Read a JPEG image file (using the defined temporay path). return 0; }
A temporary path is necessary to load and save compressed image formats, using convert
or medcon
.
T cimg_library::cimg::mod | ( | const T & | x, | |
const T & | m | |||
) |
Return x
modulo m
(generic modulo).
This modulo function accepts negative and floating-points modulo numbers m
.
T cimg_library::cimg::minmod | ( | const T | a, | |
const T | b | |||
) |
Return minmod(a
,b
).
The operator minmod(a
,b
) is defined to be :
a
,b
) = min(a
,b
), if (a
* b
)>0.a
,b
) = 0, if (a
* b
)<=0 int cimg_library::cimg::dialog | ( | const char * | title, | |
const char * | msg, | |||
const char * | button1_txt, | |||
const char * | button2_txt, | |||
const char * | button3_txt, | |||
const char * | button4_txt, | |||
const char * | button5_txt, | |||
const char * | button6_txt, | |||
const CImg< t > & | logo, | |||
const bool | centering = false | |||
) |
Display a dialog box, where a user can click standard buttons.
Up to 6 buttons can be defined in the dialog window. This function returns when a user clicked one of the button or closed the dialog window.
title | = Title of the dialog window. | |
msg | = Main message displayed inside the dialog window. | |
button1_txt | = Label of the 1st button. | |
button2_txt | = Label of the 2nd button. | |
button3_txt | = Label of the 3rd button. | |
button4_txt | = Label of the 4th button. | |
button5_txt | = Label of the 5th button. | |
button6_txt | = Label of the 6th button. | |
logo | = Logo image displayed at the left of the main message. This parameter is optional. | |
centering | = Tell to center the dialog window on the screen. |