Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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< float >
 
struct  type< double >
 
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

void info ()
 Print informations about CImg environement variables. More...
 
unsigned int & exception_mode ()
 Get/set the current CImg exception mode. More...
 
int dialog (const char *title, const char *msg, const char *button1_txt="OK", const char *button2_txt=0, const char *button3_txt=0, const char *button4_txt=0, const char *button5_txt=0, const char *button6_txt=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. More...
 
void warn (const char *format,...)
 Display a warning message. 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. More...
 
template<typename T >
void swap (T &a, T &b)
 Exchange values of variables a and b. More...
 
template<typename T1 , typename T2 >
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2)
 Exchange values of variables (a1,a2) and (b1,b2). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
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). More...
 
bool endianness ()
 Return the current endianness of the CPU. More...
 
template<typename T >
void invert_endianness (T *const buffer, const unsigned int size)
 Invert endianness of a memory buffer. More...
 
template<typename T >
T & invert_endianness (T &a)
 Invert endianness of a single variable. More...
 
unsigned long time ()
 Get the value of a system timer with a millisecond precision. More...
 
void sleep (const unsigned int milliseconds)
 Sleep for a certain numbers of milliseconds. More...
 
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. More...
 
void srand ()
 
template<typename T >
const T rol (const T a, const unsigned int n=1)
 Return a left bitwise-rotated number. More...
 
template<typename T >
const T ror (const T a, const unsigned int n=1)
 Return a right bitwise-rotated number. More...
 
template<typename T >
abs (const T a)
 Return the absolute value of a number. More...
 
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. More...
 
int xln (const int x)
 Return 1 + log_10(x). More...
 
template<typename t1 , typename t2 >
cimg::superset< t1, t2 >::type min (const t1 &a, const t2 &b)
 Return the minimum value between two numbers. More...
 
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. More...
 
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. More...
 
template<typename t1 , typename t2 >
cimg::superset< t1, t2 >::type max (const t1 &a, const t2 &b)
 Return the maximum value between two numbers. More...
 
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. More...
 
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. More...
 
template<typename T >
sign (const T x)
 Return the sign of a number. More...
 
template<typename T >
unsigned int nearest_pow2 (const T x)
 Return the nearest power of 2 higher than a given number. More...
 
template<typename T >
mod (const T &x, const T &m)
 Return the modulo of a number. 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 minmod of two numbers. More...
 
double rand ()
 Return a random variable between [0,1] with respect to an uniform distribution. More...
 
double crand ()
 Return a random variable between [-1,1] with respect to an uniform distribution. More...
 
double grand ()
 Return a random variable following a gaussian distribution and a standard deviation of 1. More...
 
unsigned int prand (const double z)
 Return a random variable following a Poisson distribution of parameter z. More...
 
double round (const double x, const double y, const int rounding_type=0)
 Return a rounded number. More...
 
double _pythagore (double a, double b)
 
char uncase (const char x)
 Remove the 'case' of an ASCII character. More...
 
void uncase (char *const string)
 Remove the 'case' of a C string. More...
 
float atof (const char *const str)
 Read a float number from a C-string. More...
 
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. More...
 
int strcasecmp (const char *const s1, const char *const s2)
 Compare two C-strings, ignoring the case. More...
 
bool strpare (char *const s, const char delimiter=' ', const bool symmetric=false)
 Remove useless delimiters on the borders of a C-string. More...
 
void strclean (char *const s)
 Remove useless spaces and symmetric delimiters ', " and ` from a C-string. More...
 
void strescape (char *const s)
 Replace explicit escape sequences '' in C-strings. More...
 
const char * basename (const char *const s)
 Compute the basename of a filename. More...
 
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. More...
 
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. More...
 
const char * graphicsmagick_path (const char *const user_path=0, const bool reinit_path=false)
 Return path of the GraphicsMagick's gm tool. More...
 
const char * medcon_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path of the XMedcon tool. More...
 
const char * ffmpeg_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'ffmpeg' command. More...
 
const char * gzip_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'gzip' command. More...
 
const char * gunzip_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'gunzip' command. More...
 
const char * dcraw_path (const char *const user_path=0, const bool reinit_path=false)
 Return or set path to the 'dcraw' command. More...
 
const char * split_filename (const char *const filename, char *const body=0)
 Split a filename into two strings 'body' and 'extension'. More...
 
char * number_filename (const char *const filename, const int number, const unsigned int n, char *const string)
 Create a numbered version of a filename. More...
 
std::FILE * fopen (const char *const path, const char *const mode)
 Open a file, and check for possible errors. More...
 
int fclose (std::FILE *file)
 Close a file, and check for possible errors. More...
 
const char * file_type (std::FILE *const file, const char *const filename)
 Try to guess the image format of a filename, using its magick numbers. More...
 
template<typename T >
int fread (T *const ptr, const unsigned int nmemb, std::FILE *stream)
 Read file data, and check for possible errors. More...
 
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. More...
 
const char * option (const char *const name, const int argc, const char *const *const argv, const char *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 *title, const char *msg, const char *button1_txt, const char *button2_txt, const char *button3_txt, const char *button4_txt, const char *button5_txt, const char *button6_txt, const CImg< t > &logo, const bool centering=false)
 Display a dialog box, where a user can click standard buttons. More...
 

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 valuePI = 3.14159265358979323846
 Definition of the mathematical constant PI. More...
 
const unsigned int font7x11 [7 *11 *256/32]
 
const unsigned int font10x13 [256 *10 *13/32]
 
const unsigned int font8x17 [8 *17 *256/32]
 
const unsigned int font10x19 [10 *19 *256/32]
 
const unsigned int font12x24 [12 *24 *256/32]
 
const unsigned int font16x32 [16 *32 *256/32]
 
const unsigned int font19x38 [19 *38 *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

double cimg_library::cimg::_pythagore ( double  a,
double  b 
)
inline

Definition at line 4881 of file CImg.h.

References abs(), and sqrt().

Referenced by CImg< uintT >::SVD().

4881  {
4882  const double absa = cimg::abs(a), absb = cimg::abs(b);
4883  if (absa>absb) { const double tmp = absb/absa; return absa*std::sqrt(1.0+tmp*tmp); }
4884  else { const double tmp = absa/absb; return (absb==0?0:absb*std::sqrt(1.0+tmp*tmp)); }
4885  }
double sqrt(double d)
Definition: double.h:73
NT abs(const NT &x)
Definition: number_utils.h:130

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int cimg_library::cimg::_sleep ( const unsigned int  milliseconds,
unsigned long &  timer 
)
inline

Definition at line 4635 of file CImg.h.

References sleep(), and time().

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

4635  {
4636  if (!timer) timer = cimg::time();
4637  const unsigned long current_time = cimg::time();
4638  if (current_time>=timer+milliseconds) { timer = current_time; return 0; }
4639  const unsigned long time_diff = timer + milliseconds - current_time;
4640  timer = current_time + time_diff;
4641  cimg::sleep(time_diff);
4642  return (unsigned int)time_diff;
4643  }
unsigned long time()
Get the value of a system timer with a millisecond precision.
Definition: CImg.h:4605
void sleep(const unsigned int milliseconds)
Sleep for a certain numbers of milliseconds.
Definition: CImg.h:4624

Here is the call graph for this function:

Here is the caller graph for this function:

bool cimg_library::cimg::abs ( const bool  a)
inline

Definition at line 4690 of file CImg.h.

4690  {
4691  return a;
4692  }
unsigned char cimg_library::cimg::abs ( const unsigned char  a)
inline

Definition at line 4693 of file CImg.h.

4693  {
4694  return a;
4695  }
unsigned short cimg_library::cimg::abs ( const unsigned short  a)
inline

Definition at line 4696 of file CImg.h.

4696  {
4697  return a;
4698  }
unsigned int cimg_library::cimg::abs ( const unsigned int  a)
inline

Definition at line 4699 of file CImg.h.

4699  {
4700  return a;
4701  }
unsigned long cimg_library::cimg::abs ( const unsigned long  a)
inline

Definition at line 4702 of file CImg.h.

4702  {
4703  return a;
4704  }
double cimg_library::cimg::abs ( const double  a)
inline

Definition at line 4705 of file CImg.h.

4705  {
4706  return std::fabs(a);
4707  }
float cimg_library::cimg::abs ( const float  a)
inline

Definition at line 4708 of file CImg.h.

4708  {
4709  return (float)std::fabs((double)a);
4710  }
int cimg_library::cimg::abs ( const int  a)
inline

Definition at line 4711 of file CImg.h.

References NTS::abs().

4711  {
4712  return std::abs(a);
4713  }
NT abs(const NT &x)
Definition: number_utils.h:130

Here is the call graph for this function:

const char* cimg_library::cimg::argument ( const unsigned int  nb,
const int  argc,
const char *const *const  argv,
const unsigned int  nb_singles = 0,
  ... 
)
inline

Definition at line 5682 of file CImg.h.

References i, k, option(), and strcasecmp().

5682  {
5683  for (int k = 1, pos = 0; k<argc;) {
5684  const char *const item = argv[k];
5685  bool option = (*item=='-'), single_option = false;
5686  if (option) {
5687  va_list ap;
5688  va_start(ap,nb_singles);
5689  for (unsigned int i = 0; i<nb_singles; ++i) if (!cimg::strcasecmp(item,va_arg(ap,char*))) { single_option = true; break; }
5690  va_end(ap);
5691  }
5692  if (option) { ++k; if (!single_option) ++k; }
5693  else { if (pos++==(int)nb) return item; else ++k; }
5694  }
5695  return 0;
5696  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
j indices k indices k
Definition: Indexing.h:6
int strcasecmp(const char *const s1, const char *const s2)
Compare two C-strings, ignoring the case.
Definition: CImg.h:4928
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

float cimg_library::cimg::atof ( const char *const  str)
inline

Read a float 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 4905 of file CImg.h.

References x, and y.

Referenced by main(), option(), ComSwitch::parseValuesFromArguments(), Rocin::read_parameter_file(), remesh(), and Rocprop::set_option().

4905  {
4906  float x = 0,y = 1;
4907  if (!str) return 0; else { std::sscanf(str,"%g/%g",&x,&y); return x/y; }
4908  }
void int int REAL REAL * y
Definition: read.cpp:74
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

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

Compute the basename of a filename.

Definition at line 4989 of file CImg.h.

References cimg_file_separator.

Referenced by CImg< uintT >::_save_cpp(), and option().

4989  {
4990  const char *p = 0;
4991  for (const char *np = s; np>=s && (p=np); np = std::strchr(np,cimg_file_separator)+1) {}
4992  return p;
4993  }
#define cimg_file_separator
Definition: CImg.h:144
double s
Definition: blastest.C:80

Here is the caller graph for this function:

double cimg_library::cimg::crand ( )
inline

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

Definition at line 4840 of file CImg.h.

References rand().

Referenced by CImg< uintT >::noise().

4840  {
4841  return 1-2*cimg::rand();
4842  }
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
Definition: CImg.h:4833

Here is the call graph for this function:

Here is the caller graph for this function:

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

References fclose(), fopen(), and winformat_string().

Referenced by CImg< uintT >::load_dcraw_external().

5439  {
5440  static char *st_path = 0;
5441  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5442  if (user_path) {
5443  if (!st_path) st_path = new char[1024];
5444  std::memset(st_path,0,1024);
5445  std::strncpy(st_path,user_path,1023);
5446  } else if (!st_path) {
5447  st_path = new char[1024];
5448  std::memset(st_path,0,1024);
5449  bool path_found = false;
5450  std::FILE *file = 0;
5451 #if cimg_OS==2
5452  if (!path_found) {
5453  std::sprintf(st_path,".\\dcraw.exe");
5454  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5455  }
5456  if (!path_found) std::strcpy(st_path,"dcraw.exe");
5457 #else
5458  if (!path_found) {
5459  std::sprintf(st_path,"./dcraw");
5460  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5461  }
5462  if (!path_found) std::strcpy(st_path,"dcraw");
5463 #endif
5464  winformat_string(st_path);
5465  }
5466  return st_path;
5467  }
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

int dialog ( const char *  title,
const char *  msg,
const char *  button1_txt = "OK",
const char *  button2_txt = 0,
const char *  button3_txt = 0,
const char *  button4_txt = 0,
const char *  button5_txt = 0,
const char *  button6_txt = 0,
const bool  centering = false 
)
inline

Definition at line 37329 of file CImg.h.

37332  {
37333  return dialog(title,msg,button1_txt,button2_txt,button3_txt,button4_txt,button5_txt,button6_txt,
37334  CImg<unsigned char>::logo40x38(),centering);
37335  }
const unsigned char logo40x38[4576]
Definition: CImg.h:4440
int dialog(const char *title, const char *msg, const char *button1_txt="OK", const char *button2_txt=0, const char *button3_txt=0, const char *button4_txt=0, const char *button5_txt=0, const char *button6_txt=0, const bool centering=false)
Definition: CImg.h:37329
int cimg_library::cimg::dialog ( const char *  title,
const char *  msg,
const char *  button1_txt,
const char *  button2_txt,
const char *  button3_txt,
const char *  button4_txt,
const char *  button5_txt,
const char *  button6_txt,
const CImg< t > &  logo,
const bool  centering = false 
)
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_txt= Label of the 1st button.
button2_txt= Label of the 2nd button.
button3_txt= Label of the 3rd button.
button4_txt= Label of the 4th button.
button5_txt= Label of the 5th button.
button6_txt= Label of the 6th button.
logo= Logo image displayed at the left of the main message. This parameter is optional.
centering= Tell to center the dialog window on the screen.
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 37190 of file CImg.h.

References CImgDisplay::button, by, cimg_stdout, cimglist_for, CImgDisplay::dimx(), CImgList< T >::dimx(), CImgDisplay::dimy(), CImg< T >::display(), CImg< T >::draw_line(), CImgDisplay::is_closed, CImgDisplay::is_resized, CImgDisplay::key, keyARROWDOWN, keyARROWLEFT, keyARROWRIGHT, keyARROWUP, keyENTER, keyESC, keyTAB, max(), CImgDisplay::mouse_x, CImgDisplay::mouse_y, CImgDisplay::move(), CImgDisplay::resize(), CImgDisplay::screen_dimx(), CImgDisplay::screen_dimy(), CImg< T >::transfer_to(), CImgList< T >::transfer_to(), and CImgDisplay::wait().

37194  {
37195 #if cimg_display!=0
37196  const unsigned char
37197  black[] = { 0,0,0 }, white[] = { 255,255,255 }, gray[] = { 200,200,200 }, gray2[] = { 150,150,150 };
37198 
37199  // Create buttons and canvas graphics
37200  CImgList<unsigned char> buttons, cbuttons, sbuttons;
37201  if (button1_txt) { CImg<unsigned char>().draw_text(0,0,button1_txt,black,gray,1,13).transfer_to(buttons);
37202  if (button2_txt) { CImg<unsigned char>().draw_text(0,0,button2_txt,black,gray,1,13).transfer_to(buttons);
37203  if (button3_txt) { CImg<unsigned char>().draw_text(0,0,button3_txt,black,gray,1,13).transfer_to(buttons);
37204  if (button4_txt) { CImg<unsigned char>().draw_text(0,0,button4_txt,black,gray,1,13).transfer_to(buttons);
37205  if (button5_txt) { CImg<unsigned char>().draw_text(0,0,button5_txt,black,gray,1,13).transfer_to(buttons);
37206  if (button6_txt) { CImg<unsigned char>().draw_text(0,0,button6_txt,black,gray,1,13).transfer_to(buttons);
37207  }}}}}}
37208  if (!buttons.width)
37209  throw CImgArgumentException("cimg::dialog() : No buttons have been defined. At least one is necessary");
37210 
37211  unsigned int bw = 0, bh = 0;
37212  cimglist_for(buttons,l) { bw = cimg::max(bw,buttons[l].width); bh = cimg::max(bh,buttons[l].height); }
37213  bw+=8; bh+=8;
37214  if (bw<64) bw=64;
37215  if (bw>128) bw=128;
37216  if (bh<24) bh=24;
37217  if (bh>48) bh=48;
37218 
37219  CImg<unsigned char> button(bw,bh,1,3);
37220  button.draw_rectangle(0,0,bw-1,bh-1,gray);
37221  button.draw_line(0,0,bw-1,0,white).draw_line(0,bh-1,0,0,white);
37222  button.draw_line(bw-1,0,bw-1,bh-1,black).draw_line(bw-1,bh-1,0,bh-1,black);
37223  button.draw_line(1,bh-2,bw-2,bh-2,gray2).draw_line(bw-2,bh-2,bw-2,1,gray2);
37224  CImg<unsigned char> sbutton(bw,bh,1,3);
37225  sbutton.draw_rectangle(0,0,bw-1,bh-1,gray);
37226  sbutton.draw_line(0,0,bw-1,0,black).draw_line(bw-1,0,bw-1,bh-1,black);
37227  sbutton.draw_line(bw-1,bh-1,0,bh-1,black).draw_line(0,bh-1,0,0,black);
37228  sbutton.draw_line(1,1,bw-2,1,white).draw_line(1,bh-2,1,1,white);
37229  sbutton.draw_line(bw-2,1,bw-2,bh-2,black).draw_line(bw-2,bh-2,1,bh-2,black);
37230  sbutton.draw_line(2,bh-3,bw-3,bh-3,gray2).draw_line(bw-3,bh-3,bw-3,2,gray2);
37231  sbutton.draw_line(4,4,bw-5,4,black,1,0xAAAAAAAA,true).draw_line(bw-5,4,bw-5,bh-5,black,1,0xAAAAAAAA,false);
37232  sbutton.draw_line(bw-5,bh-5,4,bh-5,black,1,0xAAAAAAAA,false).draw_line(4,bh-5,4,4,black,1,0xAAAAAAAA,false);
37233  CImg<unsigned char> cbutton(bw,bh,1,3);
37234  cbutton.draw_rectangle(0,0,bw-1,bh-1,black).draw_rectangle(1,1,bw-2,bh-2,gray2).draw_rectangle(2,2,bw-3,bh-3,gray);
37235  cbutton.draw_line(4,4,bw-5,4,black,1,0xAAAAAAAA,true).draw_line(bw-5,4,bw-5,bh-5,black,1,0xAAAAAAAA,false);
37236  cbutton.draw_line(bw-5,bh-5,4,bh-5,black,1,0xAAAAAAAA,false).draw_line(4,bh-5,4,4,black,1,0xAAAAAAAA,false);
37237 
37238  cimglist_for(buttons,ll) {
37239  CImg<unsigned char>(cbutton).draw_image(1+(bw-buttons[ll].dimx())/2,1+(bh-buttons[ll].dimy())/2,buttons[ll]).
37240  transfer_to(cbuttons);
37241  CImg<unsigned char>(sbutton).draw_image((bw-buttons[ll].dimx())/2,(bh-buttons[ll].dimy())/2,buttons[ll]).
37242  transfer_to(sbuttons);
37243  CImg<unsigned char>(button).draw_image((bw-buttons[ll].dimx())/2,(bh-buttons[ll].dimy())/2,buttons[ll]).
37244  transfer_to(buttons[ll]);
37245  }
37246 
37247  CImg<unsigned char> canvas;
37248  if (msg) CImg<unsigned char>().draw_text(0,0,"%s",black,gray,1,13,msg).transfer_to(canvas);
37249  const unsigned int
37250  bwall = (buttons.width-1)*(12+bw) + bw,
37251  w = cimg::max(196U,36+logo.width+canvas.width, 24+bwall),
37252  h = cimg::max(96U,36+canvas.height+bh,36+logo.height+bh),
37253  lx = 12 + (canvas.data?0:((w-24-logo.width)/2)),
37254  ly = (h-12-bh-logo.height)/2,
37255  tx = lx+logo.width+12,
37256  ty = (h-12-bh-canvas.height)/2,
37257  bx = (w-bwall)/2,
37258  by = h-12-bh;
37259 
37260  if (canvas.data)
37261  canvas = CImg<unsigned char>(w,h,1,3).
37262  draw_rectangle(0,0,w-1,h-1,gray).
37263  draw_line(0,0,w-1,0,white).draw_line(0,h-1,0,0,white).
37264  draw_line(w-1,0,w-1,h-1,black).draw_line(w-1,h-1,0,h-1,black).
37265  draw_image(tx,ty,canvas);
37266  else
37267  canvas = CImg<unsigned char>(w,h,1,3).
37268  draw_rectangle(0,0,w-1,h-1,gray).
37269  draw_line(0,0,w-1,0,white).draw_line(0,h-1,0,0,white).
37270  draw_line(w-1,0,w-1,h-1,black).draw_line(w-1,h-1,0,h-1,black);
37271  if (logo.data) canvas.draw_image(lx,ly,logo);
37272 
37273  unsigned int xbuttons[6] = { 0 };
37274  cimglist_for(buttons,lll) { xbuttons[lll] = bx+(bw+12)*lll; canvas.draw_image(xbuttons[lll],by,buttons[lll]); }
37275 
37276  // Open window and enter events loop
37277  CImgDisplay disp(canvas,title?title:" ",0,false,centering?true:false);
37278  if (centering) disp.move((CImgDisplay::screen_dimx()-disp.dimx())/2,
37279  (CImgDisplay::screen_dimy()-disp.dimy())/2);
37280  bool stopflag = false, refresh = false;
37281  int oselected = -1, oclicked = -1, selected = -1, clicked = -1;
37282  while (!disp.is_closed && !stopflag) {
37283  if (refresh) {
37284  if (clicked>=0) CImg<unsigned char>(canvas).draw_image(xbuttons[clicked],by,cbuttons[clicked]).display(disp);
37285  else {
37286  if (selected>=0) CImg<unsigned char>(canvas).draw_image(xbuttons[selected],by,sbuttons[selected]).display(disp);
37287  else canvas.display(disp);
37288  }
37289  refresh = false;
37290  }
37291  disp.wait(15);
37292  if (disp.is_resized) disp.resize(disp);
37293 
37294  if (disp.button&1) {
37295  oclicked = clicked;
37296  clicked = -1;
37297  cimglist_for(buttons,l)
37298  if (disp.mouse_y>=(int)by && disp.mouse_y<(int)(by+bh) &&
37299  disp.mouse_x>=(int)xbuttons[l] && disp.mouse_x<(int)(xbuttons[l]+bw)) {
37300  clicked = selected = l;
37301  refresh = true;
37302  }
37303  if (clicked!=oclicked) refresh = true;
37304  } else if (clicked>=0) stopflag = true;
37305 
37306  if (disp.key) {
37307  oselected = selected;
37308  switch (disp.key) {
37309  case cimg::keyESC : selected=-1; stopflag=true; break;
37310  case cimg::keyENTER : if (selected<0) selected = 0; stopflag = true; break;
37311  case cimg::keyTAB :
37312  case cimg::keyARROWRIGHT :
37313  case cimg::keyARROWDOWN : selected = (selected+1)%buttons.width; break;
37314  case cimg::keyARROWLEFT :
37315  case cimg::keyARROWUP : selected = (selected+buttons.width-1)%buttons.width; break;
37316  }
37317  disp.key = 0;
37318  if (selected!=oselected) refresh = true;
37319  }
37320  }
37321  if (!disp) selected = -1;
37322  return selected;
37323 #else
37324  std::fprintf(cimg_stdout,"<%s>\n\n%s\n\n",title,msg);
37325  return -1+0*(int)(button1_txt-button2_txt+button3_txt-button4_txt+button5_txt-button6_txt+logo.width+(int)centering);
37326 #endif
37327  }
if(dy > dx)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed by
Definition: roccomf90.h:7
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
const unsigned int keyARROWLEFT
Definition: CImg.h:2742
const unsigned int keyESC
Definition: CImg.h:2671
const unsigned int keyENTER
Definition: CImg.h:2723
const unsigned int keyARROWUP
Definition: CImg.h:2733
const unsigned int keyARROWRIGHT
Definition: CImg.h:2744
#define cimglist_for(list, l)
Definition: CImg.h:1877
#define cimg_stdout
Definition: CImg.h:136
const unsigned int keyTAB
Definition: CImg.h:2699
const unsigned int keyARROWDOWN
Definition: CImg.h:2743

Here is the call graph for this function:

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

References x.

Referenced by CImgList< uintT >::_load_cimg(), CImg< uintT >::_load_inr(), CImg< uintT >::_load_png(), CImg< uintT >::_load_pnm(), CImgList< uintT >::_save_cimg(), CImg< uintT >::_save_inr(), CImg< uintT >::_save_png(), CImg< uintT >::_save_pnm(), info(), and CImgList< uintT >::load_parrec().

4572  {
4573  const int x = 1;
4574  return ((unsigned char*)&x)[0]?false:true;
4575  }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

double 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 37338 of file CImg.h.

References CImgList< T >::empty().

Referenced by main().

37338  {
37339  static const CImg<float> empty;
37340  return empty.eval(expression,x,y,z,v);
37341  }
void int int REAL REAL * y
Definition: read.cpp:74
boolean empty(T_VertexSet s)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
void int int int REAL REAL REAL * z
Definition: write.cpp:76
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int& cimg_library::cimg::exception_mode ( )
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 debug messages (quiet mode, but exceptions are still thrown).
  • 1 to display debug messages on standard error (console).
  • 2 to display debug messages in modal windows (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 1940 of file CImg.h.

References cimg_debug.

Referenced by CImg< uintT >::fill(), CImg< uintT >::load(), CImgList< uintT >::load(), CImgList< uintT >::load_ffmpeg_external(), CImg< uintT >::load_other(), CImg< uintT >::max(), CImg< uintT >::min(), CImg< uintT >::operator%=(), CImg< uintT >::operator&=(), CImg< uintT >::operator*=(), CImg< uintT >::operator+=(), CImg< uintT >::operator-=(), CImg< uintT >::operator/=(), CImg< uintT >::operator=(), CImg< uintT >::operator^=(), CImg< uintT >::operator|=(), CImg< uintT >::pow(), CImg< uintT >::save_other(), and warn().

1940 { static unsigned int mode = cimg_debug; return mode; }
#define cimg_debug
Definition: CImg.h:160

Here is the caller graph for this function:

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

Close a file, and check for possible errors.

Definition at line 5507 of file CImg.h.

References warn().

Referenced by CImg< uintT >::_display_object3d(), CImg< uintT >::_get_select(), CImg< uintT >::_load_analyze(), CImg< uintT >::_load_ascii(), CImg< uintT >::_load_bmp(), CImgList< uintT >::_load_cimg(), CImg< uintT >::_load_dlm(), CImg< uintT >::_load_inr(), CImg< uintT >::_load_jpeg(), CImg< uintT >::_load_off(), CImg< uintT >::_load_pandore(), CImg< uintT >::_load_png(), CImg< uintT >::_load_pnm(), CImg< uintT >::_load_raw(), CImg< uintT >::_load_rgb(), CImg< uintT >::_load_rgba(), CImgList< uintT >::_load_yuv(), CImg< uintT >::_save_ascii(), CImg< uintT >::_save_bmp(), CImgList< uintT >::_save_cimg(), CImg< uintT >::_save_cpp(), CImg< uintT >::_save_dlm(), CImgList< uintT >::_save_empty_cimg(), CImg< uintT >::_save_inr(), CImg< uintT >::_save_jpeg(), CImg< uintT >::_save_off(), CImg< uintT >::_save_pandore(), CImg< uintT >::_save_png(), CImg< uintT >::_save_pnm(), CImg< uintT >::_save_raw(), CImg< uintT >::_save_rgb(), CImg< uintT >::_save_rgba(), CImgList< uintT >::_save_yuv(), dcraw_path(), ffmpeg_path(), file_type(), fileExists(), Rocout::get_fname(), get_restart_time(), CImg< uintT >::get_select_graph(), graphicsmagick_path(), gunzip_path(), gzip_path(), imagemagick_path(), init_profiling(), CImg< uintT >::load_dcraw_external(), CImgList< uintT >::load_ffmpeg_external(), CImg< uintT >::load_graphicsmagick_external(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), CImg< uintT >::load_imagemagick_external(), CImg< uintT >::load_medcon_external(), CImgList< uintT >::load_parrec(), medcon_path(), Scheduler::print(), Coupling::print(), Roccom_base::print_profile(), read_general(), read_reg(), Coupling::read_restart_info(), MeshImpl::read_vtk(), CImg< uintT >::save_analyze(), CImgList< uintT >::save_ffmpeg_external(), CImg< uintT >::save_graphicsmagick_external(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), CImg< uintT >::save_imagemagick_external(), CImg< uintT >::save_medcon_external(), temporary_path(), FullyCoupling::update_distances(), FullyCoupling::update_integrals(), write_bounds(), Coupling::write_restart_info(), writeFlo(), writeMblock(), writeTop(), bcReader::~bcReader(), and FileTokenizer::~FileTokenizer().

5507  {
5508  if (!file) warn("cimg::fclose() : Cannot close (null) file");
5509  if (!file || file==stdin || file==stdout) return 0;
5510  const int errn = std::fclose(file);
5511  if (errn!=0) warn("cimg::fclose() : Error %d during file closing",errn);
5512  return errn;
5513  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507

Here is the call graph for this function:

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

References fclose(), fopen(), and winformat_string().

Referenced by CImgList< uintT >::load_ffmpeg_external().

5346  {
5347  static char *st_path = 0;
5348  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5349  if (user_path) {
5350  if (!st_path) st_path = new char[1024];
5351  std::memset(st_path,0,1024);
5352  std::strncpy(st_path,user_path,1023);
5353  } else if (!st_path) {
5354  st_path = new char[1024];
5355  std::memset(st_path,0,1024);
5356  bool path_found = false;
5357  std::FILE *file = 0;
5358 #if cimg_OS==2
5359  if (!path_found) {
5360  std::sprintf(st_path,".\\ffmpeg.exe");
5361  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5362  }
5363  if (!path_found) std::strcpy(st_path,"ffmpeg.exe");
5364 #else
5365  if (!path_found) {
5366  std::sprintf(st_path,"./ffmpeg");
5367  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5368  }
5369  if (!path_found) std::strcpy(st_path,"ffmpeg");
5370 #endif
5371  winformat_string(st_path);
5372  }
5373  return st_path;
5374  }
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

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 its magick numbers.

Definition at line 5516 of file CImg.h.

References fclose(), fopen(), and fread().

Referenced by CImg< uintT >::load().

5516  {
5517  static const char
5518  *const _pnm = "pnm",
5519  *const _bmp = "bmp",
5520  *const _gif = "gif",
5521  *const _jpeg = "jpeg",
5522  *const _off = "off",
5523  *const _pan = "pan",
5524  *const _png = "png",
5525  *const _tiff = "tiff";
5526  if (!filename && !file) throw CImgArgumentException("cimg::file_type() : Cannot load (null) filename.");
5527  std::FILE *const nfile = file?file:cimg::fopen(filename,"rb");
5528  const char *ftype = 0, *head;
5529  char header[2048] = { 0 }, item[1024] = { 0 };
5530  const unsigned char *const uheader = (unsigned char*)header;
5531  int err;
5532  const unsigned int siz = (unsigned int)std::fread(header,2048,1,nfile); // Read first 2048 bytes.
5533  if (!file) cimg::fclose(nfile);
5534  if (!ftype) { // Check for BMP format.
5535  if (header[0]=='B' && header[1]=='M') ftype = _bmp;
5536  }
5537  if (!ftype) { // Check for GIF format.
5538  if (header[0]=='G' && header[1]=='I' && header[2]=='F' && header[3]=='8' && header[5]=='a' &&
5539  (header[4]=='7' || header[4]=='9')) ftype = _gif;
5540  }
5541  if (!ftype) { // Check for JPEG format.
5542  if (uheader[0]==0xFF && uheader[1]==0xD8 && uheader[2]==0xFF) ftype = _jpeg;
5543  }
5544  if (!ftype) { // Check for OFF format.
5545  if (header[0]=='O' && header[1]=='F' && header[2]=='F' && header[3]=='\n') ftype = _off;
5546  }
5547  if (!ftype) { // Check for PAN format.
5548  if (header[0]=='P' && header[1]=='A' && header[2]=='N' && header[3]=='D' && header[4]=='O' &&
5549  header[5]=='R' && header[6]=='E') ftype = _pan;
5550  }
5551  if (!ftype) { // Check for PNG format.
5552  if (uheader[0]==0x89 && uheader[1]==0x50 && uheader[2]==0x4E && uheader[3]==0x47 &&
5553  uheader[4]==0x0D && uheader[5]==0x0A && uheader[6]==0x1A && uheader[7]==0x0A) ftype = _png;
5554  }
5555  if (!ftype) { // Check for PNM format.
5556  head = header;
5557  while (head<header+siz && (err=std::sscanf(head,"%1023[^\n]",item))!=EOF && (item[0]=='#' || !err))
5558  head+=1+(err?std::strlen(item):0);
5559  if (std::sscanf(item," P%d",&err)==1) ftype = _pnm;
5560  }
5561  if (!ftype) { // Check for TIFF format.
5562  if ((uheader[0]==0x49 && uheader[1]==0x49) || (uheader[0]==0x4D && uheader[1]==0x4D)) ftype = _tiff;
5563  }
5564  return ftype;
5565  }
int fread(T *const ptr, const unsigned int nmemb, std::FILE *stream)
Read file data, and check for possible errors.
Definition: CImg.h:5569
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

const char* cimg_library::cimg::filenamerand ( )
inline

Definition at line 4996 of file CImg.h.

References k, rand(), srand(), and v.

Referenced by CImg< uintT >::load_dcraw_external(), CImgList< uintT >::load_ffmpeg_external(), CImg< uintT >::load_graphicsmagick_external(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), CImg< uintT >::load_imagemagick_external(), CImg< uintT >::load_medcon_external(), CImgList< uintT >::save_ffmpeg_external(), CImg< uintT >::save_graphicsmagick_external(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), CImg< uintT >::save_imagemagick_external(), CImg< uintT >::save_medcon_external(), and temporary_path().

4996  {
4997  static char randomid[9] = { 0,0,0,0,0,0,0,0,0 };
4998  cimg::srand();
4999  for (unsigned int k = 0; k<8; ++k) {
5000  const int v = (int)std::rand()%3;
5001  randomid[k] = (char)(v==0?('0'+(std::rand()%10)):(v==1?('a'+(std::rand()%26)):('A'+(std::rand()%26))));
5002  }
5003  return randomid;
5004  }
void srand()
Definition: CImg.h:4658
j indices k indices k
Definition: Indexing.h:6
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
Definition: roccomf90.h:20
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
Definition: CImg.h:4833

Here is the call graph for this function:

Here is the caller graph for this function:

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

Open a file, and check for possible errors.

Definition at line 5494 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d(), CImg< uintT >::_get_select(), CImg< uintT >::_load_analyze(), CImg< uintT >::_load_ascii(), CImg< uintT >::_load_bmp(), CImgList< uintT >::_load_cimg(), CImg< uintT >::_load_dlm(), CImg< uintT >::_load_inr(), CImg< uintT >::_load_jpeg(), CImg< uintT >::_load_off(), CImg< uintT >::_load_pandore(), CImg< uintT >::_load_png(), CImg< uintT >::_load_pnm(), CImg< uintT >::_load_raw(), CImg< uintT >::_load_rgb(), CImg< uintT >::_load_rgba(), CImgList< uintT >::_load_yuv(), CImg< uintT >::_save_ascii(), CImg< uintT >::_save_bmp(), CImgList< uintT >::_save_cimg(), CImg< uintT >::_save_cpp(), CImg< uintT >::_save_dlm(), CImgList< uintT >::_save_empty_cimg(), CImg< uintT >::_save_inr(), CImg< uintT >::_save_jpeg(), CImg< uintT >::_save_off(), CImg< uintT >::_save_pandore(), CImg< uintT >::_save_png(), CImg< uintT >::_save_pnm(), CImg< uintT >::_save_raw(), CImg< uintT >::_save_rgb(), CImg< uintT >::_save_rgba(), CImgList< uintT >::_save_yuv(), Coupling::baseInit(), dcraw_path(), ffmpeg_path(), file_type(), fileExists(), Rocout::get_fname(), get_restart_time(), CImg< uintT >::get_select_graph(), graphicsmagick_path(), gunzip_path(), gzip_path(), imagemagick_path(), init_profiling(), CImg< uintT >::load_dcraw_external(), CImgList< uintT >::load_ffmpeg_external(), CImg< uintT >::load_graphicsmagick_external(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), CImg< uintT >::load_imagemagick_external(), CImg< uintT >::load_medcon_external(), CImgList< uintT >::load_parrec(), medcon_path(), Scheduler::print(), Coupling::print(), Roccom_base::print_profile(), Agent::read_by_control_file(), read_general(), read_reg(), Coupling::read_restart_info(), MeshImpl::read_vtk(), readBoundaries(), CImg< uintT >::save_analyze(), CImgList< uintT >::save_ffmpeg_external(), CImg< uintT >::save_graphicsmagick_external(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), CImg< uintT >::save_imagemagick_external(), CImg< uintT >::save_medcon_external(), temporary_path(), FullyCoupling::update_distances(), FullyCoupling::update_integrals(), write_bounds(), Coupling::write_restart_info(), writeFlo(), writeMblock(), and writeTop().

5494  {
5495  if(!path || !mode)
5496  throw CImgArgumentException("cimg::fopen() : File '%s', cannot open with mode '%s'.",
5497  path?path:"(null)",mode?mode:"(null)");
5498  if (path[0]=='-') return (mode[0]=='r')?stdin:stdout;
5499  std::FILE *dest = std::fopen(path,mode);
5500  if (!dest)
5501  throw CImgIOException("cimg::fopen() : File '%s', cannot open file %s",
5502  path,mode[0]=='r'?"for reading.":(mode[0]=='w'?"for writing.":"."),path);
5503  return dest;
5504  }
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494
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 5569 of file CImg.h.

References warn().

Referenced by CImg< uintT >::_load_analyze(), CImg< uintT >::_load_bmp(), CImg< uintT >::_load_pandore(), CImg< uintT >::_load_png(), CImg< uintT >::_load_pnm(), CImg< uintT >::_load_raw(), CImg< uintT >::_load_rgb(), CImg< uintT >::_load_rgba(), CImgList< uintT >::_load_yuv(), file_type(), FileTokenizer::get_newline(), FileTokenizer::get_string(), CImgList< uintT >::load_parrec(), readDouble(), gridgenBinaryFormatter< float >::readDouble(), readInt(), and gridgenBinaryFormatter< float >::readInt().

5569  {
5570  if (!ptr || nmemb<=0 || !stream)
5571  throw CImgArgumentException("cimg::fread() : Cannot read %u x %u bytes of file pointer '%p' in buffer '%p'",
5572  nmemb,sizeof(T),stream,ptr);
5573  const unsigned long wlimitT = 63*1024*1024, wlimit = wlimitT/sizeof(T);
5574  unsigned int toread = nmemb, alread = 0, ltoread = 0, lalread = 0;
5575  do {
5576  ltoread = (toread*sizeof(T))<wlimitT?toread:wlimit;
5577  lalread = (unsigned int)std::fread((void*)(ptr+alread),sizeof(T),ltoread,stream);
5578  alread+=lalread;
5579  toread-=lalread;
5580  } while (ltoread==lalread && toread>0);
5581  if (toread>0) warn("cimg::fread() : File reading problems, only %u/%u elements read",alread,nmemb);
5582  return alread;
5583  }
int fread(T *const ptr, const unsigned int nmemb, std::FILE *stream)
Read file data, and check for possible errors.
Definition: CImg.h:5569
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470

Here is the call graph for this function:

Here is the caller graph for this function:

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

References warn().

Referenced by CImg< uintT >::_save_bmp(), CImgList< uintT >::_save_cimg(), CImg< uintT >::_save_inr(), CImg< uintT >::_save_pnm(), CImg< uintT >::_save_raw(), CImg< uintT >::_save_rgb(), CImg< uintT >::_save_rgba(), CImgList< uintT >::_save_yuv(), CImg< uintT >::save_analyze(), and writeMblock().

5587  {
5588  if (!ptr || !stream)
5589  throw CImgArgumentException("cimg::fwrite() : Cannot write %u x %u bytes of file pointer '%p' from buffer '%p'",
5590  nmemb,sizeof(T),stream,ptr);
5591  if (nmemb<=0) return 0;
5592  const unsigned long wlimitT = 63*1024*1024, wlimit = wlimitT/sizeof(T);
5593  unsigned int towrite = nmemb, alwrite = 0, ltowrite = 0, lalwrite = 0;
5594  do {
5595  ltowrite = (towrite*sizeof(T))<wlimitT?towrite:wlimit;
5596  lalwrite = (unsigned int)std::fwrite((void*)(ptr+alwrite),sizeof(T),ltowrite,stream);
5597  alwrite+=lalwrite;
5598  towrite-=lalwrite;
5599  } while (ltowrite==lalwrite && towrite>0);
5600  if (towrite>0) warn("cimg::fwrite() : File writing problems, only %u/%u elements written",alwrite,nmemb);
5601  return alwrite;
5602  }
void warn(const char *format,...)
Display a warning message.
Definition: CImg.h:4470
int fwrite(const T *ptr, const unsigned int nmemb, std::FILE *stream)
Write data to a file, and check for possible errors.
Definition: CImg.h:5587

Here is the call graph for this function:

Here is the caller graph for this function:

double cimg_library::cimg::grand ( )
inline

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

Definition at line 4845 of file CImg.h.

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

Referenced by CImg< uintT >::draw_plasma(), CImg< T >::_cimg_math_parser::eval(), CImg< uintT >::noise(), and prand().

4845  {
4846  double x1, w;
4847  do {
4848  const double x2 = 2*cimg::rand() - 1.0;
4849  x1 = 2*cimg::rand()-1.0;
4850  w = x1*x1 + x2*x2;
4851  } while (w<=0 || w>=1.0);
4852  return x1*std::sqrt((-2*std::log(w))/w);
4853  }
double sqrt(double d)
Definition: double.h:73
CImg< _cimg_Tfloat > log(const CImg< T > &instance)
Definition: CImg.h:6021
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
Definition: CImg.h:4833

Here is the call graph for this function:

Here is the caller graph for this function:

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

References fclose(), fopen(), k, and winformat_string().

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

5198  {
5199  static char *st_path = 0;
5200  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5201  if (user_path) {
5202  if (!st_path) st_path = new char[1024];
5203  std::memset(st_path,0,1024);
5204  std::strncpy(st_path,user_path,1023);
5205  } else if (!st_path) {
5206  st_path = new char[1024];
5207  std::memset(st_path,0,1024);
5208  bool path_found = false;
5209  std::FILE *file = 0;
5210 #if cimg_OS==2
5211  const char* pf_path = programfiles_path();
5212  if (!path_found) {
5213  std::sprintf(st_path,".\\gm.exe");
5214  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5215  }
5216  for (int k = 32; k>=10 && !path_found; --k) {
5217  std::sprintf(st_path,"%s\\GRAPHI~1.%.2d-\\gm.exe",pf_path,k);
5218  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5219  }
5220  for (int k = 9; k>=0 && !path_found; --k) {
5221  std::sprintf(st_path,"%s\\GRAPHI~1.%d-Q\\gm.exe",pf_path,k);
5222  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5223  }
5224  for (int k = 32; k>=0 && !path_found; --k) {
5225  std::sprintf(st_path,"%s\\GRAPHI~1.%d\\gm.exe",pf_path,k);
5226  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5227  }
5228  for (int k = 32; k>=10 && !path_found; --k) {
5229  std::sprintf(st_path,"%s\\GRAPHI~1.%.2d-\\VISUA~1\\BIN\\gm.exe",pf_path,k);
5230  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5231  }
5232  for (int k = 9; k>=0 && !path_found; --k) {
5233  std::sprintf(st_path,"%s\\GRAPHI~1.%d-Q\\VISUA~1\\BIN\\gm.exe",pf_path,k);
5234  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5235  }
5236  for (int k = 32; k>=0 && !path_found; --k) {
5237  std::sprintf(st_path,"%s\\GRAPHI~1.%d\\VISUA~1\\BIN\\gm.exe",pf_path,k);
5238  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5239  }
5240  for (int k = 32; k>=10 && !path_found; --k) {
5241  std::sprintf(st_path,"C:\\GRAPHI~1.%.2d-\\gm.exe",k);
5242  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5243  }
5244  for (int k = 9; k>=0 && !path_found; --k) {
5245  std::sprintf(st_path,"C:\\GRAPHI~1.%d-Q\\gm.exe",k);
5246  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5247  }
5248  for (int k = 32; k>=0 && !path_found; --k) {
5249  std::sprintf(st_path,"C:\\GRAPHI~1.%d\\gm.exe",k);
5250  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5251  }
5252  for (int k = 32; k>=10 && !path_found; --k) {
5253  std::sprintf(st_path,"C:\\GRAPHI~1.%.2d-\\VISUA~1\\BIN\\gm.exe",k);
5254  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5255  }
5256  for (int k = 9; k>=0 && !path_found; --k) {
5257  std::sprintf(st_path,"C:\\GRAPHI~1.%d-Q\\VISUA~1\\BIN\\gm.exe",k);
5258  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5259  }
5260  for (int k = 32; k>=0 && !path_found; --k) {
5261  std::sprintf(st_path,"C:\\GRAPHI~1.%d\\VISUA~1\\BIN\\gm.exe",k);
5262  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5263  }
5264  for (int k = 32; k>=10 && !path_found; --k) {
5265  std::sprintf(st_path,"D:\\GRAPHI~1.%.2d-\\gm.exe",k);
5266  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5267  }
5268  for (int k = 9; k>=0 && !path_found; --k) {
5269  std::sprintf(st_path,"D:\\GRAPHI~1.%d-Q\\gm.exe",k);
5270  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5271  }
5272  for (int k = 32; k>=0 && !path_found; --k) {
5273  std::sprintf(st_path,"D:\\GRAPHI~1.%d\\gm.exe",k);
5274  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5275  }
5276  for (int k = 32; k>=10 && !path_found; --k) {
5277  std::sprintf(st_path,"D:\\GRAPHI~1.%.2d-\\VISUA~1\\BIN\\gm.exe",k);
5278  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5279  }
5280  for (int k = 9; k>=0 && !path_found; --k) {
5281  std::sprintf(st_path,"D:\\GRAPHI~1.%d-Q\\VISUA~1\\BIN\\gm.exe",k);
5282  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5283  }
5284  for (int k = 32; k>=0 && !path_found; --k) {
5285  std::sprintf(st_path,"D:\\GRAPHI~1.%d\\VISUA~1\\BIN\\gm.exe",k);
5286  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5287  }
5288  if (!path_found) std::strcpy(st_path,"gm.exe");
5289 #else
5290  if (!path_found) {
5291  std::sprintf(st_path,"./gm");
5292  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5293  }
5294  if (!path_found) std::strcpy(st_path,"gm");
5295 #endif
5296  winformat_string(st_path);
5297  }
5298  return st_path;
5299  }
j indices k indices k
Definition: Indexing.h:6
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

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

References fclose(), fopen(), and winformat_string().

Referenced by CImg< uintT >::load_gzip_external(), and CImgList< uintT >::load_gzip_external().

5408  {
5409  static char *st_path = 0;
5410  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5411  if (user_path) {
5412  if (!st_path) st_path = new char[1024];
5413  std::memset(st_path,0,1024);
5414  std::strncpy(st_path,user_path,1023);
5415  } else if (!st_path) {
5416  st_path = new char[1024];
5417  std::memset(st_path,0,1024);
5418  bool path_found = false;
5419  std::FILE *file = 0;
5420 #if cimg_OS==2
5421  if (!path_found) {
5422  std::sprintf(st_path,".\\gunzip.exe");
5423  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5424  }
5425  if (!path_found) std::strcpy(st_path,"gunzip.exe");
5426 #else
5427  if (!path_found) {
5428  std::sprintf(st_path,"./gunzip");
5429  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5430  }
5431  if (!path_found) std::strcpy(st_path,"gunzip");
5432 #endif
5433  winformat_string(st_path);
5434  }
5435  return st_path;
5436  }
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

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

References fclose(), fopen(), and winformat_string().

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

5377  {
5378  static char *st_path = 0;
5379  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5380  if (user_path) {
5381  if (!st_path) st_path = new char[1024];
5382  std::memset(st_path,0,1024);
5383  std::strncpy(st_path,user_path,1023);
5384  } else if (!st_path) {
5385  st_path = new char[1024];
5386  std::memset(st_path,0,1024);
5387  bool path_found = false;
5388  std::FILE *file = 0;
5389 #if cimg_OS==2
5390  if (!path_found) {
5391  std::sprintf(st_path,".\\gzip.exe");
5392  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5393  }
5394  if (!path_found) std::strcpy(st_path,"gzip.exe");
5395 #else
5396  if (!path_found) {
5397  std::sprintf(st_path,"./gzip");
5398  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5399  }
5400  if (!path_found) std::strcpy(st_path,"gzip");
5401 #endif
5402  winformat_string(st_path);
5403  }
5404  return st_path;
5405  }
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

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

References fclose(), fopen(), k, and winformat_string().

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

5094  {
5095  static char *st_path = 0;
5096  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5097  if (user_path) {
5098  if (!st_path) st_path = new char[1024];
5099  std::memset(st_path,0,1024);
5100  std::strncpy(st_path,user_path,1023);
5101  } else if (!st_path) {
5102  st_path = new char[1024];
5103  std::memset(st_path,0,1024);
5104  bool path_found = false;
5105  std::FILE *file = 0;
5106 #if cimg_OS==2
5107  const char *pf_path = programfiles_path();
5108  if (!path_found) {
5109  std::sprintf(st_path,".\\convert.exe");
5110  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5111  }
5112  for (int k = 32; k>=10 && !path_found; --k) {
5113  std::sprintf(st_path,"%s\\IMAGEM~1.%.2d-\\convert.exe",pf_path,k);
5114  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5115  }
5116  for (int k = 9; k>=0 && !path_found; --k) {
5117  std::sprintf(st_path,"%s\\IMAGEM~1.%d-Q\\convert.exe",pf_path,k);
5118  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5119  }
5120  for (int k = 32; k>=0 && !path_found; --k) {
5121  std::sprintf(st_path,"%s\\IMAGEM~1.%d\\convert.exe",pf_path,k);
5122  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5123  }
5124  for (int k = 32; k>=10 && !path_found; --k) {
5125  std::sprintf(st_path,"%s\\IMAGEM~1.%.2d-\\VISUA~1\\BIN\\convert.exe",pf_path,k);
5126  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5127  }
5128  for (int k = 9; k>=0 && !path_found; --k) {
5129  std::sprintf(st_path,"%s\\IMAGEM~1.%d-Q\\VISUA~1\\BIN\\convert.exe",pf_path,k);
5130  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5131  }
5132  for (int k = 32; k>=0 && !path_found; --k) {
5133  std::sprintf(st_path,"%s\\IMAGEM~1.%d\\VISUA~1\\BIN\\convert.exe",pf_path,k);
5134  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5135  }
5136  for (int k = 32; k>=10 && !path_found; --k) {
5137  std::sprintf(st_path,"C:\\IMAGEM~1.%.2d-\\convert.exe",k);
5138  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5139  }
5140  for (int k = 9; k>=0 && !path_found; --k) {
5141  std::sprintf(st_path,"C:\\IMAGEM~1.%d-Q\\convert.exe",k);
5142  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5143  }
5144  for (int k = 32; k>=0 && !path_found; --k) {
5145  std::sprintf(st_path,"C:\\IMAGEM~1.%d\\convert.exe",k);
5146  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5147  }
5148  for (int k = 32; k>=10 && !path_found; --k) {
5149  std::sprintf(st_path,"C:\\IMAGEM~1.%.2d-\\VISUA~1\\BIN\\convert.exe",k);
5150  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5151  }
5152  for (int k = 9; k>=0 && !path_found; --k) {
5153  std::sprintf(st_path,"C:\\IMAGEM~1.%d-Q\\VISUA~1\\BIN\\convert.exe",k);
5154  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5155  }
5156  for (int k = 32; k>=0 && !path_found; --k) {
5157  std::sprintf(st_path,"C:\\IMAGEM~1.%d\\VISUA~1\\BIN\\convert.exe",k);
5158  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5159  }
5160  for (int k = 32; k>=10 && !path_found; --k) {
5161  std::sprintf(st_path,"D:\\IMAGEM~1.%.2d-\\convert.exe",k);
5162  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5163  }
5164  for (int k = 9; k>=0 && !path_found; --k) {
5165  std::sprintf(st_path,"D:\\IMAGEM~1.%d-Q\\convert.exe",k);
5166  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5167  }
5168  for (int k = 32; k>=0 && !path_found; --k) {
5169  std::sprintf(st_path,"D:\\IMAGEM~1.%d\\convert.exe",k);
5170  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5171  }
5172  for (int k = 32; k>=10 && !path_found; --k) {
5173  std::sprintf(st_path,"D:\\IMAGEM~1.%.2d-\\VISUA~1\\BIN\\convert.exe",k);
5174  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5175  }
5176  for (int k = 9; k>=0 && !path_found; --k) {
5177  std::sprintf(st_path,"D:\\IMAGEM~1.%d-Q\\VISUA~1\\BIN\\convert.exe",k);
5178  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5179  }
5180  for (int k = 32; k>=0 && !path_found; --k) {
5181  std::sprintf(st_path,"D:\\IMAGEM~1.%d\\VISUA~1\\BIN\\convert.exe",k);
5182  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5183  }
5184  if (!path_found) std::strcpy(st_path,"convert.exe");
5185 #else
5186  if (!path_found) {
5187  std::sprintf(st_path,"./convert");
5188  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5189  }
5190  if (!path_found) std::strcpy(st_path,"convert");
5191 #endif
5192  winformat_string(st_path);
5193  }
5194  return st_path;
5195  }
j indices k indices k
Definition: Indexing.h:6
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

void info ( )
inline

Print informations about CImg environement variables.

Printing is done on the standard error output.

Definition at line 5702 of file CImg.h.

References cimg_debug, cimg_display, cimg_OS, cimg_stdout, cimg_version, endianness(), graphicsmagick_path(), imagemagick_path(), medcon_path(), t_bold, t_green, t_normal, t_red, and temporary_path().

Referenced by FaceOffset_3::compute_eigenvectors(), Rocmop::compute_eigenvectors(), PatchData::have_computed_info(), main(), and PatchData::note_have_info().

5702  {
5703  char tmp[1024] = { 0 };
5704  std::fprintf(cimg_stdout,"\n %sCImg Library %u.%u.%u%s, compiled %s ( %s ) with the following flags :\n\n",
5706  cimg::t_normal,__DATE__,__TIME__);
5707 
5708  std::fprintf(cimg_stdout," > Operating System : %s%-13s%s %s('cimg_OS'=%d)%s\n",
5709  cimg::t_bold,
5710  cimg_OS==1?"Unix":(cimg_OS==2?"Windows":"Unknow"),
5712  cimg_OS,
5713  cimg::t_normal);
5714 
5715  std::fprintf(cimg_stdout," > CPU endianness : %s%s Endian%s\n",
5716  cimg::t_bold,
5717  cimg::endianness()?"Big":"Little",
5718  cimg::t_normal);
5719 
5720  std::fprintf(cimg_stdout," > Debug messages : %s%-13s%s %s('cimg_debug'=%d)%s\n",
5721  cimg::t_bold,
5722  cimg_debug==0?"Quiet":(cimg_debug==1?"Console":(cimg_debug==2?"Dialog":(cimg_debug==3?"Console+Warnings":"Dialog+Warnings"))),
5724  cimg_debug,
5725  cimg::t_normal);
5726 
5727  std::fprintf(cimg_stdout," > Stricts warnings : %s%-13s%s %s('cimg_strict_warnings' %s)%s\n",
5728  cimg::t_bold,
5729 #ifdef cimg_strict_warnings
5730  "Yes",cimg::t_normal,cimg::t_green,"defined",
5731 #else
5732  "No",cimg::t_normal,cimg::t_green,"undefined",
5733 #endif
5734  cimg::t_normal);
5735 
5736  std::fprintf(cimg_stdout," > Using VT100 messages : %s%-13s%s %s('cimg_use_vt100' %s)%s\n",
5737  cimg::t_bold,
5738 #ifdef cimg_use_vt100
5739  "Yes",cimg::t_normal,cimg::t_green,"defined",
5740 #else
5741  "No",cimg::t_normal,cimg::t_green,"undefined",
5742 #endif
5743  cimg::t_normal);
5744 
5745  std::fprintf(cimg_stdout," > Display type : %s%-13s%s %s('cimg_display'=%d)%s\n",
5746  cimg::t_bold,
5747  cimg_display==0?"No display":
5748  (cimg_display==1?"X11":
5749  (cimg_display==2?"Windows GDI":
5750  (cimg_display==3?"Carbon":"Unknow"))),
5752  cimg_display,
5753  cimg::t_normal);
5754 
5755 #if cimg_display==1
5756  std::fprintf(cimg_stdout," > Using XShm for X11 : %s%-13s%s %s('cimg_use_xshm' %s)%s\n",
5757  cimg::t_bold,
5758 #ifdef cimg_use_xshm
5759  "Yes",cimg::t_normal,cimg::t_green,"defined",
5760 #else
5761  "No",cimg::t_normal,cimg::t_green,"undefined",
5762 #endif
5763  cimg::t_normal);
5764 
5765  std::fprintf(cimg_stdout," > Using XRand for X11 : %s%-13s%s %s('cimg_use_xrandr' %s)%s\n",
5766  cimg::t_bold,
5767 #ifdef cimg_use_xrandr
5768  "Yes",cimg::t_normal,cimg::t_green,"defined",
5769 #else
5770  "No",cimg::t_normal,cimg::t_green,"undefined",
5771 #endif
5772  cimg::t_normal);
5773 #endif
5774  std::fprintf(cimg_stdout," > Using OpenMP : %s%-13s%s %s('cimg_use_openmp' %s)%s\n",
5775  cimg::t_bold,
5776 #ifdef cimg_use_openmp
5777  "Yes",cimg::t_normal,cimg::t_green,"defined",
5778 #else
5779  "No",cimg::t_normal,cimg::t_green,"undefined",
5780 #endif
5781  cimg::t_normal);
5782  std::fprintf(cimg_stdout," > Using PNG library : %s%-13s%s %s('cimg_use_png' %s)%s\n",
5783  cimg::t_bold,
5784 #ifdef cimg_use_png
5785  "Yes",cimg::t_normal,cimg::t_green,"defined",
5786 #else
5787  "No",cimg::t_normal,cimg::t_green,"undefined",
5788 #endif
5789  cimg::t_normal);
5790  std::fprintf(cimg_stdout," > Using JPEG library : %s%-13s%s %s('cimg_use_jpeg' %s)%s\n",
5791  cimg::t_bold,
5792 #ifdef cimg_use_jpeg
5793  "Yes",cimg::t_normal,cimg::t_green,"defined",
5794 #else
5795  "No",cimg::t_normal,cimg::t_green,"undefined",
5796 #endif
5797  cimg::t_normal);
5798 
5799  std::fprintf(cimg_stdout," > Using TIFF library : %s%-13s%s %s('cimg_use_tiff' %s)%s\n",
5800  cimg::t_bold,
5801 #ifdef cimg_use_tiff
5802  "Yes",cimg::t_normal,cimg::t_green,"defined",
5803 #else
5804  "No",cimg::t_normal,cimg::t_green,"undefined",
5805 #endif
5806  cimg::t_normal);
5807 
5808  std::fprintf(cimg_stdout," > Using Magick++ library : %s%-13s%s %s('cimg_use_magick' %s)%s\n",
5809  cimg::t_bold,
5810 #ifdef cimg_use_magick
5811  "Yes",cimg::t_normal,cimg::t_green,"defined",
5812 #else
5813  "No",cimg::t_normal,cimg::t_green,"undefined",
5814 #endif
5815  cimg::t_normal);
5816 
5817  std::fprintf(cimg_stdout," > Using FFTW3 library : %s%-13s%s %s('cimg_use_fftw3' %s)%s\n",
5818  cimg::t_bold,
5819 #ifdef cimg_use_fftw3
5820  "Yes",cimg::t_normal,cimg::t_green,"defined",
5821 #else
5822  "No",cimg::t_normal,cimg::t_green,"undefined",
5823 #endif
5824  cimg::t_normal);
5825 
5826  std::fprintf(cimg_stdout," > Using LAPACK library : %s%-13s%s %s('cimg_use_lapack' %s)%s\n",
5827  cimg::t_bold,
5828 #ifdef cimg_use_lapack
5829  "Yes",cimg::t_normal,cimg::t_green,"defined",
5830 #else
5831  "No",cimg::t_normal,cimg::t_green,"undefined",
5832 #endif
5833  cimg::t_normal);
5834 
5835  std::sprintf(tmp,"\"%.1020s\"",cimg::imagemagick_path());
5836  std::fprintf(cimg_stdout," > Path of ImageMagick : %s%-13s%s\n",
5837  cimg::t_bold,
5838  tmp,
5839  cimg::t_normal);
5840 
5841  std::sprintf(tmp,"\"%.1020s\"",cimg::graphicsmagick_path());
5842  std::fprintf(cimg_stdout," > Path of GraphicsMagick : %s%-13s%s\n",
5843  cimg::t_bold,
5844  tmp,
5845  cimg::t_normal);
5846 
5847  std::sprintf(tmp,"\"%.1020s\"",cimg::medcon_path());
5848  std::fprintf(cimg_stdout," > Path of 'medcon' : %s%-13s%s\n",
5849  cimg::t_bold,
5850  tmp,
5851  cimg::t_normal);
5852 
5853  std::sprintf(tmp,"\"%.1020s\"",cimg::temporary_path());
5854  std::fprintf(cimg_stdout," > Temporary path : %s%-13s%s\n",
5855  cimg::t_bold,
5856  tmp,
5857  cimg::t_normal);
5858 
5859  std::fprintf(cimg_stdout,"\n");
5860  }
#define cimg_display
Definition: CImg.h:172
#define cimg_OS
Definition: CImg.h:96
bool endianness()
Return the current endianness of the CPU.
Definition: CImg.h:4572
const char *const *const t_bold
Definition: CImg.h:1924
const char * graphicsmagick_path(const char *const user_path=0, const bool reinit_path=false)
Return path of the GraphicsMagick&#39;s gm tool.
Definition: CImg.h:5198
#define cimg_version
Definition: CImg.h:56
const char t_normal[]
Definition: CImg.h:1923
const char * temporary_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to store temporary files.
Definition: CImg.h:5017
const char * medcon_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path of the XMedcon tool.
Definition: CImg.h:5302
#define cimg_debug
Definition: CImg.h:160
const char *const *const *const *const t_green
Definition: CImg.h:1925
const char *const t_red
Definition: CImg.h:1924
#define cimg_stdout
Definition: CImg.h:136
const char * imagemagick_path(const char *const user_path=0, const bool reinit_path=false)
Return or set path to the ImageMagick&#39;s convert tool.
Definition: CImg.h:5094

Here is the call graph for this function:

Here is the caller graph for this function:

void cimg_library::cimg::invert_endianness ( T *const  buffer,
const unsigned int  size 
)
inline

Invert endianness of a memory buffer.

Definition at line 4579 of file CImg.h.

References i, and swap().

Referenced by CImg< uintT >::_load_analyze(), CImg< uintT >::_load_pandore(), CImg< uintT >::_load_png(), CImg< uintT >::_load_pnm(), CImg< uintT >::_load_raw(), CImgList< uintT >::_save_cimg(), CImg< uintT >::_save_png(), CImg< uintT >::_save_pnm(), invert_endianness(), CImg< uintT >::invert_endianness(), and CImgList< uintT >::load_parrec().

4579  {
4580  if (size) switch (sizeof(T)) {
4581  case 1 : break;
4582  case 2 : { for (unsigned short *ptr = (unsigned short*)buffer+size; ptr>(unsigned short*)buffer; ) {
4583  const unsigned short val = *(--ptr);
4584  *ptr = (unsigned short)((val>>8)|((val<<8)));
4585  }} break;
4586  case 4 : { for (unsigned int *ptr = (unsigned int*)buffer+size; ptr>(unsigned int*)buffer; ) {
4587  const unsigned int val = *(--ptr);
4588  *ptr = (val>>24)|((val>>8)&0xff00)|((val<<8)&0xff0000)|(val<<24);
4589  }} break;
4590  default : { for (T* ptr = buffer+size; ptr>buffer; ) {
4591  unsigned char *pb = (unsigned char*)(--ptr), *pe = pb + sizeof(T);
4592  for (int i = 0; i<(int)sizeof(T)/2; ++i) swap(*(pb++),*(--pe));
4593  }}
4594  }
4595  }
void swap(int &a, int &b)
Definition: buildface.cpp:88
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

Here is the caller graph for this function:

T& cimg_library::cimg::invert_endianness ( T &  a)
inline

Invert endianness of a single variable.

Definition at line 4599 of file CImg.h.

References invert_endianness().

4599  {
4600  invert_endianness(&a,1);
4601  return a;
4602  }
void invert_endianness(T *const buffer, const unsigned int size)
Invert endianness of a memory buffer.
Definition: CImg.h:4579

Here is the call graph for this function:

cimg::superset<t1,t2>::type cimg_library::cimg::max ( const t1 &  a,
const t2 &  b 
)
inline

Return the maximum value between two numbers.

Definition at line 4749 of file CImg.h.

Referenced by CImg< uintT >::_cubic_atX(), CImg< uintT >::_cubic_atXY(), CImg< uintT >::_display(), CImg< uintT >::_display_object3d(), CImg< uintT >::_draw_ellipse(), CImg< uintT >::_draw_object3d(), CImg< uintT >::_draw_scanline(), CImg< uintT >::_load_dlm(), CImgList< uintT >::assign(), CImg< uintT >::autocrop(), CImg< uintT >::blur(), CImg< uintT >::blur_bilateral(), CImgList< uintT >::CImgList(), CImg< uintT >::cubic_atX(), CImg< uintT >::cubic_atXY(), dialog(), CImg< uintT >::distance_hamilton(), CImg< uintT >::draw_fill(), CImg< uintT >::draw_gaussian(), CImg< uintT >::draw_image(), CImg< uintT >::draw_line(), CImg< uintT >::draw_mandelbrot(), CImg< uintT >::draw_plasma(), CImg< uintT >::draw_point(), CImg< uintT >::draw_quiver(), CImg< uintT >::draw_rectangle(), CImg< uintT >::draw_spline(), CImg< uintT >::draw_triangle(), CImg< uintT >::edge_tensors(), CImg< T >::_cimg_math_parser::eval(), CImgList< uintT >::get_append(), CImg< uintT >::get_blur_patch(), CImg< uintT >::get_displacement_field(), CImg< uintT >::get_distance(), CImg< uintT >::get_identity_matrix(), CImg< uintT >::get_resize(), CImg< uintT >::get_rotate(), CImg< uintT >::identity_matrix(), CImg< uintT >::load_tiff(), max(), CImg< uintT >::max(), CImg< uintT >::resize_object3d(), CImg< uintT >::RGBtoHSL(), CImg< uintT >::RGBtoHSV(), CImg< uintT >::sharpen(), and CImg< uintT >::SVD().

4749  {
4750  typedef typename cimg::superset<t1,t2>::type t1t2;
4751  return (t1t2)(a>=b?a:b);
4752  }

Here is the caller graph for this function:

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

References max().

4756  {
4757  typedef typename cimg::superset2<t1,t2,t3>::type t1t2t3;
4758  return (t1t2t3)cimg::max(cimg::max(a,b),c);
4759  }
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354

Here is the call graph for this function:

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

References max().

4763  {
4764  typedef typename cimg::superset3<t1,t2,t3,t4>::type t1t2t3t4;
4765  return (t1t2t3t4)cimg::max(cimg::max(a,b,c),d);
4766  }
const NT & d
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354

Here is the call graph for this function:

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

References fclose(), fopen(), and winformat_string().

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

5302  {
5303  static char *st_path = 0;
5304  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5305  if (user_path) {
5306  if (!st_path) st_path = new char[1024];
5307  std::memset(st_path,0,1024);
5308  std::strncpy(st_path,user_path,1023);
5309  } else if (!st_path) {
5310  st_path = new char[1024];
5311  std::memset(st_path,0,1024);
5312  bool path_found = false;
5313  std::FILE *file = 0;
5314 #if cimg_OS==2
5315  const char* pf_path = programfiles_path();
5316  if (!path_found) {
5317  std::sprintf(st_path,".\\medcon.bat");
5318  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5319  }
5320  if (!path_found) {
5321  std::sprintf(st_path,".\\medcon.exe");
5322  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5323  }
5324  if (!path_found) {
5325  std::sprintf(st_path,"%s\\XMedCon\\bin\\medcon.bat",pf_path);
5326  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5327  }
5328  if (!path_found) {
5329  std::sprintf(st_path,"%s\\XMedCon\\bin\\medcon.exe",pf_path);
5330  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5331  }
5332  if (!path_found) std::strcpy(st_path,"medcon.bat");
5333 #else
5334  if (!path_found) {
5335  std::sprintf(st_path,"./medcon");
5336  if ((file=std::fopen(st_path,"r"))!=0) { std::fclose(file); path_found = true; }
5337  }
5338  if (!path_found) std::strcpy(st_path,"medcon");
5339 #endif
5340  winformat_string(st_path);
5341  }
5342  return st_path;
5343  }
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

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

References min().

4735  {
4736  typedef typename cimg::superset2<t1,t2,t3>::type t1t2t3;
4737  return (t1t2t3)cimg::min(cimg::min(a,b),c);
4738  }
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346

Here is the call graph for this function:

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

References min().

4742  {
4743  typedef typename cimg::superset3<t1,t2,t3,t4>::type t1t2t3t4;
4744  return (t1t2t3t4)cimg::min(cimg::min(a,b,c),d);
4745  }
const NT & d
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346

Here is the call graph for this function:

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

Referenced by CImg< uintT >::sharpen().

4828  {
4829  return a*b<=0?0:(a>0?(a<b?a:b):(a<b?b:a));
4830  }

Here is the caller graph for this function:

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

References dx.

Referenced by CImg< uintT >::draw_grid(), CImg< T >::_cimg_math_parser::eval(), CImg< uintT >::get_rotate(), CImg< uintT >::get_warp(), Coupling::normalize_modname(), CImg< uintT >::operator%=(), round(), and CImg< uintT >::translate().

4788  {
4789  const double dx = (double)x, dm = (double)m;
4790  if (x<0) { return (T)(dm+dx+dm*std::floor(-dx/dm)); }
4791  return (T)(dx-dm*std::floor(dx/dm));
4792  }
NT dx
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

int cimg_library::cimg::mod ( const bool  x,
const bool  m 
)
inline

Definition at line 4793 of file CImg.h.

4793  {
4794  return m?(x?1:0):0;
4795  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const char  x,
const char  m 
)
inline

Definition at line 4796 of file CImg.h.

4796  {
4797  return x>=0?x%m:(x%m?m+x%m:0);
4798  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const short  x,
const short  m 
)
inline

Definition at line 4799 of file CImg.h.

4799  {
4800  return x>=0?x%m:(x%m?m+x%m:0);
4801  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const int  x,
const int  m 
)
inline

Definition at line 4802 of file CImg.h.

4802  {
4803  return x>=0?x%m:(x%m?m+x%m:0);
4804  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const long  x,
const long  m 
)
inline

Definition at line 4805 of file CImg.h.

4805  {
4806  return x>=0?x%m:(x%m?m+x%m:0);
4807  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const unsigned char  x,
const unsigned char  m 
)
inline

Definition at line 4808 of file CImg.h.

4808  {
4809  return x%m;
4810  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const unsigned short  x,
const unsigned short  m 
)
inline

Definition at line 4811 of file CImg.h.

4811  {
4812  return x%m;
4813  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const unsigned int  x,
const unsigned int  m 
)
inline

Definition at line 4814 of file CImg.h.

4814  {
4815  return x%m;
4816  }
void int int REAL * x
Definition: read.cpp:74
int cimg_library::cimg::mod ( const unsigned long  x,
const unsigned long  m 
)
inline

Definition at line 4817 of file CImg.h.

4817  {
4818  return x%m;
4819  }
void int int REAL * x
Definition: read.cpp:74
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 4776 of file CImg.h.

References i.

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

4776  {
4777  unsigned int i = 1;
4778  while (x>i) i<<=1;
4779  return i;
4780  }
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

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

References split_filename().

Referenced by CImg< uintT >::save(), and CImgList< uintT >::save().

5483  {
5484  if (!filename) { if (string) string[0] = 0; return 0; }
5485  char format[1024] = { 0 }, body[1024] = { 0 };
5486  const char *ext = cimg::split_filename(filename,body);
5487  if (n>0) std::sprintf(format,"%s_%%.%ud.%s",body,n,ext);
5488  else std::sprintf(format,"%s_%%d.%s",body,ext);
5489  std::sprintf(string,format,number);
5490  return string;
5491  }
const NT & n
const char * split_filename(const char *const filename, char *const body=0)
Split a filename into two strings &#39;body&#39; and &#39;extension&#39;.
Definition: CImg.h:5470

Here is the call graph for this function:

Here is the caller graph for this function:

const char* cimg_library::cimg::option ( const char *const  name,
const int  argc,
const char *const *const  argv,
const char *  defaut,
const char *const  usage = 0 
)
inline

Definition at line 5604 of file CImg.h.

References basename(), cimg_stdout, k, t_bold, t_green, t_normal, and t_red.

Referenced by argument(), get_parameter_list(), Agent::init_callback(), option(), ComSwitch::readOptions(), Rocprop::set_option(), Rocmop::set_value(), and Rocout::write_parameter_file().

5605  {
5606  static bool first = true, visu = false;
5607  const char *res = 0;
5608  if (first) {
5609  first=false;
5610  visu = (cimg::option("-h",argc,argv,(char*)0)!=0);
5611  visu |= (cimg::option("-help",argc,argv,(char*)0)!=0);
5612  visu |= (cimg::option("--help",argc,argv,(char*)0)!=0);
5613  }
5614  if (!name && visu) {
5615  if (usage) {
5616  std::fprintf(cimg_stdout,"\n %s%s%s",cimg::t_red,cimg::basename(argv[0]),cimg::t_normal);
5617  std::fprintf(cimg_stdout," : %s",usage);
5618  std::fprintf(cimg_stdout," (%s, %s)\n\n",__DATE__,__TIME__);
5619  }
5620  if (defaut) std::fprintf(cimg_stdout,"%s\n",defaut);
5621  }
5622  if (name) {
5623  if (argc>0) {
5624  int k = 0;
5625  while (k<argc && std::strcmp(argv[k],name)) ++k;
5626  res = (k++==argc?defaut:(k==argc?argv[--k]:argv[k]));
5627  } else res = defaut;
5628  if (visu && usage) std::fprintf(cimg_stdout," %s%-16s%s %-24s %s%s%s\n",
5629  cimg::t_bold,name,cimg::t_normal,res?res:"0",cimg::t_green,usage,cimg::t_normal);
5630  }
5631  return res;
5632  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
j indices k indices k
Definition: Indexing.h:6
const char *const *const t_bold
Definition: CImg.h:1924
const char t_normal[]
Definition: CImg.h:1923
const char *const *const *const *const t_green
Definition: CImg.h:1925
const char *const t_red
Definition: CImg.h:1924
#define cimg_stdout
Definition: CImg.h:136
const char * basename(const char *const s)
Compute the basename of a filename.
Definition: CImg.h:4989

Here is the call graph for this function:

Here is the caller graph for this function:

bool cimg_library::cimg::option ( const char *const  name,
const int  argc,
const char *const *const  argv,
const bool  defaut,
const char *const  usage = 0 
)
inline

Definition at line 5634 of file CImg.h.

References option(), s, and strcasecmp().

5635  {
5636  const char *s = cimg::option(name,argc,argv,(char*)0);
5637  const bool res = s?(cimg::strcasecmp(s,"false") && cimg::strcasecmp(s,"off") && cimg::strcasecmp(s,"0")):defaut;
5638  cimg::option(name,0,0,res?"true":"false",usage);
5639  return res;
5640  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
double s
Definition: blastest.C:80
int strcasecmp(const char *const s1, const char *const s2)
Compare two C-strings, ignoring the case.
Definition: CImg.h:4928

Here is the call graph for this function:

int cimg_library::cimg::option ( const char *const  name,
const int  argc,
const char *const *const  argv,
const int  defaut,
const char *const  usage = 0 
)
inline

Definition at line 5642 of file CImg.h.

References option(), and s.

5643  {
5644  const char *s = cimg::option(name,argc,argv,(char*)0);
5645  const int res = s?std::atoi(s):defaut;
5646  char tmp[256] = { 0 };
5647  std::sprintf(tmp,"%d",res);
5648  cimg::option(name,0,0,tmp,usage);
5649  return res;
5650  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
double s
Definition: blastest.C:80

Here is the call graph for this function:

char cimg_library::cimg::option ( const char *const  name,
const int  argc,
const char *const *const  argv,
const char  defaut,
const char *const  usage = 0 
)
inline

Definition at line 5652 of file CImg.h.

References option(), and s.

5653  {
5654  const char *s = cimg::option(name,argc,argv,(char*)0);
5655  const char res = s?s[0]:defaut;
5656  char tmp[8] = { 0 };
5657  tmp[0] = res;
5658  cimg::option(name,0,0,tmp,usage);
5659  return res;
5660  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
double s
Definition: blastest.C:80

Here is the call graph for this function:

float cimg_library::cimg::option ( const char *const  name,
const int  argc,
const char *const *const  argv,
const float  defaut,
const char *const  usage = 0 
)
inline

Definition at line 5662 of file CImg.h.

References atof(), option(), and s.

5663  {
5664  const char *s = cimg::option(name,argc,argv,(char*)0);
5665  const float res = s?cimg::atof(s):defaut;
5666  char tmp[256] = { 0 };
5667  std::sprintf(tmp,"%g",res);
5668  cimg::option(name,0,0,tmp,usage);
5669  return res;
5670  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
double s
Definition: blastest.C:80
float atof(const char *const str)
Read a float number from a C-string.
Definition: CImg.h:4905

Here is the call graph for this function:

double cimg_library::cimg::option ( const char *const  name,
const int  argc,
const char *const *const  argv,
const double  defaut,
const char *const  usage = 0 
)
inline

Definition at line 5672 of file CImg.h.

References atof(), option(), and s.

5673  {
5674  const char *s = cimg::option(name,argc,argv,(char*)0);
5675  const double res = s?cimg::atof(s):defaut;
5676  char tmp[256] = { 0 };
5677  std::sprintf(tmp,"%g",res);
5678  cimg::option(name,0,0,tmp,usage);
5679  return res;
5680  }
const char * option(const char *const name, const int argc, const char *const *const argv, const char *defaut, const char *const usage=0)
Definition: CImg.h:5604
double s
Definition: blastest.C:80
float atof(const char *const str)
Read a float number from a C-string.
Definition: CImg.h:4905

Here is the call graph for this function:

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

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

Definition at line 4856 of file CImg.h.

References cimg_library::exp(), grand(), k, rand(), s, sqrt(), and y.

Referenced by CImg< uintT >::noise().

4856  {
4857  if (z<=1.0e-10) return 0;
4858  if (z>100.0) return (unsigned int)((std::sqrt(z) * cimg::grand()) + z);
4859  unsigned int k = 0;
4860  const double y = std::exp(-z);
4861  for (double s = 1.0; s>=y; ++k) s*=cimg::rand();
4862  return k-1;
4863  }
CImg< _cimg_Tfloat > exp(const CImg< T > &instance)
Definition: CImg.h:6016
double grand()
Return a random variable following a gaussian distribution and a standard deviation of 1...
Definition: CImg.h:4845
j indices k indices k
Definition: Indexing.h:6
void int int REAL REAL * y
Definition: read.cpp:74
double s
Definition: blastest.C:80
double sqrt(double d)
Definition: double.h:73
void int int int REAL REAL REAL * z
Definition: write.cpp:76
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
Definition: CImg.h:4833

Here is the call graph for this function:

Here is the caller graph for this function:

double cimg_library::cimg::rand ( )
inline

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

Definition at line 4833 of file CImg.h.

References srand().

Referenced by crand(), CImg< T >::_cimg_math_parser::eval(), filenamerand(), grand(), main(), CImg< uintT >::noise(), Rocblas::random< T >::operator()(), Rocblas::random< double >::operator()(), Rocmop::perturb_stationary(), prand(), CImg< uintT >::rand(), Randomize::randomize_vertex(), and srand().

4833  {
4834  static bool first_time = true;
4835  if (first_time) { cimg::srand(); first_time = false; }
4836  return (double)std::rand()/RAND_MAX;
4837  }
void srand()
Definition: CImg.h:4658
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
Definition: CImg.h:4833

Here is the call graph for this function:

Here is the caller graph for this function:

const T cimg_library::cimg::rol ( const T  a,
const unsigned int  n = 1 
)
inline

Return a left bitwise-rotated number.

Definition at line 4671 of file CImg.h.

References n.

4671  {
4672  return n?(T)((a<<n)|(a>>((sizeof(T)<<3)-n))):a;
4673  }
const NT & n
const T cimg_library::cimg::ror ( const T  a,
const unsigned int  n = 1 
)
inline

Return a right bitwise-rotated number.

Definition at line 4677 of file CImg.h.

References n.

Referenced by CImg< uintT >::_load_bmp().

4677  {
4678  return n?(T)((a>>n)|(a<<((sizeof(T)<<3)-n))):a;
4679  }
const NT & n

Here is the caller graph for this function:

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

Return a rounded number.

Parameters
xis the number to be rounded.
yis the rounding precision.
rounding_typedefines the type of rounding (0=nearest, -1=backward, 1=forward).

Definition at line 4871 of file CImg.h.

References mod(), x, and y.

Referenced by CImg< T >::_cimg_math_parser::eval(), and CImg< uintT >::round().

4871  {
4872  if (y<=0) return x;
4873  const double delta = cimg::mod(x,y);
4874  if (delta==0.0) return x;
4875  const double
4876  backward = x - delta,
4877  forward = backward + y;
4878  return rounding_type<0?backward:(rounding_type>0?forward:(2*delta<y?backward:forward));
4879  }
T mod(const T &x, const T &m)
Return the modulo of a number.
Definition: CImg.h:4788
void int int REAL REAL * y
Definition: read.cpp:74
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

T cimg_library::cimg::sign ( const T  x)
inline

Return the sign of a number.

Definition at line 4770 of file CImg.h.

Referenced by CImg< uintT >::distance_hamilton(), CImg< T >::_cimg_math_parser::eval(), and CImg< uintT >::sharpen().

4770  {
4771  return (x<0)?(T)(-1):(x==0?(T)0:(T)1);
4772  }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

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

Referenced by _sleep().

4624  {
4625 #if cimg_OS==1
4626  struct timespec tv;
4627  tv.tv_sec = milliseconds/1000;
4628  tv.tv_nsec = (milliseconds%1000)*1000000;
4629  nanosleep(&tv,0);
4630 #elif cimg_OS==2
4631  Sleep(milliseconds);
4632 #endif
4633  }

Here is the caller graph for this function:

const char* cimg_library::cimg::split_filename ( const char *const  filename,
char *const  body = 0 
)
inline

Split a filename into two strings 'body' and 'extension'.

Definition at line 5470 of file CImg.h.

Referenced by CImg< uintT >::_load_analyze(), CImg< uintT >::load(), CImgList< uintT >::load(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), CImg< uintT >::load_medcon_external(), CImgList< uintT >::load_parrec(), number_filename(), CImg< uintT >::save(), CImgList< uintT >::save(), CImg< uintT >::save_analyze(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), and CImg< uintT >::save_medcon_external().

5470  {
5471  if (!filename) { if (body) body[0] = 0; return 0; }
5472  const char *p = 0; for (const char *np = filename; np>=filename && (p=np); np = std::strchr(np,'.')+1) {}
5473  if (p==filename) {
5474  if (body) std::strcpy(body,filename);
5475  return filename + std::strlen(filename);
5476  }
5477  const unsigned int l = p - filename - 1;
5478  if (body) { std::memcpy(body,filename,l); body[l] = 0; }
5479  return p;
5480  }

Here is the caller graph for this function:

T cimg_library::cimg::sqr ( const T  val)
inline

Return the square of a number.

Definition at line 4717 of file CImg.h.

Referenced by CImg< uintT >::_draw_object3d(), CImg< uintT >::get_BayertoRGB(), CImg< uintT >::get_distance(), CImg< uintT >::get_index(), and QualityAssessor::Assessor::get_stddev().

4717  {
4718  return val*val;
4719  }

Here is the caller graph for this function:

void cimg_library::cimg::srand ( )
inline

Definition at line 4658 of file CImg.h.

References rand(), and time().

Referenced by filenamerand(), main(), and rand().

4658  {
4659  static bool first_time = true;
4660  if (first_time) {
4662  unsigned char *const rand_ptr = new unsigned char[1+std::rand()%2048];
4663  std::srand((unsigned int)std::rand() + *(unsigned int*)(void*)rand_ptr);
4664  delete[] rand_ptr;
4665  first_time = false;
4666  }
4667  }
void srand()
Definition: CImg.h:4658
unsigned long time()
Get the value of a system timer with a millisecond precision.
Definition: CImg.h:4605
double rand()
Return a random variable between [0,1] with respect to an uniform distribution.
Definition: CImg.h:4833

Here is the call graph for this function:

Here is the caller graph for this function:

int cimg_library::cimg::strcasecmp ( const char *const  s1,
const char *const  s2 
)
inline

Compare 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 4928 of file CImg.h.

References strncasecmp().

Referenced by CImg< uintT >::_load_analyze(), CImg< uintT >::_save_inr(), argument(), FindFirstGeometryDataset(), CImg< uintT >::get_hessian(), Scheduler::ActionItem::hasInput(), Scheduler::ActionItem::hasOutput(), CImg< uintT >::load(), CImgList< uintT >::load(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), option(), rocstar_driver(), CImg< uintT >::save(), CImgList< uintT >::save(), CImg< uintT >::save_analyze(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), and scan_files_HDF4().

4928  {
4929  if (!s1) return s2?-1:0;
4930  const unsigned int l1 = std::strlen(s1), l2 = std::strlen(s2);
4931  return cimg::strncasecmp(s1,s2,1+(l1<l2?l1:l2));
4932  }
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.
Definition: CImg.h:4915

Here is the call graph for this function:

Here is the caller graph for this function:

void cimg_library::cimg::strclean ( char *const  s)
inline

Remove useless spaces and symmetric delimiters ', " and ` from a C-string.

Definition at line 4950 of file CImg.h.

References strpare().

Referenced by CImg< T >::_cimg_math_parser::_cimg_math_parser().

4950  {
4951  if (!s) return;
4952  strpare(s,' ',false);
4953  for (bool need_iter = true; need_iter; ) {
4954  need_iter = false;
4955  need_iter |= strpare(s,'\'',true);
4956  need_iter |= strpare(s,'\"',true);
4957  need_iter |= strpare(s,'`',true);
4958  }
4959  }
double s
Definition: blastest.C:80
bool strpare(char *const s, const char delimiter=' ', const bool symmetric=false)
Remove useless delimiters on the borders of a C-string.
Definition: CImg.h:4935

Here is the call graph for this function:

Here is the caller graph for this function:

void cimg_library::cimg::strescape ( char *const  s)
inline

Replace explicit escape sequences '' in C-strings.

Definition at line 4962 of file CImg.h.

References cimg_strescape.

4962  {
4963 #define cimg_strescape(ci,co) case ci: *nd = co; ++ns; break;
4964  static unsigned int val = 0;
4965  for (char *ns = s, *nd = s; *ns || (bool)(*nd=0); ++nd) if (*ns=='\\') switch (*(++ns)) {
4966  cimg_strescape('n','\n');
4967  cimg_strescape('t','\t');
4968  cimg_strescape('v','\v');
4969  cimg_strescape('b','\b');
4970  cimg_strescape('r','\r');
4971  cimg_strescape('f','\f');
4972  cimg_strescape('a','\a');
4973  cimg_strescape('\\','\\');
4974  cimg_strescape('\?','\?');
4975  cimg_strescape('\'','\'');
4976  cimg_strescape('\"','\"');
4977  case 0 : *nd = 0; break;
4978  case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' :
4979  std::sscanf(ns,"%o",&val); while (*ns>='0' && *ns<='7') ++ns;
4980  *nd = val; break;
4981  case 'x':
4982  std::sscanf(++ns,"%x",&val); while ((*ns>='0' && *ns<='7') || (*ns>='a' && *ns<='f') || (*ns>='A' && *ns<='F')) ++ns;
4983  *nd = val; break;
4984  default : *nd='\\';
4985  } else *nd = *(ns++);
4986  }
double s
Definition: blastest.C:80
#define cimg_strescape(ci, co)
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 4915 of file CImg.h.

References k, and uncase().

Referenced by CImg< uintT >::_get_permute_axes(), CImgList< uintT >::_load_cimg(), CImg< uintT >::_load_inr_header(), CImg< uintT >::_load_off(), CImg< uintT >::_load_pandore(), CImgList< uintT >::_save_cimg(), CImg< uintT >::load(), CImgList< uintT >::load(), CImg< uintT >::save_analyze(), scan_files_HDF4(), and strcasecmp().

4915  {
4916  if (!l) return 0;
4917  if (!s1) return s2?-1:0;
4918  const char *ns1 = s1, *ns2 = s2;
4919  int k, diff = 0; for (k = 0; k<l && !(diff = uncase(*ns1)-uncase(*ns2)); ++k) { ++ns1; ++ns2; }
4920  return k!=l?diff:0;
4921  }
j indices k indices k
Definition: Indexing.h:6
char uncase(const char x)
Remove the &#39;case&#39; of an ASCII character.
Definition: CImg.h:4888

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 4935 of file CImg.h.

References n, and q.

Referenced by strclean().

4935  {
4936  if (!s) return false;
4937  const int l = (int)std::strlen(s);
4938  int p, q;
4939  if (symmetric) for (p = 0, q = l-1; p<q && s[p]==delimiter && s[q]==delimiter; ++p) --q;
4940  else {
4941  for (p = 0; p<l && s[p]==delimiter; ) ++p;
4942  for (q = l-1; q>p && s[q]==delimiter; ) --q;
4943  }
4944  const int n = q - p + 1;
4945  if (n!=l) { std::memmove(s,s+p,n); s[n] = 0; return true; }
4946  return false;
4947  }
double s
Definition: blastest.C:80
const NT & n
NT q

Here is the caller graph for this function:

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

References swap().

4526  {
4527  cimg::swap(a1,b1); cimg::swap(a2,b2);
4528  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

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

References swap().

4532  {
4533  cimg::swap(a1,b1,a2,b2); cimg::swap(a3,b3);
4534  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

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

References swap().

4538  {
4539  cimg::swap(a1,b1,a2,b2,a3,b3); cimg::swap(a4,b4);
4540  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

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

References swap().

4544  {
4545  cimg::swap(a1,b1,a2,b2,a3,b3,a4,b4); cimg::swap(a5,b5);
4546  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

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

References swap().

4550  {
4551  cimg::swap(a1,b1,a2,b2,a3,b3,a4,b4,a5,b5); cimg::swap(a6,b6);
4552  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

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

References swap().

4557  {
4558  cimg::swap(a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,a6,b6); cimg::swap(a7,b7);
4559  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

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

References swap().

4564  {
4565  cimg::swap(a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,a6,b6,a7,b7); cimg::swap(a8,b8);
4566  }
void swap(int &a, int &b)
Definition: buildface.cpp:88

Here is the call graph for this function:

int cimg_library::cimg::system ( const char *const  command,
const char *const  module_name = 0 
)
inline
Note
This function is similar to std::system() and is here because using the std:: version on Windows may open undesired consoles.

Definition at line 4491 of file CImg.h.

References FALSE, and pi.

Referenced by COM_F_FUNC2(), CImg< uintT >::load_dcraw_external(), CImgList< uintT >::load_ffmpeg_external(), CImg< uintT >::load_graphicsmagick_external(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), CImg< uintT >::load_imagemagick_external(), CImg< uintT >::load_medcon_external(), Coupling::restart_at_time(), CImgList< uintT >::save_ffmpeg_external(), CImg< uintT >::save_graphicsmagick_external(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), CImg< uintT >::save_imagemagick_external(), and CImg< uintT >::save_medcon_external().

4491  {
4492 #if cimg_OS==2
4493  PROCESS_INFORMATION pi;
4494  STARTUPINFO si;
4495  std::memset(&pi,0,sizeof(PROCESS_INFORMATION));
4496  std::memset(&si,0,sizeof(STARTUPINFO));
4497  GetStartupInfo(&si);
4498  si.cb = sizeof(si);
4499  si.wShowWindow = SW_HIDE;
4500  si.dwFlags |= SW_HIDE;
4501  const BOOL res = CreateProcess((LPCTSTR)module_name,(LPTSTR)command,0,0,FALSE,0,0,0,&si,&pi);
4502  if (res) {
4503  WaitForSingleObject(pi.hProcess, INFINITE);
4504  CloseHandle(pi.hThread);
4505  CloseHandle(pi.hProcess);
4506  return 0;
4507  } else
4508 #endif
4509  return std::system(command);
4510  return module_name?0:1;
4511  }
#define FALSE
Definition: vinci.h:133
int system(const char *const command, const char *const module_name=0)
Definition: CImg.h:4491
const double pi

Here is the caller graph for this function:

T& cimg_library::cimg::temporary ( const T &  )
inline

Return a reference to a temporary variable of type T.

Definition at line 4515 of file CImg.h.

Referenced by CImg< uintT >::at(), CImgList< uintT >::atN(), CImgList< uintT >::atNX(), CImgList< uintT >::atNXY(), CImgList< uintT >::atNXYZ(), CImgList< uintT >::atNXYZV(), CImg< uintT >::atX(), CImg< uintT >::atXY(), CImg< uintT >::atXYZ(), and CImg< uintT >::atXYZV().

4515  {
4516  static T temp;
4517  return temp;
4518  }

Here is the caller graph for this function:

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

Return or set path to store temporary files.

Definition at line 5017 of file CImg.h.

References _cimg_test_temporary_path, fclose(), filenamerand(), fopen(), and winformat_string().

Referenced by info(), CImg< uintT >::load_dcraw_external(), CImgList< uintT >::load_ffmpeg_external(), CImg< uintT >::load_graphicsmagick_external(), CImg< uintT >::load_gzip_external(), CImgList< uintT >::load_gzip_external(), CImg< uintT >::load_imagemagick_external(), CImgList< uintT >::save_ffmpeg_external(), CImg< uintT >::save_graphicsmagick_external(), CImg< uintT >::save_gzip_external(), CImgList< uintT >::save_gzip_external(), and CImg< uintT >::save_imagemagick_external().

5017  {
5018 #define _cimg_test_temporary_path(p) \
5019  if (!path_found) { \
5020  std::sprintf(st_path,"%s",p); \
5021  std::sprintf(tmp,"%s%c%s",st_path,cimg_file_separator,filetmp); \
5022  if ((file=std::fopen(tmp,"wb"))!=0) { std::fclose(file); std::remove(tmp); path_found = true; } \
5023  }
5024  static char *st_path = 0;
5025  if (reinit_path && st_path) { delete[] st_path; st_path = 0; }
5026  if (user_path) {
5027  if (!st_path) st_path = new char[1024];
5028  std::memset(st_path,0,1024);
5029  std::strncpy(st_path,user_path,1023);
5030  } else if (!st_path) {
5031  st_path = new char[1024];
5032  std::memset(st_path,0,1024);
5033  bool path_found = false;
5034  char tmp[1024] = { 0 }, filetmp[512] = { 0 };
5035  std::FILE *file = 0;
5036  std::sprintf(filetmp,"%s.tmp",cimg::filenamerand());
5037  char *tmpPath = getenv("TMP");
5038  if (!tmpPath) { tmpPath = getenv("TEMP"); winformat_string(tmpPath); }
5039  if (tmpPath) _cimg_test_temporary_path(tmpPath);
5040 #if cimg_OS==2
5041  _cimg_test_temporary_path("C:\\WINNT\\Temp");
5042  _cimg_test_temporary_path("C:\\WINDOWS\\Temp");
5043  _cimg_test_temporary_path("C:\\Temp");
5045  _cimg_test_temporary_path("D:\\WINNT\\Temp");
5046  _cimg_test_temporary_path("D:\\WINDOWS\\Temp");
5047  _cimg_test_temporary_path("D:\\Temp");
5049 #else
5050  _cimg_test_temporary_path("/tmp");
5051  _cimg_test_temporary_path("/var/tmp");
5052 #endif
5053  if (!path_found) {
5054  st_path[0] = 0;
5055  std::strcpy(tmp,filetmp);
5056  if ((file=std::fopen(tmp,"wb"))!=0) { std::fclose(file); std::remove(tmp); path_found = true; }
5057  }
5058  if (!path_found)
5059  throw CImgIOException("cimg::temporary_path() : Unable to find a temporary path accessible for writing\n"
5060  "you have to set the macro 'cimg_temporary_path' to a valid path where you have writing access :\n"
5061  "#define cimg_temporary_path \"path\" (before including 'CImg.h')");
5062  }
5063  return st_path;
5064  }
const char * filenamerand()
Definition: CImg.h:4996
#define _cimg_test_temporary_path(p)
int fclose(std::FILE *file)
Close a file, and check for possible errors.
Definition: CImg.h:5507
void winformat_string(char *const s)
Definition: CImg.h:5007
std::FILE * fopen(const char *const path, const char *const mode)
Open a file, and check for possible errors.
Definition: CImg.h:5494

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 4605 of file CImg.h.

Referenced by _sleep(), InterpolateBase::extrapolate_Linear(), CImgDisplay::frames_per_second(), main(), Rocin::read_windows(), flowprobe::ReadProbeData(), ComputeMeshMotion::run(), srand(), wait(), and write_hdf().

4605  {
4606 #if cimg_OS==1
4607  struct timeval st_time;
4608  gettimeofday(&st_time,0);
4609  return (unsigned long)(st_time.tv_usec/1000 + st_time.tv_sec*1000);
4610 #elif cimg_OS==2
4611  static SYSTEMTIME st_time;
4612  GetSystemTime(&st_time);
4613  return (unsigned long)(st_time.wMilliseconds + 1000*(st_time.wSecond + 60*(st_time.wMinute + 60*st_time.wHour)));
4614 #else
4615  return 0;
4616 #endif
4617  }

Here is the caller graph for this function:

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

Remove the 'case' of an ASCII character.

Definition at line 4888 of file CImg.h.

Referenced by CImg< uintT >::_autocrop(), CImg< T >::_cimg_math_parser::_cimg_math_parser(), CImg< uintT >::assign(), CImg< uintT >::autocrop(), CImg< uintT >::deriche(), CImg< uintT >::FFT(), CImgList< uintT >::get_append(), CImg< uintT >::get_gradient(), CImg< uintT >::get_haar(), CImg< uintT >::get_split(), CImg< uintT >::mirror(), strncasecmp(), and uncase().

4888  {
4889  return (char)((x<'A'||x>'Z')?x:x-'A'+'a');
4890  }
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

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

Remove the 'case' of a C string.

Acts in-place.

Definition at line 4896 of file CImg.h.

References uncase().

4896  {
4897  if (string) for (char *ptr = string; *ptr; ++ptr) *ptr = uncase(*ptr);
4898  }
char uncase(const char x)
Remove the &#39;case&#39; of an ASCII character.
Definition: CImg.h:4888

Here is the call graph for this function:

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

References _sleep(), and time().

4650  {
4651  static unsigned long timer = 0;
4652  if (!timer) timer = cimg::time();
4653  return _sleep(milliseconds,timer);
4654  }
unsigned int _sleep(const unsigned int milliseconds, unsigned long &timer)
Definition: CImg.h:4635
unsigned long time()
Get the value of a system timer with a millisecond precision.
Definition: CImg.h:4605

Here is the call graph for this function:

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

Display a warning message.

Parameters
formatis a C-string describing the format of the message, as in std::printf().

Definition at line 4470 of file CImg.h.

References cimg_stdout, exception_mode(), t_normal, and t_red.

Referenced by CImg< uintT >::_load_analyze(), CImg< uintT >::_load_ascii(), CImg< uintT >::_load_jpeg(), CImg< uintT >::_load_off(), CImg< uintT >::_load_pnm(), CImgList< uintT >::_load_yuv(), CImg< uintT >::_save_bmp(), CImgList< uintT >::_save_cimg(), CImg< uintT >::_save_dlm(), CImg< uintT >::_save_jpeg(), CImg< uintT >::_save_png(), CImg< uintT >::_save_pnm(), CImg< uintT >::_save_rgb(), CImg< uintT >::_save_rgba(), CImg< uintT >::assign(), CImg< uintT >::eigen(), fclose(), CImgList< uintT >::FFT(), fread(), fwrite(), CImg< uintT >::invert(), CImgList< uintT >::load_ffmpeg(), CImg< uintT >::load_tiff(), CImgList< uintT >::load_tiff(), CImgList< uintT >::operator[](), CImgList< uintT >::remove(), CImg< uintT >::save_magick(), CImg< uintT >::solve(), and CImg< uintT >::symmetric_eigen().

4470  {
4471  if (cimg::exception_mode()>=1) {
4472  char message[8192] = { 0 };
4473  std::va_list ap;
4474  va_start(ap,format);
4475  std::vsprintf(message,format,ap);
4476  va_end(ap);
4477 #ifdef cimg_strict_warnings
4478  throw CImgWarningException(message);
4479 #else
4480  std::fprintf(cimg_stdout,"\n%s# CImg Warning%s :\n%s\n",cimg::t_red,cimg::t_normal,message);
4481 #endif
4482  }
4483  }
const char t_normal[]
Definition: CImg.h:1923
unsigned int & exception_mode()
Get/set the current CImg exception mode.
Definition: CImg.h:1940
const char *const t_red
Definition: CImg.h:1924
#define cimg_stdout
Definition: CImg.h:136

Here is the call graph for this function:

Here is the caller graph for this function:

void cimg_library::cimg::winformat_string ( char *const  s)
inline

Definition at line 5007 of file CImg.h.

Referenced by dcraw_path(), ffmpeg_path(), graphicsmagick_path(), gunzip_path(), gzip_path(), imagemagick_path(), medcon_path(), and temporary_path().

5007  {
5008  if (s && s[0]) {
5009 #if cimg_OS==2
5010  char *const ns = new char[MAX_PATH];
5011  if (GetShortPathNameA(s,ns,MAX_PATH)) std::strcpy(s,ns);
5012 #endif
5013  }
5014  }
double s
Definition: blastest.C:80

Here is the caller graph for this function:

int cimg_library::cimg::xln ( const int  x)
inline

Return 1 + log_10(x).

Definition at line 4722 of file CImg.h.

References cimg_library::log10().

4722  {
4723  return x>0?(int)(1+std::log10((double)x)):1;
4724  }
CImg< _cimg_Tfloat > log10(const CImg< T > &instance)
Definition: CImg.h:6026
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Variable Documentation

const unsigned int font10x13[256 *10 *13/32]

Definition at line 2805 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font10x19[10 *19 *256/32]

Definition at line 2935 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font12x24[12 *24 *256/32]

Definition at line 3030 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font16x32[16 *32 *256/32]

Definition at line 3169 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font19x38[19 *38 *256/32]

Definition at line 3403 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font29x57[29 *57 *256/32]

Definition at line 3729 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font7x11[7 *11 *256/32]

Definition at line 2764 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int font8x17[8 *17 *256/32]

Definition at line 2868 of file CImg.h.

Referenced by CImgList< uintT >::font().

const unsigned int key0 = 24U

Definition at line 2694 of file CImg.h.

const unsigned int key1 = 15U

Definition at line 2685 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key2 = 16U

Definition at line 2686 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key3 = 17U

Definition at line 2687 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key4 = 18U

Definition at line 2688 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key5 = 19U

Definition at line 2689 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key6 = 20U

Definition at line 2690 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key7 = 21U

Definition at line 2691 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key8 = 22U

Definition at line 2692 of file CImg.h.

Referenced by CImgDisplay::is_key().

const unsigned int key9 = 23U

Definition at line 2693 of file CImg.h.

const unsigned int keyA = 44U

Definition at line 2714 of file CImg.h.

const unsigned int keyALT = 66U

Definition at line 2736 of file CImg.h.

Referenced by CImg< uintT >::_display().

const unsigned int keyALTGR = 68U

Definition at line 2738 of file CImg.h.

const unsigned int keyAPPLEFT = 65U

Definition at line 2735 of file CImg.h.

const unsigned int keyAPPRIGHT = 69U

Definition at line 2739 of file CImg.h.

const unsigned int keyARROWDOWN = 73U

Definition at line 2743 of file CImg.h.

Referenced by CImg< uintT >::_display(), dialog(), and CImg< uintT >::display_graph().

const unsigned int keyARROWLEFT = 72U

Definition at line 2742 of file CImg.h.

Referenced by CImg< uintT >::_display(), dialog(), and CImg< uintT >::display_graph().

const unsigned int keyARROWRIGHT = 74U

Definition at line 2744 of file CImg.h.

Referenced by CImg< uintT >::_display(), dialog(), and CImg< uintT >::display_graph().

const unsigned int keyARROWUP = 63U

Definition at line 2733 of file CImg.h.

Referenced by CImg< uintT >::_display(), dialog(), and CImg< uintT >::display_graph().

const unsigned int keyB = 59U

Definition at line 2729 of file CImg.h.

const unsigned int keyBACKSPACE = 25U

Definition at line 2695 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyC = 57U
const unsigned int keyCAPSLOCK = 43U

Definition at line 2713 of file CImg.h.

const unsigned int keyCTRLLEFT = 64U
const unsigned int keyCTRLRIGHT = 71U

Definition at line 2741 of file CImg.h.

const unsigned int keyD = 46U
const unsigned int keyDELETE = 40U

Definition at line 2710 of file CImg.h.

const unsigned int keyE = 32U

Definition at line 2702 of file CImg.h.

const unsigned int keyEND = 41U

Definition at line 2711 of file CImg.h.

const unsigned int keyENTER = 53U

Definition at line 2723 of file CImg.h.

Referenced by dialog().

const unsigned int keyESC = 1U

Definition at line 2671 of file CImg.h.

Referenced by dialog().

const unsigned int keyF = 47U
const unsigned int keyF1 = 2U

Definition at line 2672 of file CImg.h.

const unsigned int keyF10 = 11U

Definition at line 2681 of file CImg.h.

const unsigned int keyF11 = 12U

Definition at line 2682 of file CImg.h.

const unsigned int keyF12 = 13U

Definition at line 2683 of file CImg.h.

const unsigned int keyF2 = 3U

Definition at line 2673 of file CImg.h.

const unsigned int keyF3 = 4U

Definition at line 2674 of file CImg.h.

const unsigned int keyF4 = 5U

Definition at line 2675 of file CImg.h.

const unsigned int keyF5 = 6U

Definition at line 2676 of file CImg.h.

const unsigned int keyF6 = 7U

Definition at line 2677 of file CImg.h.

const unsigned int keyF7 = 8U

Definition at line 2678 of file CImg.h.

const unsigned int keyF8 = 9U

Definition at line 2679 of file CImg.h.

const unsigned int keyF9 = 10U

Definition at line 2680 of file CImg.h.

const unsigned int keyG = 48U

Definition at line 2718 of file CImg.h.

const unsigned int keyH = 49U

Definition at line 2719 of file CImg.h.

const unsigned int keyHOME = 27U

Definition at line 2697 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyI = 37U

Definition at line 2707 of file CImg.h.

const unsigned int keyINSERT = 26U

Definition at line 2696 of file CImg.h.

const unsigned int keyJ = 50U

Definition at line 2720 of file CImg.h.

const unsigned int keyK = 51U

Definition at line 2721 of file CImg.h.

const unsigned int keyL = 52U

Definition at line 2722 of file CImg.h.

const unsigned int keyM = 61U

Definition at line 2731 of file CImg.h.

const unsigned int keyMENU = 70U

Definition at line 2740 of file CImg.h.

const unsigned int keyN = 60U

Definition at line 2730 of file CImg.h.

const unsigned int keyO = 38U

Definition at line 2708 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d(), and CImg< uintT >::_get_select().

const unsigned int keyP = 39U

Definition at line 2709 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::_display_object3d().

const unsigned int keyPAD0 = 75U

Definition at line 2745 of file CImg.h.

const unsigned int keyPAD1 = 76U

Definition at line 2746 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD2 = 77U

Definition at line 2747 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD3 = 78U

Definition at line 2748 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD4 = 79U

Definition at line 2749 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD5 = 80U

Definition at line 2750 of file CImg.h.

Referenced by CImg< uintT >::_display().

const unsigned int keyPAD6 = 81U

Definition at line 2751 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD7 = 82U

Definition at line 2752 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD8 = 83U

Definition at line 2753 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAD9 = 84U

Definition at line 2754 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPADADD = 85U

Definition at line 2755 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPADDIV = 88U

Definition at line 2758 of file CImg.h.

const unsigned int keyPADMUL = 87U

Definition at line 2757 of file CImg.h.

const unsigned int keyPADSUB = 86U

Definition at line 2756 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::display_graph().

const unsigned int keyPAGEDOWN = 42U

Definition at line 2712 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::_get_select().

const unsigned int keyPAGEUP = 28U

Definition at line 2698 of file CImg.h.

Referenced by CImg< uintT >::_display(), and CImg< uintT >::_get_select().

const unsigned int keyPAUSE = 14U

Definition at line 2684 of file CImg.h.

const unsigned int keyQ = 30U

Definition at line 2700 of file CImg.h.

const unsigned int keyR = 33U
const unsigned int keyS = 45U
const unsigned int keySHIFTLEFT = 54U

Definition at line 2724 of file CImg.h.

Referenced by CImg< uintT >::_display().

const unsigned int keySHIFTRIGHT = 62U

Definition at line 2732 of file CImg.h.

const unsigned int keySPACE = 67U

Definition at line 2737 of file CImg.h.

const unsigned int keyT = 34U

Definition at line 2704 of file CImg.h.

const unsigned int keyTAB = 29U

Definition at line 2699 of file CImg.h.

Referenced by dialog().

const unsigned int keyU = 36U

Definition at line 2706 of file CImg.h.

const unsigned int keyV = 58U

Definition at line 2728 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d().

const unsigned int keyW = 31U

Definition at line 2701 of file CImg.h.

const unsigned int keyX = 56U

Definition at line 2726 of file CImg.h.

const unsigned int keyY = 35U

Definition at line 2705 of file CImg.h.

const unsigned int keyZ = 55U

Definition at line 2725 of file CImg.h.

Referenced by CImg< uintT >::_display_object3d().

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

Referenced by CImg< uintT >::logo40x38().

const char* const * const t_bold = cimg::t_normal

Definition at line 1924 of file CImg.h.

Referenced by info(), and option().

const char* const * const * const * const t_green = cimg::t_normal

Definition at line 1925 of file CImg.h.

Referenced by info(), and option().

const char t_normal[] = { 0 }

Definition at line 1923 of file CImg.h.

Referenced by info(), option(), and warn().

const char* const * const * const t_purple = cimg::t_normal

Definition at line 1925 of file CImg.h.

const char* const t_red = cimg::t_normal

Definition at line 1924 of file CImg.h.

Referenced by info(), option(), and warn().