• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

digikam

cimg_library::cimg

cimg_library::cimg Namespace Reference


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 ::.


Classes

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

Functions

template<typename t>
int _marching_cubes_indice (const unsigned int edge, const CImg< t > &indices1, const CImg< t > &indices2, const unsigned int x, const unsigned int y, const unsigned int nx, const unsigned int ny)
template<typename t>
int _marching_squares_indice (const unsigned int edge, const CImg< t > &indices1, const CImg< t > &indices2, const unsigned int x, const unsigned int nx)
double _pythagore (double a, double b)
unsigned int _sleep (const unsigned int milliseconds, unsigned long &timer)
int abs (const int a)
float abs (const float a)
double abs (const double a)
unsigned long abs (const unsigned long a)
unsigned int abs (const unsigned int a)
unsigned short abs (const unsigned short a)
unsigned char abs (const unsigned char a)
bool abs (const bool a)
template<typename T>
T abs (const T a)
const char * argument (const unsigned int nb, const int argc, char **argv, const unsigned int nb_singles=0,...)
float atof (const char *str)
const char * basename (const char *s)
double crand ()
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)
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)
bool endianness ()
unsigned int & exception_mode ()
int fclose (std::FILE *file)
const char * ffmpeg_path ()
char * filename_number (const char *const filename, const int number, const unsigned int n, char *const string)
const char * filenamerand ()
std::FILE * fopen (const char *const path, const char *const mode)
template<typename T>
int fread (T *const ptr, const unsigned int nmemb, std::FILE *stream)
template<typename T>
int fwrite (const T *ptr, const unsigned int nmemb, std::FILE *stream)
double grand ()
const char * graphicsmagick_path ()
const char * gunzip_path ()
const char * gzip_path ()
const char * imagemagick_path ()
void info ()
template<typename T>
T & invert_endianness (T &a)
template<typename T>
void invert_endianness (T *const buffer, const unsigned int size)
template<typename tfunc, typename tp, typename tf>
void marching_cubes (const tfunc &func, const float isovalue, const float x0, const float y0, const float z0, const float x1, const float y1, const float z1, const float resx, const float resy, const float resz, CImgList< tp > &points, CImgList< tf > &primitives, const bool invert_faces)
template<typename tfunc, typename tp, typename tf>
void marching_squares (const tfunc &func, const float isovalue, const float x0, const float y0, const float x1, const float y1, const float resx, const float resy, CImgList< tp > &points, CImgList< tf > &primitives)
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)
template<typename t1, typename t2, typename t3>
cimg::superset2< t1, t2, t3 >::type max (const t1 &a, const t2 &b, const t3 &c)
template<typename t1, typename t2>
cimg::superset< t1, t2 >::type max (const t1 &a, const t2 &b)
const char * medcon_path ()
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)
template<typename t1, typename t2, typename t3>
cimg::superset2< t1, t2, t3 >::type min (const t1 &a, const t2 &b, const t3 &c)
template<typename t1, typename t2>
cimg::superset< t1, t2 >::type min (const t1 &a, const t2 &b)
template<typename T>
T minmod (const T a, const T b)
int mod (const unsigned long x, const unsigned long m)
int mod (const unsigned int x, const unsigned int m)
int mod (const unsigned short x, const unsigned short m)
int mod (const unsigned char x, const unsigned char m)
int mod (const long x, const long m)
int mod (const int x, const int m)
int mod (const short x, const short m)
int mod (const char x, const char m)
template<typename T>
T mod (const T &x, const T &m)
template<typename T>
unsigned long nearest_pow2 (const T x)
double option (const char *const name, const int argc, char **argv, const double defaut, const char *const usage=0)
float option (const char *const name, const int argc, char **argv, const float defaut, const char *const usage=0)
char option (const char *const name, const int argc, char **argv, const char defaut, const char *const usage=0)
int option (const char *const name, const int argc, char **argv, const int defaut, const char *const usage=0)
bool option (const char *const name, const int argc, char **argv, const bool defaut, const char *const usage=0)
const char * option (const char *const name, const int argc, char **argv, const char *defaut, const char *const usage=0)
double rand ()
template<typename T>
const T rol (const T a, const unsigned int n=1)
template<typename T>
const T ror (const T a, const unsigned int n=1)
double round (const double x, const double y, const unsigned int round_type=0)
template<typename T>
T sign (const T x)
void sleep (const unsigned int milliseconds)
const char * split_filename (const char *const filename, char *const body=0)
template<typename T>
T sqr (const T val)
void srand ()
int strcasecmp (const char *s1, const char *s2)
int strcmp (const char *s1, const char *s2)
int strfind (const char *s, const char c)
int strlen (const char *s)
int strncasecmp (const char *s1, const char *s2, const int l)
int strncmp (const char *s1, const char *s2, const int l)
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)
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)
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)
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)
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)
template<typename T1, typename T2, typename T3>
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2, T3 &a3, T3 &b3)
template<typename T1, typename T2>
void swap (T1 &a1, T1 &b1, T2 &a2, T2 &b2)
template<typename T>
void swap (T &a, T &b)
void system (const char *command, const char *module_name=0)
const char * temporary_path ()
unsigned long time ()
void uncase (char *const string)
char uncase (const char x)
unsigned int wait (const unsigned int milliseconds)
void warn (const char *format,...)
void winformat_string (char *const s)
int xln (const int x)

Variables

const unsigned int font10x13 [256 *10 *13/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 int font7x11 [7 *11 *256/32]
const unsigned int font8x17 [8 *17 *256/32]
const unsigned int key0 = 24U
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 keyA = 44U
const unsigned int keyALTGR = 67U
const unsigned int keyAPPLEFT = 65U
const unsigned int keyAPPRIGHT = 68U
const unsigned int keyARROWDOWN = 72U
const unsigned int keyARROWLEFT = 71U
const unsigned int keyARROWRIGHT = 73U
const unsigned int keyARROWUP = 63U
const unsigned int keyB = 59U
const unsigned int keyBACKSPACE = 25U
const unsigned int keyC = 57U
const unsigned int keyCAPSLOCK = 43U
const unsigned int keyCTRLLEFT = 64U
const unsigned int keyCTRLRIGHT = 70U
const unsigned int keyD = 46U
const unsigned int keyDELETE = 40U
const unsigned int keyE = 32U
const unsigned int keyEND = 41U
const unsigned int keyENTER = 53U
const unsigned int keyESC = 1U
const unsigned int keyF = 47U
const unsigned int keyF1 = 2U
const unsigned int keyF10 = 11U
const unsigned int keyF11 = 12U
const unsigned int keyF12 = 13U
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 keyG = 48U
const unsigned int keyH = 49U
const unsigned int keyHOME = 27U
const unsigned int keyI = 37U
const unsigned int keyINSERT = 26U
const unsigned int keyJ = 50U
const unsigned int keyK = 51U
const unsigned int keyL = 52U
const unsigned int keyM = 61U
const unsigned int keyMENU = 69U
const unsigned int keyN = 60U
const unsigned int keyO = 38U
const unsigned int keyP = 39U
const unsigned int keyPAD0 = 74U
const unsigned int keyPAD1 = 75U
const unsigned int keyPAD2 = 76U
const unsigned int keyPAD3 = 77U
const unsigned int keyPAD4 = 78U
const unsigned int keyPAD5 = 79U
const unsigned int keyPAD6 = 80U
const unsigned int keyPAD7 = 81U
const unsigned int keyPAD8 = 82U
const unsigned int keyPAD9 = 83U
const unsigned int keyPADADD = 84U
const unsigned int keyPADDIV = 87U
const unsigned int keyPADMUL = 86U
const unsigned int keyPADSUB = 85U
const unsigned int keyPAGEDOWN = 42U
const unsigned int keyPAGEUP = 28U
const unsigned int keyPAUSE = 14U
const unsigned int keyQ = 30U
const unsigned int keyR = 33U
const unsigned int keyS = 45U
const unsigned int keySHIFTLEFT = 54U
const unsigned int keySHIFTRIGHT = 62U
const unsigned int keySPACE = 66U
const unsigned int keyT = 34U
const unsigned int keyTAB = 29U
const unsigned int keyU = 36U
const unsigned int keyV = 58U
const unsigned int keyW = 31U
const unsigned int keyX = 56U
const unsigned int keyY = 35U
const unsigned int keyZ = 55U
const unsigned char logo40x38 [4576]
const char *const *const t_bold = cimg::t_normal
const char *const *const
*const *const 
t_green = cimg::t_normal
const char t_normal [] = { '\0' }
const char *const *const *const t_purple = cimg::t_normal
const char *const t_red = cimg::t_normal
const double valuePI = 3.14159265358979323846

Function Documentation

template<typename t>
int cimg_library::cimg::_marching_cubes_indice ( const unsigned int  edge,
const CImg< t > &  indices1,
const CImg< t > &  indices2,
const unsigned int  x,
const unsigned int  y,
const unsigned int  nx,
const unsigned int  ny 
) [inline]

Definition at line 33375 of file CImg.h.

template<typename t>
int cimg_library::cimg::_marching_squares_indice ( const unsigned int  edge,
const CImg< t > &  indices1,
const CImg< t > &  indices2,
const unsigned int  x,
const unsigned int  nx 
) [inline]

Definition at line 33676 of file CImg.h.

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

Definition at line 4837 of file CImg.h.

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

Definition at line 4614 of file CImg.h.

int cimg_library::cimg::abs ( const int  a  )  [inline]

Definition at line 4687 of file CImg.h.

float cimg_library::cimg::abs ( const float  a  )  [inline]

Definition at line 4684 of file CImg.h.

double cimg_library::cimg::abs ( const double  a  )  [inline]

Definition at line 4681 of file CImg.h.

unsigned long cimg_library::cimg::abs ( const unsigned long  a  )  [inline]

Definition at line 4678 of file CImg.h.

unsigned int cimg_library::cimg::abs ( const unsigned int  a  )  [inline]

Definition at line 4675 of file CImg.h.

unsigned short cimg_library::cimg::abs ( const unsigned short  a  )  [inline]

Definition at line 4672 of file CImg.h.

unsigned char cimg_library::cimg::abs ( const unsigned char  a  )  [inline]

Definition at line 4669 of file CImg.h.

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

Definition at line 4666 of file CImg.h.

template<typename T>
T cimg_library::cimg::abs ( const T  a  )  [inline]

Return the absolute value of a number.

Note:
This function is different from std::abs() or std::fabs() because it is able to consider a variable of any type, without cast needed.

Definition at line 4663 of file CImg.h.

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

Definition at line 5562 of file CImg.h.

float cimg_library::cimg::atof ( const char *  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 4861 of file CImg.h.

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

Compute the basename of a filename.

Definition at line 4931 of file CImg.h.

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

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

Definition at line 4806 of file CImg.h.

template<typename t>
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 33230 of file CImg.h.

int cimg_library::cimg::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 33365 of file CImg.h.

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

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 (stderr).
  • 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 1942 of file CImg.h.

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

Close a file, and check for possible errors.

Definition at line 5440 of file CImg.h.

const char* cimg_library::cimg::ffmpeg_path (  )  [inline]

Return path to the 'ffmpeg' command.

Definition at line 5356 of file CImg.h.

char* cimg_library::cimg::filename_number ( 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 5416 of file CImg.h.

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

Definition at line 4936 of file CImg.h.

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

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

Read file data, and check for possible errors.

Definition at line 5449 of file CImg.h.

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

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

Definition at line 5466 of file CImg.h.

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

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

Definition at line 4811 of file CImg.h.

const char* cimg_library::cimg::graphicsmagick_path (  )  [inline]

Return path of the GraphicsMagick's gm tool.

If you have installed the GraphicsMagick package in a standard directory, this function should return the correct path of the gm tool used by the CImg Library to load and save compressed image formats. Conversely, if the gm executable is not auto-detected by the function, you can define the macro cimg_graphicsmagick_path with the correct path of the gm executable, before including CImg.h in your program :

       #define cimg_graphicsmagick_path "/users/thatsme/local/bin/gm"
       #include "CImg.h"

       int main() {
         CImg<> img("my_image.jpg");     // Read a JPEG image file.
         return 0;
       }

Note that non compressed image formats can be read without installing ImageMagick.

Definition at line 5191 of file CImg.h.

const char* cimg_library::cimg::gunzip_path (  )  [inline]

Return path to the 'gunzip' command.

Definition at line 5390 of file CImg.h.

const char* cimg_library::cimg::gzip_path (  )  [inline]

Return path to the 'gzip' command.

Definition at line 5373 of file CImg.h.

const char* cimg_library::cimg::imagemagick_path (  )  [inline]

This function is used internally in imagemagick_path, graphicsmagick_path and medcon_path on Windows platforms.

Return path of the ImageMagick's convert tool. If you have installed the ImageMagick package in a standard directory, this function should return the correct path of the convert tool used by the CImg Library to load and save compressed image formats. Conversely, if the convert executable is not auto-detected by the function, you can define the macro cimg_imagemagick_path with the correct path of the convert executable, before including CImg.h in your program :

       #define cimg_imagemagick_path "/users/thatsme/local/bin/convert"
       #include "CImg.h"

       int main() {
         CImg<> img("my_image.jpg");     // Read a JPEG image file.
         return 0;
       }

Note that non compressed image formats can be read without installing ImageMagick.

Definition at line 5069 of file CImg.h.

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

Print informations about CImg environement variables.

Printing is done on the standard error output.

Definition at line 5582 of file CImg.h.

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

Invert endianness of a single variable.

Definition at line 4578 of file CImg.h.

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

Invert endianness of a memory buffer.

Definition at line 4559 of file CImg.h.