cimg_library::cimg Namespace Reference

Namespace that encompasses low-level functions and variables of the CImg Library. More...

Classes

struct  type
struct  type< bool >
struct  type< unsigned char >
struct  type< char >
struct  type< signed char >
struct  type< unsigned short >
struct  type< short >
struct  type< unsigned int >
struct  type< int >
struct  type< unsigned long >
struct  type< long >
struct  type< double >
struct  type< float >
struct  superset
struct  superset< bool, unsigned char >
struct  superset< bool, char >
struct  superset< bool, signed char >
struct  superset< bool, unsigned short >
struct  superset< bool, short >
struct  superset< bool, unsigned int >
struct  superset< bool, int >
struct  superset< bool, unsigned long >
struct  superset< bool, long >
struct  superset< bool, float >
struct  superset< bool, double >
struct  superset< unsigned char, char >
struct  superset< unsigned char, signed char >
struct  superset< unsigned char, unsigned short >
struct  superset< unsigned char, short >
struct  superset< unsigned char, unsigned int >
struct  superset< unsigned char, int >
struct  superset< unsigned char, unsigned long >
struct  superset< unsigned char, long >
struct  superset< unsigned char, float >
struct  superset< unsigned char, double >
struct  superset< signed char, unsigned char >
struct  superset< signed char, char >
struct  superset< signed char, unsigned short >
struct  superset< signed char, short >
struct  superset< signed char, unsigned int >
struct  superset< signed char, int >
struct  superset< signed char, unsigned long >
struct  superset< signed char, long >
struct  superset< signed char, float >
struct  superset< signed char, double >
struct  superset< char, unsigned char >
struct  superset< char, signed char >
struct  superset< char, unsigned short >
struct  superset< char, short >
struct  superset< char, unsigned int >
struct  superset< char, int >
struct  superset< char, unsigned long >
struct  superset< char, long >
struct  superset< char, float >
struct  superset< char, double >
struct  superset< unsigned short, char >
struct  superset< unsigned short, signed char >
struct  superset< unsigned short, short >
struct  superset< unsigned short, unsigned int >
struct  superset< unsigned short, int >
struct  superset< unsigned short, unsigned long >
struct  superset< unsigned short, long >
struct  superset< unsigned short, float >
struct  superset< unsigned short, double >
struct  superset< short, unsigned short >
struct  superset< short, unsigned int >
struct  superset< short, int >
struct  superset< short, unsigned long >
struct  superset< short, long >
struct  superset< short, float >
struct  superset< short, double >
struct  superset< unsigned int, char >
struct  superset< unsigned int, signed char >
struct  superset< unsigned int, short >
struct  superset< unsigned int, int >
struct  superset< unsigned int, unsigned long >
struct  superset< unsigned int, long >
struct  superset< unsigned int, float >
struct  superset< unsigned int, double >
struct  superset< int, unsigned int >
struct  superset< int, unsigned long >
struct  superset< int, long >
struct  superset< int, float >
struct  superset< int, double >
struct  superset< unsigned long, char >
struct  superset< unsigned long, signed char >
struct  superset< unsigned long, short >
struct  superset< unsigned long, int >
struct  superset< unsigned long, long >
struct  superset< unsigned long, float >
struct  superset< unsigned long, double >
struct  superset< long, float >
struct  superset< long, double >
struct  superset< float, double >
struct  superset2
struct  superset3
struct  last

Functions

std::FILE * output (std::FILE *file)
 Set/get output stream for CImg library messages.
void info ()
 Print informations about CImg environement variables.
template<typename T >
void unused (const T &,...)
unsigned int & _exception_mode (const unsigned int value, const bool is_set)
 Get/set the current CImg exception mode.
unsigned int & exception_mode ()
unsigned int & exception_mode (const unsigned int mode)
int dialog (const char *const title, const char *const msg, const char *const button1_label="OK", const char *const button2_label=0, const char *const button3_label=0, const char *const button4_label=0, const char *const button5_label=0, const char *const button6_label=0, const bool centering=false)
double eval (const char *const expression, const double x=0, const double y=0, const double z=0, const double v=0)
 Evaluate math expression.
void warn (const char *const format,...)
 Display a warning message.
int system (const char *const command, const char *const module_name=0)
template<typename T >
T & temporary (const T &)
 Return a reference to a temporary variable of type T.
template<typename T >
void swap (T &a, T &b)
 Exchange values of variables a and b.
template<typename T1 , typename T2 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2)
 Exchange values of variables (a1,a2) and (b1,b2).
template<typename T1 , typename T2 , typename T3 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3)
 Exchange values of variables (a1,a2,a3) and (b1,b2,b3).
template<typename T1 , typename T2 , typename T3 , typename T4 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3, T4 &a4, T4 &b4)
 Exchange values of variables (a1,a2,...,a4) and (b1,b2,...,b4).
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3, T4 &a4, T4 &b4, T5 &a5, T5 &b5)
 Exchange values of variables (a1,a2,...,a5) and (b1,b2,...,b5).
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3, T4 &a4, T4 &b4, T5 &a5, T5 &b5, T6 &a6, T6 &b6)
 Exchange values of variables (a1,a2,...,a6) and (b1,b2,...,b6).
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3, T4 &a4, T4 &b4, T5 &a5, T5 &b5, T6 &a6, T6 &b6, T7 &a7, T7 &b7)
 Exchange values of variables (a1,a2,...,a7) and (b1,b2,...,b7).
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3, T4 &a4, T4 &b4, T5 &a5, T5 &b5, T6 &a6, T6 &b6, T7 &a7, T7 &b7, T8 &a8, T8 &b8)
 Exchange values of variables (a1,a2,...,a8) and (b1,b2,...,b8).
bool endianness ()
 Return the current endianness of the CPU.
template<typename T >
void invert_endianness (T *const buffer, const unsigned int size)
 Invert endianness of a memory buffer.
template<typename T >
T & invert_endianness (T &a)
 Invert endianness of a single variable.
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 _sleep (const unsigned int milliseconds, unsigned long &timer)
unsigned int wait (const unsigned int milliseconds)
 Wait for a certain number of milliseconds since the last call.
void srand ()
template<typename T >
rol (const T a, const unsigned int n=1)
 Return a left bitwise-rotated number.
float rol (const float a, const unsigned int n=1)
double rol (const double a, const unsigned int n=1)
template<typename T >
ror (const T a, const unsigned int n=1)
 Return a right bitwise-rotated number.
float ror (const float a, const unsigned int n=1)
double ror (const double a, const unsigned int n=1)
template<typename T >
abs (const T a)
 Return the absolute value of a number.
bool abs (const bool a)
unsigned char abs (const unsigned char a)
unsigned short abs (const unsigned short a)
unsigned int abs (const unsigned int a)
unsigned long abs (const unsigned long a)
double abs (const double a)
float abs (const float a)
int abs (const int a)
template<typename T >
sqr (const T val)
 Return the square of a number.
int xln (const int x)
 Return 1 + log_10(x).
template<typename t1 , typename t2 >
cimg::superset< t1, t2 >::type min (const t1 &a, const t2 &b)
 Return the minimum value between two numbers.
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 value between three numbers.
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 value between four numbers.
template<typename t1 , typename t2 >
cimg::superset< t1, t2 >::type max (const t1 &a, const t2 &b)
 Return the maximum value between two numbers.
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 value between three numbers.
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 value between four numbers.
template<typename T >
sign (const T x)
 Return the sign of a number.
template<typename T >
unsigned int nearest_pow2 (const T x)
 Return the nearest power of 2 higher than a given number.
double sinc (const double x)
 Return the sinc() of a given number.
template<typename T >
mod (const T &x, const T &m)
 Return the modulo of a number.
int mod (const bool x, const bool m)
int mod (const char x, const char m)
int mod (const short x, const short m)
int mod (const int x, const int m)
int mod (const long x, const long m)
int mod (const unsigned char x, const unsigned char m)
int mod (const unsigned short x, const unsigned short m)
int mod (const unsigned int x, const unsigned int m)
int mod (const unsigned long x, const unsigned long m)
template<typename T >
minmod (const T a, const T b)
 Return the minmod of two numbers.
double rand ()
 Return a random variable between [0,1] with respect to an uniform distribution.
double crand ()
 Return a random variable between [-1,1] with respect to an uniform distribution.
double grand ()
 Return a random variable following a gaussian distribution and a standard deviation of 1.
unsigned int prand (const double z)
 Return a random variable following a Poisson distribution of parameter z.
double round (const double x, const double y, const int rounding_type=0)
 Return a rounded number.
double _pythagore (double a, double b)
char uncase (const char x)
 Remove the 'case' of an ASCII character.
void uncase (char *const string)
 Remove the 'case' of a C string.
double atof (const char *const str)
 Read a double number from a C-string.
int strncasecmp (const char *const s1, const char *const s2, const int l)
 Compare the first n characters of two C-strings, ignoring the case.
int strcasecmp (const char *const s1, const char *const s2)
 Compare two C-strings, ignoring the case.
bool strpare (char *const s, const char delimiter=' ', const bool symmetric=false, const bool is_iterative=false)
 Remove useless delimiters on the borders of a C-string.
void strescape (char *const s)
 Replace explicit escape sequences '' in C-strings.
const char * basename (const char *const s)
 Compute the basename of a filename.
const char * filenamerand ()
void winformat_string (char *const s)
const char * temporary_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to store temporary files.
const char * imagemagick_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the ImageMagick's convert tool.
const char * graphicsmagick_path (const char *const user_path=0, const bool reinit_path=false)
 Return path of the GraphicsMagick's gm tool.
const char * medcon_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path of the XMedcon tool.
const char * ffmpeg_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'ffmpeg' command.
const char * gzip_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'gzip' command.
const char * gunzip_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'gunzip' command.
const char * dcraw_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'dcraw' command.
const char * split_filename (const char *const filename, char *const body=0)
 Split a filename into two strings 'body' and 'extension'.
char * number_filename (const char *const filename, const int number, const unsigned int n, char *const string)
 Create a numbered version of a filename.
std::FILE * fopen (const char *const path, const char *const mode)
 Open a file, and check for possible errors.
int fclose (std::FILE *file)
 Close a file, and check for possible errors.
const char * file_type (std::FILE *const file, const char *const filename)
 Try to guess the image format of a filename, using the magic numbers in its header.
template<typename T >
int fread (T *const ptr, const unsigned int nmemb, std::FILE *stream)
 Read file data, and check for possible errors.
template<typename T >
int fwrite (const T *ptr, const unsigned int nmemb, std::FILE *stream)
 Write data to a file, and check for possible errors.
const char * option (const char *const name, const int argc, const char *const *const argv, const char *const defaut, const char *const usage, const bool reset_static)
const char * option (const char *const name, const int argc, const char *const *const argv, const char *const defaut, const char *const usage=0)
bool option (const char *const name, const int argc, const char *const *const argv, const bool defaut, const char *const usage=0)
int option (const char *const name, const int argc, const char *const *const argv, const int defaut, const char *const usage=0)
char option (const char *const name, const int argc, const char *const *const argv, const char defaut, const char *const usage=0)
float option (const char *const name, const int argc, const char *const *const argv, const float defaut, const char *const usage=0)
double option (const char *const name, const int argc, const char *const *const argv, const double defaut, const char *const usage=0)
const char * argument (const unsigned int nb, const int argc, const char *const *const argv, const unsigned int nb_singles=0,...)
template<typename t >
int dialog (const char *const title, const char *const msg, const char *const button1_label, const char *const button2_label, const char *const button3_label, const char *const button4_label, const char *const button5_label, const char *const button6_label, const CImg< t > &logo, const bool centering=false)
 Display a dialog box, where a user can click standard buttons.

Variables

const char t_normal [] = { 0 }
const char *const t_red = cimg::t_normal
const char *const *const t_bold = cimg::t_normal
const char *const *const *const t_purple = cimg::t_normal
const char *const *const
*const *const 
t_green = cimg::t_normal
const unsigned int keyESC = 1U
const unsigned int keyF1 = 2U
const unsigned int keyF2 = 3U
const unsigned int keyF3 = 4U
const unsigned int keyF4 = 5U
const unsigned int keyF5 = 6U
const unsigned int keyF6 = 7U
const unsigned int keyF7 = 8U
const unsigned int keyF8 = 9U
const unsigned int keyF9 = 10U
const unsigned int keyF10 = 11U
const unsigned int keyF11 = 12U
const unsigned int keyF12 = 13U
const unsigned int keyPAUSE = 14U
const unsigned int key1 = 15U
const unsigned int key2 = 16U
const unsigned int key3 = 17U
const unsigned int key4 = 18U
const unsigned int key5 = 19U
const unsigned int key6 = 20U
const unsigned int key7 = 21U
const unsigned int key8 = 22U
const unsigned int key9 = 23U
const unsigned int key0 = 24U
const unsigned int keyBACKSPACE = 25U
const unsigned int keyINSERT = 26U
const unsigned int keyHOME = 27U
const unsigned int keyPAGEUP = 28U
const unsigned int keyTAB = 29U
const unsigned int keyQ = 30U
const unsigned int keyW = 31U
const unsigned int keyE = 32U
const unsigned int keyR = 33U
const unsigned int keyT = 34U
const unsigned int keyY = 35U
const unsigned int keyU = 36U
const unsigned int keyI = 37U
const unsigned int keyO = 38U
const unsigned int keyP = 39U
const unsigned int keyDELETE = 40U
const unsigned int keyEND = 41U
const unsigned int keyPAGEDOWN = 42U
const unsigned int keyCAPSLOCK = 43U
const unsigned int keyA = 44U
const unsigned int keyS = 45U
const unsigned int keyD = 46U
const unsigned int keyF = 47U
const unsigned int keyG = 48U
const unsigned int keyH = 49U
const unsigned int keyJ = 50U
const unsigned int keyK = 51U
const unsigned int keyL = 52U
const unsigned int keyENTER = 53U
const unsigned int keySHIFTLEFT = 54U
const unsigned int keyZ = 55U
const unsigned int keyX = 56U
const unsigned int keyC = 57U
const unsigned int keyV = 58U
const unsigned int keyB = 59U
const unsigned int keyN = 60U
const unsigned int keyM = 61U
const unsigned int keySHIFTRIGHT = 62U
const unsigned int keyARROWUP = 63U
const unsigned int keyCTRLLEFT = 64U
const unsigned int keyAPPLEFT = 65U
const unsigned int keyALT = 66U
const unsigned int keySPACE = 67U
const unsigned int keyALTGR = 68U
const unsigned int keyAPPRIGHT = 69U
const unsigned int keyMENU = 70U
const unsigned int keyCTRLRIGHT = 71U
const unsigned int keyARROWLEFT = 72U
const unsigned int keyARROWDOWN = 73U
const unsigned int keyARROWRIGHT = 74U
const unsigned int keyPAD0 = 75U
const unsigned int keyPAD1 = 76U
const unsigned int keyPAD2 = 77U
const unsigned int keyPAD3 = 78U
const unsigned int keyPAD4 = 79U
const unsigned int keyPAD5 = 80U
const unsigned int keyPAD6 = 81U
const unsigned int keyPAD7 = 82U
const unsigned int keyPAD8 = 83U
const unsigned int keyPAD9 = 84U
const unsigned int keyPADADD = 85U
const unsigned int keyPADSUB = 86U
const unsigned int keyPADMUL = 87U
const unsigned int keyPADDIV = 88U
const double PI = 3.14159265358979323846
 Definition of the mathematical constant PI.
const unsigned int font10x13 [256 *10 *13/32]
const unsigned int font12x24 [12 *24 *256/32]
const unsigned int font16x32 [16 *32 *256/32]
const unsigned int font29x57 [29 *57 *256/32]
const unsigned char logo40x38 [4576]

Detailed Description

Namespace that 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 processing. Nevertheless, documented variables and functions of this namespace may be used safely in your own source code.

Warning:
Never write 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 that could defined in the global namespace ::.

Function Documentation

unsigned int& cimg_library::cimg::_exception_mode ( const unsigned int  value,
const bool  is_set 
) [inline]

Get/set the current CImg exception mode.

The way error messages are handled by CImg can be changed dynamically, using this function. Possible values are :

  • '0' to hide library messages (quiet mode).
  • '1' to print library messages on the console.
  • '2' to display library messages on a dialog window (default behavior).
  • '3' to do as '1' + add extra warnings (may slow down the code !).
  • '4' to do as '2' + add extra warnings (may slow down the code !).

Definition at line 1938 of file CImg.h.

template<typename T >
T cimg_library::cimg::abs ( const T  a  )  [inline]
double cimg_library::cimg::atof ( const char *const   str  )  [inline]

Read a double number from a C-string.

Note:
This function is quite similar to std::atof(), but that it allows the retrieval of fractions as in "1/2".

Definition at line 4301 of file CImg.h.

const char* cimg_library::cimg::basename ( const char *const   s  )  [inline]

Compute the basename of a filename.

Definition at line 4373 of file CImg.h.

double cimg_library::cimg::crand (  )  [inline]

Return a random variable between [-1,1] with respect to an uniform distribution.

Definition at line 4236 of file CImg.h.

References rand().

Referenced by cimg_library::CImg< charT >::noise().

const char* cimg_library::cimg::dcraw_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return or set path to the 'dcraw' command.

Definition at line 4821 of file CImg.h.

References fclose().

Referenced by cimg_library::CImg< charT >::load_dcraw_external().

template<typename t >
int cimg_library::cimg::dialog ( const char *const   title,
const char *const   msg,
const char *const   button1_label,
const char *const   button2_label,
const char *const   button3_label,
const char *const   button4_label,
const char *const   button5_label,
const char *const   button6_label,
const CImg< t > &  logo,
const bool  centering = false 
) [inline]

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.

Parameters:
title = Title of the dialog window.
msg = Main message displayed inside the dialog window.
button1_label = Label of the 1st button.
button2_label = Label of the 2nd button.
button3_label = Label of the 3rd button.
button4_label = Label of the 4th button.
button5_label = Label of the 5th button.
button6_label = 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.
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 0, then the corresponding button (and the followings) won't appear in the dialog box. At least one button is necessary.

Definition at line 39102 of file CImg.h.

References cimg_library::CImg< T >::_data, cimg_library::CImg< T >::_height, cimg_library::CImg< T >::_width, cimg_library::CImgList< T >::_width, cimg_library::CImgDisplay::button(), cimg_library::CImg< T >::display(), cimg_library::CImg< T >::draw_image(), cimg_library::CImg< T >::draw_line(), cimg_library::CImg< T >::draw_rectangle(), cimg_library::CImg< T >::draw_text(), cimg_library::CImgDisplay::height(), cimg_library::CImgDisplay::key(), cimg_library::CImg< T >::max(), cimg_library::CImgDisplay::mouse_x(), cimg_library::CImgDisplay::mouse_y(), cimg_library::CImgDisplay::move(), cimg_library::CImg< T >::move_to(), cimg_library::CImgDisplay::resize(), cimg_library::CImgDisplay::screen_height(), cimg_library::CImgDisplay::screen_width(), cimg_library::CImgDisplay::set_key(), cimg_library::CImgDisplay::wait(), cimg_library::CImg< T >::width(), and cimg_library::CImgDisplay::width().

bool cimg_library::cimg::endianness (  )  [inline]

Return the current endianness of the CPU.

Returns:
false for "Little Endian", true for "Big Endian".

Definition at line 3944 of file CImg.h.

Referenced by cimg_library::CImgList< charT >::_save_cimg(), and info().

double cimg_library::cimg::eval ( const char *const   expression,
const double  x = 0,
const double  y = 0,
const double  z = 0,
const double  v = 0 
) [inline]

Evaluate math expression.

Definition at line 39250 of file CImg.h.

References cimg_library::CImg< T >::empty(), and cimg_library::CImg< T >::eval().

int cimg_library::cimg::fclose ( std::FILE *  file  )  [inline]
const char* cimg_library::cimg::ffmpeg_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return or set path to the 'ffmpeg' command.

Definition at line 4728 of file CImg.h.

References fclose().

const char* cimg_library::cimg::file_type ( std::FILE *const   file,
const char *const   filename 
) [inline]

Try to guess the image format of a filename, using the magic numbers in its header.

Definition at line 4902 of file CImg.h.

References fclose(), and fopen().

Referenced by cimg_library::CImg< charT >::load().

std::FILE* cimg_library::cimg::fopen ( const char *const   path,
const char *const   mode 
) [inline]
template<typename T >
int cimg_library::cimg::fread ( T *const   ptr,
const unsigned int  nmemb,
std::FILE *  stream 
) [inline]

Read file data, and check for possible errors.

Definition at line 4948 of file CImg.h.

References warn().

template<typename T >
int cimg_library::cimg::fwrite ( const T *  ptr,
const unsigned int  nmemb,
std::FILE *  stream 
) [inline]

Write data to a file, and check for possible errors.

Definition at line 4969 of file CImg.h.

References warn().

Referenced by cimg_library::CImgList< charT >::_save_cimg(), and cimg_library::CImg< charT >::save_analyze().

double cimg_library::cimg::grand (  )  [inline]

Return a random variable following a gaussian distribution and a standard deviation of 1.

Definition at line 4241 of file CImg.h.

References log(), rand(), and sqrt().

Referenced by cimg_library::CImg< charT >::draw_plasma(), cimg_library::CImg< charT >::noise(), and prand().

const char* cimg_library::cimg::graphicsmagick_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return path of the GraphicsMagick's gm tool.

Definition at line 4580 of file CImg.h.

References fclose().

Referenced by info(), cimg_library::CImg< charT >::load_graphicsmagick_external(), and cimg_library::CImg< charT >::save_graphicsmagick_external().

const char* cimg_library::cimg::gunzip_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return or set path to the 'gunzip' command.

Definition at line 4790 of file CImg.h.

References fclose().

Referenced by cimg_library::CImg< charT >::load_gzip_external().

const char* cimg_library::cimg::gzip_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return or set path to the 'gzip' command.

Definition at line 4759 of file CImg.h.

References fclose().

Referenced by cimg_library::CImg< charT >::save_gzip_external(), and cimg_library::CImgList< charT >::save_gzip_external().

const char* cimg_library::cimg::imagemagick_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return or set path to the ImageMagick's convert tool.

Definition at line 4476 of file CImg.h.

References fclose().

Referenced by info(), cimg_library::CImg< charT >::load_imagemagick_external(), and cimg_library::CImg< charT >::save_imagemagick_external().

void cimg_library::cimg::info (  )  [inline]

Print informations about CImg environement variables.

Printing is done on the standard error output.

Definition at line 5092 of file CImg.h.

References endianness(), graphicsmagick_path(), imagemagick_path(), medcon_path(), output(), and temporary_path().

template<typename T >
T& cimg_library::cimg::invert_endianness ( T &  a  )  [inline]

Invert endianness of a single variable.

Definition at line 3974 of file CImg.h.

References invert_endianness().

template<typename T >
void cimg_library::cimg::invert_endianness ( T *const   buffer,
const unsigned int  size 
) [inline]

Invert endianness of a memory buffer.

Definition at line 3951 of file CImg.h.

References swap().

Referenced by invert_endianness().

template<typename t1 , typename t2 , typename t3 , typename t4 >
cimg::superset3<t1,t2,t3,t4>::type cimg_library::cimg::max ( const t1 &  a,
const t2 &  b,
const t3 &  c,
const t4 &  d 
) [inline]

Return the maximum value between four numbers.

Definition at line 4154 of file CImg.h.

References max().

template<typename t1 , typename t2 , typename t3 >
cimg::superset2<t1,t2,t3>::type cimg_library::cimg::max ( const t1 &  a,
const t2 &  b,
const t3 &  c 
) [inline]

Return the maximum value between three numbers.

Definition at line 4147 of file CImg.h.

References max().

template<typename t1 , typename t2 >
cimg::superset<t1,t2>::type cimg_library::cimg::max ( const t1 &  a,
const t2 &  b 
) [inline]
const char* cimg_library::cimg::medcon_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]

Return or set path of the XMedcon tool.

Definition at line 4684 of file CImg.h.

References fclose().

Referenced by info(), cimg_library::CImg< charT >::load_medcon_external(), and cimg_library::CImg< charT >::save_medcon_external().

template<typename t1 , typename t2 , typename t3 , typename t4 >
cimg::superset3<t1,t2,t3,t4>::type cimg_library::cimg::min ( const t1 &  a,
const t2 &  b,
const t3 &  c,
const t4 &  d 
) [inline]

Return the minimum value between four numbers.

Definition at line 4133 of file CImg.h.

References min().

template<typename t1 , typename t2 , typename t3 >
cimg::superset2<t1,t2,t3>::type cimg_library::cimg::min ( const t1 &  a,
const t2 &  b,
const t3 &  c 
) [inline]

Return the minimum value between three numbers.

Definition at line 4126 of file CImg.h.

References min().

template<typename t1 , typename t2 >
cimg::superset<t1,t2>::type cimg_library::cimg::min ( const t1 &  a,
const t2 &  b 
) [inline]
template<typename T >
T cimg_library::cimg::minmod ( const T  a,
const T  b 
) [inline]

Return the minmod of two numbers.

minmod(a,b) is defined to be :

  • minmod(a,b) = min(a,b), if a and b have the same sign.
  • minmod(a,b) = 0, if a and b have different signs.

Definition at line 4224 of file CImg.h.

template<typename T >
T cimg_library::cimg::mod ( const T &  x,
const T &  m 
) [inline]

Return the modulo of a number.

Note:
This modulo function accepts negative and floating-points modulo numbers, as well as variable of any type.

Definition at line 4184 of file CImg.h.

Referenced by cimg_library::CImg< charT >::draw_grid(), cimg_library::CImg< charT >::operator%=(), round(), and cimg_library::CImg< charT >::shift().

template<typename T >
unsigned int cimg_library::cimg::nearest_pow2 ( const T  x  )  [inline]

Return the nearest power of 2 higher than a given number.

Definition at line 4167 of file CImg.h.

Referenced by cimg_library::CImgList< charT >::assign(), and cimg_library::CImgList< charT >::CImgList().

char* cimg_library::cimg::number_filename ( const char *const   filename,
const int  number,
const unsigned int  n,
char *const   string 
) [inline]

Create a numbered version of a filename.

Definition at line 4865 of file CImg.h.

References rutz::format(), and split_filename().

Referenced by cimg_library::CImgList< charT >::save(), cimg_library::CImg< charT >::save(), and cimg_library::CImgList< charT >::save_gzip_external().

std::FILE * cimg_library::cimg::output ( std::FILE *  file = 0  )  [inline]

Set/get output stream for CImg library messages.

Definition at line 3832 of file CImg.h.

Referenced by info(), cimg_library::CImg< charT >::print(), cimg_library::CImgList< charT >::print(), and warn().

unsigned int cimg_library::cimg::prand ( const double  z  )  [inline]

Return a random variable following a Poisson distribution of parameter z.

Definition at line 4252 of file CImg.h.

References exp(), grand(), rand(), and sqrt().

Referenced by cimg_library::CImg< charT >::noise().

double cimg_library::cimg::rand (  )  [inline]

Return a random variable between [0,1] with respect to an uniform distribution.

Definition at line 4229 of file CImg.h.

Referenced by crand(), grand(), cimg_library::CImg< charT >::noise(), prand(), and cimg_library::CImg< charT >::rand().

template<typename T >
T cimg_library::cimg::rol ( const T  a,
const unsigned int  n = 1 
) [inline]

Return a left bitwise-rotated number.

Definition at line 4046 of file CImg.h.

Referenced by cimg_library::CImg< charT >::rol().

template<typename T >
T cimg_library::cimg::ror ( const T  a,
const unsigned int  n = 1 
) [inline]

Return a right bitwise-rotated number.

Definition at line 4060 of file CImg.h.

Referenced by cimg_library::CImg< charT >::ror().

double cimg_library::cimg::round ( const double  x,
const double  y,
const int  rounding_type = 0 
) [inline]

Return a rounded number.

Parameters:
x is the number to be rounded.
y is the rounding precision.
rounding_type defines the type of rounding (0=nearest, -1=backward, 1=forward).

Definition at line 4267 of file CImg.h.

References mod().

Referenced by cimg_library::CImg< charT >::round(), and cimg_library::CImg< charT >::streamline().

template<typename T >
T cimg_library::cimg::sign ( const T  x  )  [inline]

Return the sign of a number.

Definition at line 4161 of file CImg.h.

double cimg_library::cimg::sinc ( const double  x  )  [inline]

Return the sinc() of a given number.

Definition at line 4174 of file CImg.h.

Referenced by cimg_library::CImg< charT >::sinc().

void cimg_library::cimg::sleep ( const unsigned int  milliseconds  )  [inline]

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.

Definition at line 3999 of file CImg.h.

const char* cimg_library::cimg::split_filename ( const char *const   filename,
char *const   body = 0 
) [inline]
template<typename T >
T cimg_library::cimg::sqr ( const T  val  )  [inline]

Return the square of a number.

Definition at line 4108 of file CImg.h.

Referenced by cimg_library::CImg< charT >::magnitude(), and cimg_library::CImg< charT >::sphere3d().

int cimg_library::cimg::strcasecmp ( const char *const   s1,
const char *const   s2 
) [inline]
void cimg_library::cimg::strescape ( char *const   s  )  [inline]

Replace explicit escape sequences '' in C-strings.

Definition at line 4346 of file CImg.h.

int cimg_library::cimg::strncasecmp ( const char *const   s1,
const char *const   s2,
const int  l 
) [inline]

Compare the first n characters of two C-strings, ignoring the case.

Note:
This function is defined since it is not provided by all compilers (not an ANSI function).

Definition at line 4311 of file CImg.h.

References uncase().

Referenced by cimg_library::CImg< charT >::load(), cimg_library::CImg< charT >::save_analyze(), and strcasecmp().

bool cimg_library::cimg::strpare ( char *const   s,
const char  delimiter = ' ',
const bool  symmetric = false,
const bool  is_iterative = false 
) [inline]

Remove useless delimiters on the borders of a C-string.

Definition at line 4331 of file CImg.h.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2,
T3 &  a3,
T3 &  b3,
T4 &  a4,
T4 &  b4,
T5 &  a5,
T5 &  b5,
T6 &  a6,
T6 &  b6,
T7 &  a7,
T7 &  b7,
T8 &  a8,
T8 &  b8 
) [inline]

Exchange values of variables (a1,a2,...,a8) and (b1,b2,...,b8).

Definition at line 3935 of file CImg.h.

References swap().

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2,
T3 &  a3,
T3 &  b3,
T4 &  a4,
T4 &  b4,
T5 &  a5,
T5 &  b5,
T6 &  a6,
T6 &  b6,
T7 &  a7,
T7 &  b7 
) [inline]

Exchange values of variables (a1,a2,...,a7) and (b1,b2,...,b7).

Definition at line 3928 of file CImg.h.

References swap().

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2,
T3 &  a3,
T3 &  b3,
T4 &  a4,
T4 &  b4,
T5 &  a5,
T5 &  b5,
T6 &  a6,
T6 &  b6 
) [inline]

Exchange values of variables (a1,a2,...,a6) and (b1,b2,...,b6).

Definition at line 3922 of file CImg.h.

References swap().

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2,
T3 &  a3,
T3 &  b3,
T4 &  a4,
T4 &  b4,
T5 &  a5,
T5 &  b5 
) [inline]

Exchange values of variables (a1,a2,...,a5) and (b1,b2,...,b5).

Definition at line 3916 of file CImg.h.

References swap().

template<typename T1 , typename T2 , typename T3 , typename T4 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2,
T3 &  a3,
T3 &  b3,
T4 &  a4,
T4 &  b4 
) [inline]

Exchange values of variables (a1,a2,...,a4) and (b1,b2,...,b4).

Definition at line 3910 of file CImg.h.

References swap().

template<typename T1 , typename T2 , typename T3 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2,
T3 &  a3,
T3 &  b3 
) [inline]

Exchange values of variables (a1,a2,a3) and (b1,b2,b3).

Definition at line 3904 of file CImg.h.

References swap().

template<typename T1 , typename T2 >
void cimg_library::cimg::swap ( T1 &  a1,
T1 &  b1,
T2 &  a2,
T2 &  b2 
) [inline]

Exchange values of variables (a1,a2) and (b1,b2).

Definition at line 3898 of file CImg.h.

References swap().

template<typename T >
void cimg_library::cimg::swap ( T &  a,
T &  b 
) [inline]

Exchange values of variables a and b.

Definition at line 3894 of file CImg.h.

Referenced by cimg_library::CImg< charT >::dijkstra(), invert_endianness(), swap(), and cimg_library::CImg< charT >::transpose().

int cimg_library::cimg::system ( const char *const   command,
const char *const   module_name = 0 
) [inline]
template<typename T >
T& cimg_library::cimg::temporary ( const T &   )  [inline]
const char* cimg_library::cimg::temporary_path ( const char *const   user_path = 0,
const bool  reinit_path = false 
) [inline]
unsigned long cimg_library::cimg::time (  )  [inline]

Get the value of a system timer with a millisecond precision.

Definition at line 3980 of file CImg.h.

Referenced by cimg_library::CImgDisplay::frames_per_second(), and wait().

void cimg_library::cimg::uncase ( char *const   string  )  [inline]

Remove the 'case' of a C string.

Acts in-place.

Definition at line 4292 of file CImg.h.

References uncase().

char cimg_library::cimg::uncase ( const char  x  )  [inline]

Remove the 'case' of an ASCII character.

Definition at line 4284 of file CImg.h.

Referenced by cimg_library::CImg< charT >::assign(), cimg_library::CImg< charT >::mirror(), strncasecmp(), and uncase().

unsigned int cimg_library::cimg::wait ( const unsigned int  milliseconds  )  [inline]

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

This function is equivalent to sleep() but the waiting time is computed with regard to the last call of wait(). It may be used to temporize your program properly.

Definition at line 4025 of file CImg.h.

References time().

void cimg_library::cimg::warn ( const char *const   format,
  ... 
) [inline]
int cimg_library::cimg::xln ( const int  x  )  [inline]

Return 1 + log_10(x).

Definition at line 4113 of file CImg.h.

References log10().


Variable Documentation

const unsigned char cimg_library::cimg::logo40x38[4576]
Initial value:
 {
      177,200,200,200,3,123,123,0,36,200,200,200,1,123,123,0,2,255,255,0,1,189,189,189,1,0,0,0,34,200,200,200,
      1,123,123,0,4,255,255,0,1,189,189,189,1,0,0,0,1,123,123,123,32,200,200,200,1,123,123,0,5,255,255,0,1,0,0,
      0,2,123,123,123,30,200,200,200,1,123,123,0,6,255,255,0,1,189,189,189,1,0,0,0,2,123,123,123,29,200,200,200,
      1,123,123,0,7,255,255,0,1,0,0,0,2,123,123,123,28,200,200,200,1,123,123,0,8,255,255,0,1,189,189,189,1,0,0,0,
      2,123,123,123,27,200,200,200,1,123,123,0,9,255,255,0,1,0,0,0,2,123,123,123,26,200,200,200,1,123,123,0,10,255,
      255,0,1,189,189,189,1,0,0,0,2,123,123,123,25,200,200,200,1,123,123,0,3,255,255,0,1,189,189,189,3,0,0,0,1,189,
      189,189,3,255,255,0,1,0,0,0,2,123,123,123,24,200,200,200,1,123,123,0,4,255,255,0,5,0,0,0,3,255,255,0,1,189,
      189,189,1,0,0,0,2,123,123,123,23,200,200,200,1,123,123,0,4,255,255,0,5,0,0,0,4,255,255,0,1,0,0,0,2,123,123,123,
      22,200,200,200,1,123,123,0,5,255,255,0,5,0,0,0,4,255,255,0,1,189,189,189,1,0,0,0,2,123,123,123,21,200,200,200,
      1,123,123,0,5,255,255,0,5,0,0,0,5,255,255,0,1,0,0,0,2,123,123,123,20,200,200,200,1,123,123,0,6,255,255,0,5,0,0,
      0,5,255,255,0,1,189,189,189,1,0,0,0,2,123,123,123,19,200,200,200,1,123,123,0,6,255,255,0,1,123,123,0,3,0,0,0,1,
      123,123,0,6,255,255,0,1,0,0,0,2,123,123,123,18,200,200,200,1,123,123,0,7,255,255,0,1,189,189,189,3,0,0,0,1,189,
      189,189,6,255,255,0,1,189,189,189,1,0,0,0,2,123,123,123,17,200,200,200,1,123,123,0,8,255,255,0,3,0,0,0,8,255,255,
      0,1,0,0,0,2,123,123,123,16,200,200,200,1,123,123,0,9,255,255,0,1,123,123,0,1,0,0,0,1,123,123,0,8,255,255,0,1,189,
      189,189,1,0,0,0,2,123,123,123,15,200,200,200,1,123,123,0,9,255,255,0,1,189,189,189,1,0,0,0,1,189,189,189,9,255,255,
      0,1,0,0,0,2,123,123,123,14,200,200,200,1,123,123,0,11,255,255,0,1,0,0,0,10,255,255,0,1,189,189,189,1,0,0,0,2,123,
      123,123,13,200,200,200,1,123,123,0,23,255,255,0,1,0,0,0,2,123,123,123,12,200,200,200,1,123,123,0,11,255,255,0,1,189,
      189,189,2,0,0,0,1,189,189,189,9,255,255,0,1,189,189,189,1,0,0,0,2,123,123,123,11,200,200,200,1,123,123,0,11,255,255,
      0,4,0,0,0,10,255,255,0,1,0,0,0,2,123,123,123,10,200,200,200,1,123,123,0,12,255,255,0,4,0,0,0,10,255,255,0,1,189,189,
      189,1,0,0,0,2,123,123,123,9,200,200,200,1,123,123,0,12,255,255,0,1,189,189,189,2,0,0,0,1,189,189,189,11,255,255,0,1,
      0,0,0,2,123,123,123,9,200,200,200,1,123,123,0,27,255,255,0,1,0,0,0,3,123,123,123,8,200,200,200,1,123,123,0,26,255,
      255,0,1,189,189,189,1,0,0,0,3,123,123,123,9,200,200,200,1,123,123,0,24,255,255,0,1,189,189,189,1,0,0,0,4,123,123,
      123,10,200,200,200,1,123,123,0,24,0,0,0,5,123,123,123,12,200,200,200,27,123,123,123,14,200,200,200,25,123,123,123,86,
      200,200,200,91,49,124,118,124,71,32,124,95,49,56,114,52,82,121,0}

Definition at line 3805 of file CImg.h.

const double cimg_library::cimg::PI = 3.14159265358979323846
Generated on Sun May 8 08:28:45 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3