C++ Template Image Processing Library.    

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

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

cimg_library::cimg Namespace Reference

The cimg:: namespace encompasses low-level functions and variables of the CImg Library. More...


Functions

template<typename t>
const t get_type_min (const t &)
 Return an approximation of the minimum value of a type (necessary because of buggy <limits> on VC 6.0).
template<typename t>
const t get_type_max (const t &)
 Return an approximation of the maximum value of a type (necessary because of buggy <limits> on VC 6.0).
const char * convert_path ()
 Return the path of the ImageMagick's convert tool.
const char * temporary_path ()
 Return a path to store temporary files.
const bool endian ()
 Return false for little endian CPUs (Intel), true for big endian CPUs (Motorola).
void info ()
 Display informations about CImg compilation variables, on the standart error output stderr.
long time ()
 Get the value of a system timer with a millisecond precision.
void sleep (const int milliseconds)
 Sleep for a certain numbers of milliseconds.
long wait (const int milliseconds=20, long reference_time=-1)
 Wait for a certain number of milliseconds since the last call of wait().
template<typename T>
const T rol (const T &a, const unsigned int n=1)
 Bitwise rotation on the left.
template<typename T>
const T ror (const T &a, const unsigned int n=1)
 Bitwise rotation on the right.
template<typename T>
const T abs (const T &a)
 Return the absolute value of a.
template<typename T>
const T & min (const T &a, const T &b)
 Return the minimum between a and b.
template<typename T>
const T & min (const T &a, const T &b, const T &c)
 Return the minimum between a,b and c.
template<typename T>
const T & min (const T &a, const T &b, const T &c, const T &d)
 Return the minimum between a,b,c and d.
template<typename T>
const T & max (const T &a, const T &b)
 Return the maximum between a and b.
template<typename T>
const T & max (const T &a, const T &b, const T &c)
 Return the maximum between a,b and c.
template<typename T>
const T & max (const T &a, const T &b, const T &c, const T &d)
 Return the maximum between a,b,c and d.
template<typename T>
char sign (const T &x)
 Return the sign of x.
double mod (const double &x, const double &m)
 Return x modulo m (generic modulo).
template<typename T>
minmod (const T &a, const T &b)
 Return minmod(a,b).
double rand ()
 Return a random variable between [0,1] (uniform distribution).
double crand ()
 Return a random variable between [-1,1] (uniform distribution).
double grand ()
 Return a random variable using a gaussian distribution and a standart deviation of 1.
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)
 Display a dialog box, where a user can click standart buttons.

Variables

const double PI = 3.14159265358979323846
 Definition of the mathematical constant PI.


Detailed Description

The cimg:: namespace encompasses low-level functions and variables of the CImg Library.

Most of the functions and variables within this namespace are used by the library for low-level purposes. Nevertheless, documented variables and functions below may be used by the user in its own source code.

Warning:
Never write "using namespace cimg_library::cimg;" in your source, since a lot of functions of the cimg:: namespace have the same name than standart C functions defined in the global namespace ::.
See also:
CImg, CImgl, CImgDisplay, CImgStats and CImgException.


Function Documentation

const char* convert_path  ) 
 

Return the path of the ImageMagick's convert tool.

If you have installed the ImageMagick package in a standart directory, this function returns the correct path of the convert tool used 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_convert_path with the correct path of the convert executable, before including "CImg.h" in your program :

       #define cimg_convert_path "/users/thatsme/local/bin/convert"
       #include "CImg.h"
       
       int main() {
         CImg<> img("my_image.jpg");
         return 0;
       }
Note:
convert is needed to read and write compressed image formats. Other formats do not need convert.
See also:
temporary_path, CImg::load_convert, CImg::save_convert.

Definition at line 1183 of file CImg.h.

const char* temporary_path  ) 
 

Return a path to store temporary files.

If you are running on a standart Unix or Windows system, this function should return a correct path where temporary files can be stored. If the path is not auto-detected, you need to define the macro cimg_temporary_path, before including "CImg.h" in your program :

       #define cimg_temporary_path "/users/toto/tmp"
       #include "CImg.h"

       int main() {
         CImg<> img("my_image.jpg");
         return 0;
       }
Note:
A temporary path is necessary to load and save compressed image formats, using convert.
See also:
convert_path, CImg::load_convert, CImg::save_convert.

Definition at line 1230 of file CImg.h.

void sleep const int  milliseconds  ) 
 

Sleep for a certain numbers of milliseconds.

This function frees the CPU ressources during the sleeping time. May be used to temporize your program properly, without wasting CPU time.

See also:
wait, time.

Definition at line 1449 of file CImg.h.

long wait const int  milliseconds = 20,
long  reference_time = -1
 

Wait for a certain number of milliseconds since the last call of wait().

If the desired delay has expired, this function returns immediately else it sleeps till the correct time. May be used to temporize your program properly.

See also:
sleep, time.

Definition at line 1466 of file CImg.h.

double mod const double &  x,
const double &  m
 

Return x modulo m (generic modulo).

This modulo function accepts negative and floating-points modulo numbers m.

Definition at line 1516 of file CImg.h.

T minmod const T &  a,
const T &  b
 

Return minmod(a,b).

The operator minmod(a,b) is defined to be :

  • minmod(a,b) = min(a,b), if (a * b)>0.
  • minmod(a,b) = 0, if (a * b)<=0

Definition at line 1526 of file CImg.h.

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
[static]
 

Display a dialog box, where a user can click standart 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.

Parameters:
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.
Returns:
The button number (from 0 to 5), or -1 if the dialog window has been closed by the user.
Note:
If a button text is set to NULL, then the corresponding button (and the followings) won't appear in the dialog box. At least one button is necessary.

Definition at line 10822 of file CImg.h.


Generated on Mon Jul 4 09:51:37 2005 for The CImg Library by  doxygen 1.3.9