Sim-LIT  2.0
 All Classes Namespaces Files Functions Variables Typedefs
cimg_library_suffixed::cimg Namespace Reference

Contains low-level functions and variables of the Library. More...

Classes

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

Functions

std::FILE * output (std::FILE *file)
 Get/set default output stream for the library messages. More...
 
void info ()
 Print informations about environement variables. More...
 
template<typename T >
void unused (const T &,...)
 Avoid warning messages due to unused parameters. Do nothing actually.
 
int mutex (const unsigned int n, const int lock_mode=1)
 
unsigned int & _exception_mode (const unsigned int value, const bool is_set)
 
unsigned int & exception_mode (const unsigned int mode)
 Set current exception mode. More...
 
unsigned int & exception_mode ()
 Return current exception mode. More...
 
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 bool is_centered)
 Display a simple dialog box, and wait for the user's response .
 
double eval (const char *const expression, const double x, const double y, const double z, const double c)
 Evaluate math expression. More...
 
Mutex_infoMutex_attr ()
 
unsigned int nb_cpus ()
 
void warn (const char *const format,...)
 Display a warning message on the default output stream. More...
 
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 endianness of the current architecture. More...
 
template<typename T >
void invert_endianness (T *const buffer, const unsigned long size)
 Reverse endianness of all elements in a memory buffer. More...
 
template<typename T >
T & invert_endianness (T &a)
 Reverse endianness of a single variable. More...
 
unsigned int float2uint (const float f)
 
float uint2float (const unsigned int u)
 
unsigned long time ()
 Return the value of a system timer, with a millisecond precision. More...
 
unsigned long tictoc (const bool is_tic)
 
unsigned long tic ()
 Start tic/toc timer for time measurement between code instructions. More...
 
unsigned long toc ()
 End tic/toc timer and displays elapsed time from last call to tic(). More...
 
void sleep (const unsigned int milliseconds)
 Sleep for a given numbers of milliseconds. More...
 
unsigned int _wait (const unsigned int milliseconds, unsigned long &timer)
 
unsigned int wait (const unsigned int milliseconds)
 Wait for a given number of milliseconds since the last call to wait(). More...
 
void srand ()
 
void srand (const unsigned int seed)
 
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.
 
template<typename T >
rol (const T a, const unsigned int n=1)
 Bitwise-rotate value on the left.
 
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)
 Bitwise-rotate value on the right.
 
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 absolute value of a value.
 
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 square of a value.
 
int xln (const int x)
 Return 1 + log_10(x) of a value x.
 
template<typename t1 , typename t2 >
cimg::superset< t1, t2 >::type min (const t1 &a, const t2 &b)
 Return the minimum between two values.
 
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 three values.
 
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 four values.
 
template<typename t1 , typename t2 >
cimg::superset< t1, t2 >::type max (const t1 &a, const t2 &b)
 Return the maximum between two values.
 
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 three values.
 
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 four values.
 
template<typename T >
sign (const T x)
 Return the sign of a value.
 
template<typename T >
unsigned long nearest_pow2 (const T x)
 Return the nearest power of 2 higher than given value.
 
double sinc (const double x)
 Return the sinc of a given value.
 
template<typename T >
mod (const T &x, const T &m)
 Return the modulo of a value. More...
 
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 min-mod of two values. More...
 
double log2 (const double x)
 Return base-2 logarithm of a value.
 
template<typename T >
round (const T x, const double y=1, const int rounding_type=0)
 Return rounded value. More...
 
double _pythagore (double a, double b)
 
bool _is_self_expr (const char *expression)
 
char uncase (const char x)
 Convert ascii character to lower case.
 
void uncase (char *const str)
 Convert C-string to lower case.
 
double atof (const char *const str)
 Read value in a C-string. More...
 
int strncasecmp (const char *const str1, const char *const str2, const int l)
 Compare the first l characters of two C-strings, ignoring the case. More...
 
int strcasecmp (const char *const str1, const char *const str2)
 Compare two C-strings, ignoring the case. More...
 
bool strpare (char *const str, const char delimiter=' ', const bool is_symmetric=false, const bool is_iterative=false)
 Remove delimiters on the start and/or end of a C-string. More...
 
void strunescape (char *const str)
 Replace escape sequences in C-strings by their binary ascii values. More...
 
const char * strbuffersize (const unsigned long size)
 
const char * stros ()
 
const char * basename (const char *const str)
 Return the basename of a filename.
 
const char * filenamerand ()
 
void winformat_string (char *const str)
 
std::FILE * fopen (const char *const path, const char *const mode)
 Open a file. More...
 
int fclose (std::FILE *file)
 Close a file. More...
 
const char * temporary_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to store temporary files. More...
 
const char * imagemagick_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the Program Files/ directory (Windows only). More...
 
const char * graphicsmagick_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the GraphicsMagick's gm binary. More...
 
const char * medcon_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the XMedcon's medcon binary. More...
 
const char * ffmpeg_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the FFMPEG's ffmpeg binary. More...
 
const char * gzip_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the gzip binary. More...
 
const char * gunzip_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the gzip binary. More...
 
const char * dcraw_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the dcraw binary. More...
 
const char * wget_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the wget binary. More...
 
const char * curl_path (const char *const user_path=0, const bool reinit_path=false)
 Get/set path to the curl binary. More...
 
const char * split_filename (const char *const filename, char *const body=0)
 Split filename into two C-strings body and extension.
 
char * number_filename (const char *const filename, const int number, const unsigned int digits, char *const str)
 Generate a numbered version of a filename.
 
const char * file_type (std::FILE *const file, const char *const filename)
 Try to guess format from an image file. More...
 
template<typename T >
int fread (T *const ptr, const unsigned long nmemb, std::FILE *stream)
 Read data from file. More...
 
template<typename T >
int fwrite (const T *ptr, const unsigned long nmemb, std::FILE *stream)
 Write data to file. More...
 
void fempty (std::FILE *const file, const char *const filename)
 Create an empty file. More...
 
char * load_network_external (const char *const filename, char *const filename_local)
 Load file from network as a local temporary file. More...
 
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)
 Return options specified on the command line.
 
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 is_centered=false)
 Display a simple dialog box, and wait for the user's response. More...
 
template<typename t >
CImg< typename cimg::superset
< double, t >::type
eval (const char *const expression, const CImg< t > &xyzc)
 

Variables

const char t_normal [] = { 0 }
 
const char *const t_black = cimg::t_normal
 
const char *const *const t_red = cimg::t_normal
 
const char *const *const *const t_green = cimg::t_normal
 
const char *const *const
*const *const 
t_yellow = cimg::t_normal
 
const char *const *const
*const *const *const 
t_blue = cimg::t_normal
 
const char *const *const
*const *const *const *const 
t_magenta = cimg::t_normal
 
const char *const *const
*const *const *const *const
*const 
t_cyan = cimg::t_normal
 
const char *const *const
*const *const *const *const
*const *const 
t_white = cimg::t_normal
 
const char *const *const
*const *const *const *const
*const *const *const 
t_bold = cimg::t_normal
 
const char *const *const
*const *const *const *const
*const *const *const *const 
t_underscore = cimg::t_normal
 
const unsigned int keyESC = 1U
 Keycode for the ESC key (architecture-dependent).
 
const unsigned int keyF1 = 2U
 Keycode for the F1 key (architecture-dependent).
 
const unsigned int keyF2 = 3U
 Keycode for the F2 key (architecture-dependent).
 
const unsigned int keyF3 = 4U
 Keycode for the F3 key (architecture-dependent).
 
const unsigned int keyF4 = 5U
 Keycode for the F4 key (architecture-dependent).
 
const unsigned int keyF5 = 6U
 Keycode for the F5 key (architecture-dependent).
 
const unsigned int keyF6 = 7U
 Keycode for the F6 key (architecture-dependent).
 
const unsigned int keyF7 = 8U
 Keycode for the F7 key (architecture-dependent).
 
const unsigned int keyF8 = 9U
 Keycode for the F8 key (architecture-dependent).
 
const unsigned int keyF9 = 10U
 Keycode for the F9 key (architecture-dependent).
 
const unsigned int keyF10 = 11U
 Keycode for the F10 key (architecture-dependent).
 
const unsigned int keyF11 = 12U
 Keycode for the F11 key (architecture-dependent).
 
const unsigned int keyF12 = 13U
 Keycode for the F12 key (architecture-dependent).
 
const unsigned int keyPAUSE = 14U
 Keycode for the PAUSE key (architecture-dependent).
 
const unsigned int key1 = 15U
 Keycode for the 1 key (architecture-dependent).
 
const unsigned int key2 = 16U
 Keycode for the 2 key (architecture-dependent).
 
const unsigned int key3 = 17U
 Keycode for the 3 key (architecture-dependent).
 
const unsigned int key4 = 18U
 Keycode for the 4 key (architecture-dependent).
 
const unsigned int key5 = 19U
 Keycode for the 5 key (architecture-dependent).
 
const unsigned int key6 = 20U
 Keycode for the 6 key (architecture-dependent).
 
const unsigned int key7 = 21U
 Keycode for the 7 key (architecture-dependent).
 
const unsigned int key8 = 22U
 Keycode for the 8 key (architecture-dependent).
 
const unsigned int key9 = 23U
 Keycode for the 9 key (architecture-dependent).
 
const unsigned int key0 = 24U
 Keycode for the 0 key (architecture-dependent).
 
const unsigned int keyBACKSPACE = 25U
 Keycode for the BACKSPACE key (architecture-dependent).
 
const unsigned int keyINSERT = 26U
 Keycode for the INSERT key (architecture-dependent).
 
const unsigned int keyHOME = 27U
 Keycode for the HOME key (architecture-dependent).
 
const unsigned int keyPAGEUP = 28U
 Keycode for the PAGEUP key (architecture-dependent).
 
const unsigned int keyTAB = 29U
 Keycode for the TAB key (architecture-dependent).
 
const unsigned int keyQ = 30U
 Keycode for the Q key (architecture-dependent).
 
const unsigned int keyW = 31U
 Keycode for the W key (architecture-dependent).
 
const unsigned int keyE = 32U
 Keycode for the E key (architecture-dependent).
 
const unsigned int keyR = 33U
 Keycode for the R key (architecture-dependent).
 
const unsigned int keyT = 34U
 Keycode for the T key (architecture-dependent).
 
const unsigned int keyY = 35U
 Keycode for the Y key (architecture-dependent).
 
const unsigned int keyU = 36U
 Keycode for the U key (architecture-dependent).
 
const unsigned int keyI = 37U
 Keycode for the I key (architecture-dependent).
 
const unsigned int keyO = 38U
 Keycode for the O key (architecture-dependent).
 
const unsigned int keyP = 39U
 Keycode for the P key (architecture-dependent).
 
const unsigned int keyDELETE = 40U
 Keycode for the DELETE key (architecture-dependent).
 
const unsigned int keyEND = 41U
 Keycode for the END key (architecture-dependent).
 
const unsigned int keyPAGEDOWN = 42U
 Keycode for the PAGEDOWN key (architecture-dependent).
 
const unsigned int keyCAPSLOCK = 43U
 Keycode for the CAPSLOCK key (architecture-dependent).
 
const unsigned int keyA = 44U
 Keycode for the A key (architecture-dependent).
 
const unsigned int keyS = 45U
 Keycode for the S key (architecture-dependent).
 
const unsigned int keyD = 46U
 Keycode for the D key (architecture-dependent).
 
const unsigned int keyF = 47U
 Keycode for the F key (architecture-dependent).
 
const unsigned int keyG = 48U
 Keycode for the G key (architecture-dependent).
 
const unsigned int keyH = 49U
 Keycode for the H key (architecture-dependent).
 
const unsigned int keyJ = 50U
 Keycode for the J key (architecture-dependent).
 
const unsigned int keyK = 51U
 Keycode for the K key (architecture-dependent).
 
const unsigned int keyL = 52U
 Keycode for the L key (architecture-dependent).
 
const unsigned int keyENTER = 53U
 Keycode for the ENTER key (architecture-dependent).
 
const unsigned int keySHIFTLEFT = 54U
 Keycode for the SHIFTLEFT key (architecture-dependent).
 
const unsigned int keyZ = 55U
 Keycode for the Z key (architecture-dependent).
 
const unsigned int keyX = 56U
 Keycode for the X key (architecture-dependent).
 
const unsigned int keyC = 57U
 Keycode for the C key (architecture-dependent).
 
const unsigned int keyV = 58U
 Keycode for the V key (architecture-dependent).
 
const unsigned int keyB = 59U
 Keycode for the B key (architecture-dependent).
 
const unsigned int keyN = 60U
 Keycode for the N key (architecture-dependent).
 
const unsigned int keyM = 61U
 Keycode for the M key (architecture-dependent).
 
const unsigned int keySHIFTRIGHT = 62U
 Keycode for the SHIFTRIGHT key (architecture-dependent).
 
const unsigned int keyARROWUP = 63U
 Keycode for the ARROWUP key (architecture-dependent).
 
const unsigned int keyCTRLLEFT = 64U
 Keycode for the CTRLLEFT key (architecture-dependent).
 
const unsigned int keyAPPLEFT = 65U
 Keycode for the APPLEFT key (architecture-dependent).
 
const unsigned int keyALT = 66U
 Keycode for the ALT key (architecture-dependent).
 
const unsigned int keySPACE = 67U
 Keycode for the SPACE key (architecture-dependent).
 
const unsigned int keyALTGR = 68U
 Keycode for the ALTGR key (architecture-dependent).
 
const unsigned int keyAPPRIGHT = 69U
 Keycode for the APPRIGHT key (architecture-dependent).
 
const unsigned int keyMENU = 70U
 Keycode for the MENU key (architecture-dependent).
 
const unsigned int keyCTRLRIGHT = 71U
 Keycode for the CTRLRIGHT key (architecture-dependent).
 
const unsigned int keyARROWLEFT = 72U
 Keycode for the ARROWLEFT key (architecture-dependent).
 
const unsigned int keyARROWDOWN = 73U
 Keycode for the ARROWDOWN key (architecture-dependent).
 
const unsigned int keyARROWRIGHT = 74U
 Keycode for the ARROWRIGHT key (architecture-dependent).
 
const unsigned int keyPAD0 = 75U
 Keycode for the PAD0 key (architecture-dependent).
 
const unsigned int keyPAD1 = 76U
 Keycode for the PAD1 key (architecture-dependent).
 
const unsigned int keyPAD2 = 77U
 Keycode for the PAD2 key (architecture-dependent).
 
const unsigned int keyPAD3 = 78U
 Keycode for the PAD3 key (architecture-dependent).
 
const unsigned int keyPAD4 = 79U
 Keycode for the PAD4 key (architecture-dependent).
 
const unsigned int keyPAD5 = 80U
 Keycode for the PAD5 key (architecture-dependent).
 
const unsigned int keyPAD6 = 81U
 Keycode for the PAD6 key (architecture-dependent).
 
const unsigned int keyPAD7 = 82U
 Keycode for the PAD7 key (architecture-dependent).
 
const unsigned int keyPAD8 = 83U
 Keycode for the PAD8 key (architecture-dependent).
 
const unsigned int keyPAD9 = 84U
 Keycode for the PAD9 key (architecture-dependent).
 
const unsigned int keyPADADD = 85U
 Keycode for the PADADD key (architecture-dependent).
 
const unsigned int keyPADSUB = 86U
 Keycode for the PADSUB key (architecture-dependent).
 
const unsigned int keyPADMUL = 87U
 Keycode for the PADMUL key (architecture-dependent).
 
const unsigned int keyPADDIV = 88U
 Keycode for the PADDDIV key (architecture-dependent).
 
const double PI = 3.14159265358979323846
 Value of the mathematical constant PI.
 
const char *const data_font12x13
 
const char *const data_font20x23
 
const char *const data_font47x53
 
const char *const _data_font90x103 []
 
const unsigned char logo40x38 [4576]
 

Detailed Description

Contains low-level functions and variables of the Library.

Most of the functions and variables within this namespace are used by the library for low-level operations. You may use them to access specific const values or environment variables internally used by .

Warning
Never write using namespace cimg_library::cimg; in your source code. Lot of functions in the cimg:: namespace have the same names as standard C functions that may be defined in the global namespace ::.

Function Documentation

double cimg_library_suffixed::cimg::atof ( const char *const  str)
inline

Read value in a C-string.

Parameters
strC-string containing the float value to read.
Returns
Read value.
Note
Same as std::atof() extended to manage the retrieval of fractions from C-strings, as in "1/2".

Definition at line 4468 of file CImg.h.

const char* cimg_library_suffixed::cimg::curl_path ( const char *const  user_path = 0,
const bool  reinit_path = false 
)
inline

Get/set path to the curl binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the curl binary.

Definition at line 5233 of file CImg.h.

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

Get/set path to the dcraw binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the dcraw binary.

Definition at line 5157 of file CImg.h.

template<typename t >
int cimg_library_suffixed::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  is_centered = false 
)
inline

Display a simple dialog box, and wait for the user's response.

Parameters
titleTitle of the dialog window.
msgMain message displayed inside the dialog window.
button1_labelLabel of the 1st button.
button2_labelLabel of the 2nd button (0 to hide button).
button3_labelLabel of the 3rd button (0 to hide button).
button4_labelLabel of the 4th button (0 to hide button).
button5_labelLabel of the 5th button (0 to hide button).
button6_labelLabel of the 6th button (0 to hide button).
logoImage logo displayed at the left of the main message.
is_centeredTells if the dialog window must be centered on the screen.
Returns
Indice of clicked button (from 0 to 5), or -1 if the dialog window has been closed by the user.
Note
  • Up to 6 buttons can be defined in the dialog window.
  • The function returns when a user clicked one of the button or closed the dialog window.
  • If a button text is set to 0, the corresponding button (and the followings) will not appear in the dialog box. At least one button must be specified.

Definition at line 49328 of file CImg.h.

bool cimg_library_suffixed::cimg::endianness ( )
inline

Return the endianness of the current architecture.

Returns
false for Little Endian or true for Big Endian.

Definition at line 4001 of file CImg.h.

double cimg_library_suffixed::cimg::eval ( const char *const  expression,
const double  x,
const double  y,
const double  z,
const double  c 
)
inline

Evaluate math expression.

Parameters
expressionC-string describing the formula to evaluate.
xValue of the pre-defined variable x.
yValue of the pre-defined variable y.
zValue of the pre-defined variable z.
cValue of the pre-defined variable c.
Returns
Result of the formula evaluation.
Note
Set expression to 0 to keep evaluating the last specified expression.
Example
const double
res1 = cimg::eval("cos(x)^2+sin(y)^2",2,2), // will return '1'.
res2 = cimg::eval(0,1,1); // will return '1' too.

Definition at line 49498 of file CImg.h.

unsigned int& cimg_library_suffixed::cimg::exception_mode ( const unsigned int  mode)
inline

Set current exception mode.

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

Parameters
modeDesired exception mode. Possible values are:
  • 0: Hide library messages (quiet mode).
  • 1: Print library messages on the console.
  • 2: Display library messages on a dialog window (default behavior).
  • 3: Do as 1 + add extra debug warnings (slow down the code!).
  • 4: Do as 2 + add extra debug warnings (slow down the code!).

Definition at line 2131 of file CImg.h.

unsigned int& cimg_library_suffixed::cimg::exception_mode ( )
inline

Return current exception mode.

Note
By default, return the value of configuration macro cimg_verbosity

Definition at line 2139 of file CImg.h.

int cimg_library_suffixed::cimg::fclose ( std::FILE *  file)
inline

Close a file.

Parameters
fileFile to close.
Returns
0 if file has been closed properly, something else otherwise.
Note
Same as std::fclose() but display a warning message if the file has not been closed properly.

Definition at line 4664 of file CImg.h.

void cimg_library_suffixed::cimg::fempty ( std::FILE *const  file,
const char *const  filename 
)
inline

Create an empty file.

Parameters
fileInput file (can be 0 if filename is set).
filenameFilename, as a C-string (can be 0 if file is set).

Definition at line 5401 of file CImg.h.

const char* cimg_library_suffixed::cimg::ffmpeg_path ( const char *const  user_path = 0,
const bool  reinit_path = false 
)
inline

Get/set path to the FFMPEG's ffmpeg binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the ffmpeg binary.

Definition at line 5043 of file CImg.h.

const char* cimg_library_suffixed::cimg::file_type ( std::FILE *const  file,
const char *const  filename 
)
inline

Try to guess format from an image file.

Parameters
fileInput file (can be 0 if filename is set).
filenameFilename, as a C-string (can be 0 if file is set).
Returns
C-string containing the guessed file format, or 0 if nothing has been guessed.

Definition at line 5296 of file CImg.h.

std::FILE* cimg_library_suffixed::cimg::fopen ( const char *const  path,
const char *const  mode 
)
inline

Open a file.

Parameters
pathPath of the filename to open.
modeC-string describing the opening mode.
Returns
Opened file.
Note
Same as std::fopen() but throw a CImgIOException when the specified file cannot be opened, instead of returning 0.

Definition at line 4637 of file CImg.h.

template<typename T >
int cimg_library_suffixed::cimg::fread ( T *const  ptr,
const unsigned long  nmemb,
std::FILE *  stream 
)
inline

Read data from file.

Parameters
[out]ptrPointer to memory buffer that will contain the binary data read from file.
nmembNumber of elements to read.
streamFile to read data from.
Returns
Number of read elements.
Note
Same as std::fread() but may display warning message if all elements could not be read.

Definition at line 5349 of file CImg.h.

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

Write data to file.

Parameters
ptrPointer to memory buffer containing the binary data to write on file.
nmembNumber of elements to write.
[out]streamFile to write data on.
Returns
Number of written elements.
Note
Similar to std::fwrite but may display warning messages if all elements could not be written.

Definition at line 5377 of file CImg.h.

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

Get/set path to the GraphicsMagick's gm binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the gm binary.

Definition at line 4881 of file CImg.h.

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

Get/set path to the gzip binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the gunzip binary.

Definition at line 5119 of file CImg.h.

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

Get/set path to the gzip binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the gzip binary.

Definition at line 5081 of file CImg.h.

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

Get/set path to the Program Files/ directory (Windows only).

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the program files.Get/set path to the ImageMagick's convert binary.
Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the convert binary.

Definition at line 4770 of file CImg.h.

void cimg_library_suffixed::cimg::info ( )
inline

Print informations about environement variables.

Note
Output is done on the default output stream.

Definition at line 5576 of file CImg.h.

template<typename T >
void cimg_library_suffixed::cimg::invert_endianness ( T *const  buffer,
const unsigned long  size 
)
inline

Reverse endianness of all elements in a memory buffer.

Parameters
[in,out]bufferMemory buffer whose endianness must be reversed.
sizeNumber of buffer elements to reverse.

Definition at line 4012 of file CImg.h.

template<typename T >
T& cimg_library_suffixed::cimg::invert_endianness ( T &  a)
inline

Reverse endianness of a single variable.

Parameters
[in,out]aVariable to reverse.
Returns
Reference to reversed variable.

Definition at line 4039 of file CImg.h.

char* cimg_library_suffixed::cimg::load_network_external ( const char *const  filename,
char *const  filename_local 
)
inline

Load file from network as a local temporary file.

Parameters
filenameFilename, as a C-string.
[out]filename_localC-string containing the path to a local copy of filename.
Returns
Value of filename_local.
Note
Use external binaries wget or curl to perform. You must have one of these tools installed to be able to use this function.

Definition at line 5416 of file CImg.h.

const char* cimg_library_suffixed::cimg::medcon_path ( const char *const  user_path = 0,
const bool  reinit_path = false 
)
inline

Get/set path to the XMedcon's medcon binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the medcon binary.

Definition at line 4992 of file CImg.h.

template<typename T >
T cimg_library_suffixed::cimg::minmod ( const T  a,
const T  b 
)
inline

Return the min-mod of two values.

Note
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 4414 of file CImg.h.

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

Return the modulo of a value.

Parameters
xInput value.
mModulo value.
Note
This modulo function accepts negative and floating-points modulo numbers, as well as variables of any type.

Definition at line 4375 of file CImg.h.

std::FILE * cimg_library_suffixed::cimg::output ( std::FILE *  file)
inline

Get/set default output stream for the library messages.

Parameters
fileDesired output stream. Set to 0 to get the currently used output stream only.
Returns
Currently used output stream.

Definition at line 3838 of file CImg.h.

template<typename T >
T cimg_library_suffixed::cimg::round ( const T  x,
const double  y = 1,
const int  rounding_type = 0 
)
inline

Return rounded value.

Parameters
xValue to be rounded.
yRounding precision.
rounding_typeType of rounding operation (0 = nearest, -1 = backward, 1 = forward).
Returns
Rounded value, having the same type as input value x.

Definition at line 4432 of file CImg.h.

void cimg_library_suffixed::cimg::sleep ( const unsigned int  milliseconds)
inline

Sleep for a given numbers of milliseconds.

Parameters
millisecondsNumber of milliseconds to wait for.
Note
This function frees the CPU ressources during the sleeping time. It can be used to temporize your program properly, without wasting CPU time.

Definition at line 4107 of file CImg.h.

int cimg_library_suffixed::cimg::strcasecmp ( const char *const  str1,
const char *const  str2 
)
inline

Compare two C-strings, ignoring the case.

Parameters
str1C-string.
str2C-string.
Returns
0 if the two strings are equal, something else otherwise.
Note
This function has to be defined since it is not provided by all C++-compilers (not ANSI).

Definition at line 4496 of file CImg.h.

int cimg_library_suffixed::cimg::strncasecmp ( const char *const  str1,
const char *const  str2,
const int  l 
)
inline

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

Parameters
str1C-string.
str2C-string.
lNumber of characters to compare.
Returns
0 if the two strings are equal, something else otherwise.
Note
This function has to be defined since it is not provided by all C++-compilers (not ANSI).

Definition at line 4481 of file CImg.h.

bool cimg_library_suffixed::cimg::strpare ( char *const  str,
const char  delimiter = ' ',
const bool  is_symmetric = false,
const bool  is_iterative = false 
)
inline

Remove delimiters on the start and/or end of a C-string.

Parameters
[in,out]strC-string to work with (modified at output).
delimiterDelimiter character code to remove.
is_symmetricTells if the removal is done only if delimiters are symmetric (both at the beginning and the end of s).
is_iterativeTells if the removal is done if several iterations are possible.
Returns
true if delimiters have been removed, false otherwise.

Definition at line 4513 of file CImg.h.

void cimg_library_suffixed::cimg::strunescape ( char *const  str)
inline

Replace escape sequences in C-strings by their binary ascii values.

Parameters
[in,out]strC-string to work with (modified at output).

Definition at line 4533 of file CImg.h.

int cimg_library_suffixed::cimg::system ( const char *const  command,
const char *const  module_name = 0 
)
inline
Parameters
commandC-string containing the command line to execute.
module_nameModule name.
Returns
Status value of the executed command, whose meaning is OS-dependent.
Note
This function is similar to std::system() but it does not open an extra console windows on Windows-based systems.

Definition at line 3907 of file CImg.h.

const char* cimg_library_suffixed::cimg::temporary_path ( const char *const  user_path = 0,
const bool  reinit_path = false 
)
inline

Get/set path to store temporary files.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path where temporary files can be saved.

Definition at line 4679 of file CImg.h.

unsigned long cimg_library_suffixed::cimg::tic ( )
inline

Start tic/toc timer for time measurement between code instructions.

Returns
Current value of the timer (same value as time()).

Definition at line 4089 of file CImg.h.

unsigned long cimg_library_suffixed::cimg::time ( )
inline

Return the value of a system timer, with a millisecond precision.

Note
The timer does not necessarily starts from 0.

Definition at line 4068 of file CImg.h.

unsigned long cimg_library_suffixed::cimg::toc ( )
inline

End tic/toc timer and displays elapsed time from last call to tic().

Returns
Time elapsed (in ms) since last call to tic().

Definition at line 4097 of file CImg.h.

unsigned int cimg_library_suffixed::cimg::wait ( const unsigned int  milliseconds)
inline

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

Parameters
millisecondsNumber of milliseconds to wait for.
Returns
Number of milliseconds elapsed since the last call to wait().
Note
Same as sleep() with a waiting time computed with regard to the last call of wait(). It may be used to temporize your program properly, without wasting CPU time.

Definition at line 4135 of file CImg.h.

void cimg_library_suffixed::cimg::warn ( const char *const  format,
  ... 
)
inline

Display a warning message on the default output stream.

Parameters
formatC-string containing the format of the message, as with std::printf().
Note
If configuration macro cimg_strict_warnings is set, this function throws a CImgWarningException instead.
Warning
As the first argument is a format string, it is highly recommended to write
cimg::warn("%s",warning_message);
instead of
cimg::warn(warning_message);
if warning_message can be arbitrary, to prevent nasty memory access.

Definition at line 3883 of file CImg.h.

const char* cimg_library_suffixed::cimg::wget_path ( const char *const  user_path = 0,
const bool  reinit_path = false 
)
inline

Get/set path to the wget binary.

Parameters
user_pathSpecified path, or 0 to get the path currently used.
reinit_pathForce path to be recalculated (may take some time).
Returns
Path containing the wget binary.

Definition at line 5195 of file CImg.h.

Variable Documentation

const unsigned char cimg_library_suffixed::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 3807 of file CImg.h.