Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 65f8aa69c4b85eb2463f24ce9ff49b95 > files > 305

cimg-devel-1.5.9-3.mga5.i586.rpm

\hypertarget{group__cimg__environment}{\section{Setting Environment Variables}
\label{group__cimg__environment}\index{Setting Environment Variables@{Setting Environment Variables}}
}
The C\+Img library is a multiplatform library, working on a wide variety of systems. This implies the existence of some {\itshape environment} {\itshape variables} that must be correctly defined depending on your current system. Most of the time, the C\+Img Library defines these variables automatically (for popular systems). Anyway, if your system is not recognized, you will have to set the environment variables by hand. Here is a quick explanations of environment variables.~\newline
 Setting the environment variables is done with the {\ttfamily \#define} keyword. This setting must be done {\itshape before including the file {\ttfamily C\+Img.\+h}} in your source code. For instance, defining the environment variable {\ttfamily cimg\+\_\+display} would be done like this \+: 
\begin{DoxyCode}
\textcolor{preprocessor}{#define cimg\_display 0}
\textcolor{preprocessor}{#include "CImg.h"}
...
\end{DoxyCode}


Here are the different environment variables used by the C\+Img Library \+:


\begin{DoxyItemize}
\item {\bfseries {\ttfamily cimg\+\_\+\+O\+S} }\+: This variable defines the type of your Operating System. It can be set to {\bfseries 1} ({\itshape Unix}), {\bfseries 2} ({\itshape Windows}), or {\bfseries 0} ({\itshape Other} {\itshape configuration}). It should be actually auto-\/detected by the C\+Img library. If this is not the case ({\ttfamily cimg\+\_\+\+O\+S=0}), you will probably have to tune the environment variables described below.
\item {\bfseries {\ttfamily cimg\+\_\+display} }\+: This variable defines the type of graphical library used to display images in windows. It can be set to 0 (no display library available), {\bfseries 1} (X11-\/based display) or {\bfseries 2} (Windows-\/\+G\+D\+I display). If you are running on a system without X11 or Windows-\/\+G\+D\+I ability, please set this variable to {\ttfamily 0}. This will disable the display support, since the C\+Img Library doesn't contain the necessary code to display images on systems other than X11 or Windows G\+D\+I.
\item {\bfseries {\ttfamily cimg\+\_\+use\+\_\+vt100} }\+: This variable tells the library if the system terminal has V\+T100 color capabilities. It can be {\itshape defined} or {\itshape not} {\itshape defined}. Define this variable to get colored output on your terminal, when using the C\+Img Library.
\item {\bfseries {\ttfamily cimg\+\_\+verbosity} }\+: This variable defines the level of run-\/time debug messages that will be displayed by the C\+Img Library. It can be set to 0 (no debug messages), 1 (normal debug messages displayed on standard error), 2 (normal debug messages displayed in modal windows, which is the default value), or 3 (high debug messages). Note that setting this value to 3 may slow down your program since more debug tests are made by the library (particularly to check if pixel access is made outside image boundaries). See also C\+Img\+Exception to better understand how debug messages are working.
\item {\bfseries {\ttfamily cimg\+\_\+plugin} }\+: This variable tells the library to use a plugin file to add features to the C\+Img$<$\+T$>$ class. Define it with the path of your plugin file, if you want to add member functions to the C\+Img$<$\+T$>$ class, without having to modify directly the {\ttfamily \char`\"{}$<$tt$>$\+C\+Img.\+h$<$/tt$>$\char`\"{}} file. An include of the plugin file is performed in the C\+Img$<$\+T$>$ class. If {\ttfamily cimg\+\_\+plugin} if not specified (default), no include is done.
\item {\bfseries {\ttfamily cimglist\+\_\+plugin} }\+: Same as {\ttfamily cimg\+\_\+plugin}, but to add features to the C\+Img\+List$<$\+T$>$ class.
\item {\bfseries {\ttfamily cimgdisplay\+\_\+plugin} }\+: Same as {\ttfamily cimg\+\_\+plugin}, but to add features to the C\+Img\+Display$<$\+T$>$ class.
\end{DoxyItemize}

All these compilation variables can be checked, using the function \hyperlink{namespacecimg__library_1_1cimg_ac1b66fe77173de9e5e8542b2823d6071}{cimg\+\_\+library\+::cimg\+::info()}, which displays a list of the different configuration variables and their values on the standard error output.