📄 cimg.3h
字号:
CImgInstanceException(const char *format,...) { cimg_exception_err("This error has been generated by a 'CImgInstanceException' throw.\n" "The instance passed through the function above has a bad structure" "(perhaps an empty image, list or display object ?)"); }}; //! The \ref CImgArgumentException class is used to throw an exception related //! to invalid arguments encountered in a library function call. /** This class will be thrown when one passes one or several invalid arguments to a library function. This may happen for instance in the following case : \code CImg<float> img(100,100); // define a 100x100 scalar image with float pixels img.get_channel(1); // trying to retrieve the vector channel v=1, will generate a CImgArgumentException. \endcode As the image <tt>img</tt> is scalar, it has only one vector channel (<tt>img.dim=1</tt>), and one cannot retrieve the channel 1, (only the channel 0). \see CImgException, CImgInstanceException, CImgIOException and CImgDisplayException. **/ struct CImgArgumentException : CImgException { CImgArgumentException(const char *format,...) { cimg_exception_err("This error has been generated by a 'CImgArgumentException' throw.\n" "At least one argument passed to the function above has been considered as not valid."); }}; //! The \ref CImgIOException class is used to throw an exception related //! to Input/Output file problems encountered in a library function call. /** This class will be thrown when one Input/Output problem has been encountered during the execution of a library function. This may particularly happen when using <tt>load()</tt> and <tt>save()</tt> functions, with invalid files : \code CImg<float> img("not_here.jpg"); \endcode This code will throw a \c CImgIOException instance if the file <tt>not_here.jpg</tt> is not in the current directory. \see CImgException, CImgInstanceException, CImgArgumentException and CImgDisplayException. **/ struct CImgIOException : CImgException { CImgIOException(const char *format,...) { cimg_exception_err("This error has been generated by a 'CImgIOException' throw.\n" "When trying to load or save a file, the function above has encountered a problem."); }}; //! The CImgDisplayException class is used to throw an exception related to display problems //! encountered in a library function call. /** This class will be thrown when a library function encounters a problem when trying to open or close a display window. This shouldn't happen very much if your display is detected properly. This happens for instance when trying to open a display window on a 8bits screen depth, under Unix/X11. \see CImgException, CImgInstanceException, CImgArgumentException and CImgIOException. **/ struct CImgDisplayException : CImgException { CImgDisplayException(const char *format,...) { cimg_exception_err("This error has been generated by a 'CImgDisplayException' throw.\n" "When trying to operate on a CImgDisplay instance, the function above encountered a problem."); }}; /*------------------------------------------------------------------------- Add LAPACK support to the library. Define the macro 'cimg_lapack' before including 'CImg.h' will activate the support of LAPACK. You'll have then to link your code with the Lapack library to get it working. -----------------------------------------------------------------------*/#ifdef cimg_lapack extern "C" { extern void dgeev_(char*,char*, int*,double*,int*,double*,double*,double*,int*,double*,int*,double*,int*,int*); extern void dsyev_(char*,char*,int*,double*,int*,double*,double*,int*,int*); extern void dgetrf_(int*,int*,double*,int*,int*,int*); extern void dgetri_(int*,double*,int*,int*,double*,int*,int*); }#else inline void cimg_nolapack() { throw CImgException("a LAPACK call : A LAPACK function has been required, but the LAPACK library" "hasn't been linked.\nPlease define the compilation flag '#define cimg_lapack'" "before including 'CImg.h' and link your code with LAPACK."); } inline void dgeev_ (char*,char*, int*,double*,int*,double*,double*,double*,int*,double*,int*,double*,int*,int*) { cimg_nolapack(); } inline void dsyev_ (char*, char*, int*, double*, int*, double*, double*, int*, int*) { cimg_nolapack(); } inline void dgetrf_(int*,int*,double*,int*,int*,int*) { cimg_nolapack(); } inline void dgetri_(int*,double*,int*,int*,double*,int*,int*) { cimg_nolapack(); }#endif /*---------------------------------------- Definition of the namespace 'cimg' --------------------------------------*/ //! The <tt>\ref cimg::</tt> namespace encompasses \e 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 purposes. Nevertheless, documented variables and functions below may be used by the user in its own source code. \warning Never write <tt>"using namespace cimg_library::cimg;"</tt> in your source, since a lot of functions of the \ref cimg:: namespace have the same name than standart C functions defined in the global namespace <tt>::</tt>. \see CImg, CImgl, CImgDisplay, CImgStats and CImgException. **/ namespace cimg { // Define internal library variables. const unsigned int lblock=1024;#if cimg_display_type==1 static pthread_mutex_t* X11_mutex = NULL; static pthread_t* X11_event_thread = NULL; static CImgDisplay* X11_wins[1024]; static Display* X11_display = NULL; static volatile unsigned int X11_nb_wins = 0; static volatile bool X11_thread_finished = false; static unsigned int X11_nb_bits = 0; static GC* X11_gc = NULL; static bool X11_endian = false;#endif#ifdef cimg_color_terminal const char t_normal[9] = {0x1b,'[','0',';','0',';','0','m','\0'}; const char t_red[11] = {0x1b,'[','4',';','3','1',';','5','9','m','\0'}; const char t_bold[5] = {0x1b,'[','1','m','\0'}; const char t_purple[11] = {0x1b,'[','0',';','3','5',';','5','9','m','\0'};#else const char t_normal[1] = {'\0'}; static const char *t_red = t_normal, *t_bold = t_normal, *t_purple = t_normal;#endif #if cimg_display_type!=0 && ( cimg_OS==0 || cimg_OS==1 || cimg_OS==3 ) // Keycodes for X11-based graphical systems const unsigned int keyESC = XK_Escape; const unsigned int keyF1 = XK_F1; const unsigned int keyF2 = XK_F2; const unsigned int keyF3 = XK_F3; const unsigned int keyF4 = XK_F4; const unsigned int keyF5 = XK_F5; const unsigned int keyF6 = XK_F6; const unsigned int keyF7 = XK_F7; const unsigned int keyF8 = XK_F8; const unsigned int keyF9 = XK_F9; const unsigned int keyF10 = XK_F10; const unsigned int keyF11 = XK_F11; const unsigned int keyF12 = XK_F12; const unsigned int keyPAUSE = XK_Pause; const unsigned int key1 = XK_1; const unsigned int key2 = XK_2; const unsigned int key3 = XK_3; const unsigned int key4 = XK_4; const unsigned int key5 = XK_5; const unsigned int key6 = XK_6; const unsigned int key7 = XK_7; const unsigned int key8 = XK_8; const unsigned int key9 = XK_9; const unsigned int key0 = XK_0; const unsigned int keyBACKSPACE = XK_BackSpace; const unsigned int keyINSERT = XK_Insert; const unsigned int keyHOME = XK_Home; const unsigned int keyPAGEUP = XK_Page_Up; const unsigned int keyTAB = XK_Tab; const unsigned int keyQ = XK_q; const unsigned int keyW = XK_w; const unsigned int keyE = XK_e; const unsigned int keyR = XK_r; const unsigned int keyT = XK_t; const unsigned int keyY = XK_y; const unsigned int keyU = XK_u; const unsigned int keyI = XK_i; const unsigned int keyO = XK_o; const unsigned int keyP = XK_p; const unsigned int keyDELETE = XK_Delete; const unsigned int keyEND = XK_End; const unsigned int keyPAGEDOWN = XK_Page_Down; const unsigned int keyCAPSLOCK = XK_Caps_Lock; const unsigned int keyA = XK_a; const unsigned int keyS = XK_s; const unsigned int keyD = XK_d; const unsigned int keyF = XK_f; const unsigned int keyG = XK_g; const unsigned int keyH = XK_h; const unsigned int keyJ = XK_j; const unsigned int keyK = XK_k; const unsigned int keyL = XK_l; const unsigned int keyENTER = XK_Return; const unsigned int keySHIFTLEFT = XK_Shift_L; const unsigned int keyZ = XK_z; const unsigned int keyX = XK_x; const unsigned int keyC = XK_c; const unsigned int keyV = XK_v; const unsigned int keyB = XK_b; const unsigned int keyN = XK_n; const unsigned int keyM = XK_m; const unsigned int keySHIFTRIGHT = XK_Shift_R; const unsigned int keyARROWUP = XK_Up; const unsigned int keyCTRLLEFT = XK_Control_L; const unsigned int keyAPPLEFT = XK_Super_L; const unsigned int keySPACE = XK_space; const unsigned int keyALTGR = XK_Alt_R; const unsigned int keyAPPRIGHT = XK_Super_R; const unsigned int keyMENU = XK_Menu; const unsigned int keyCTRLRIGHT = XK_Control_R; const unsigned int keyARROWLEFT = XK_Left; const unsigned int keyARROWDOWN = XK_Down; const unsigned int keyARROWRIGHT = XK_Right; #endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -