imagen.h
Go to the documentation of this file.
00001 /*
00002 imagen - Simple object-oriented imaging library
00003 Copyright (C) 2011-2012 Mark D. Procarione
00004 
00005 imagen is free software: you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation, either
00008 version 3 of the License, or (at your option) any later version.
00009 
00010 imagen is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details.
00014 */
00015 
00016 #ifndef __IMAGEN_H__
00017 #define __IMAGEN_H__
00018 
00019 #define IMAGEN_BMP // Comment to disable
00020 #define IMAGEN_JPEG // Comment to disable
00021 #define IMAGEN_PNG // Comment to disable
00022 #define IMAGEN_TGA // Comment to disable
00023 
00024 #define IMAGEN_VERSION 012
00025 #define IMAGEN_LETTER 'b'
00026 
00027 #ifdef _WIN32
00028     #define _IMAGEN_WIN32
00029 #else
00030     #define _IMAGEN_LINUX
00031 #endif
00032 
00033 #include <cstdio>
00034 #include <cstdlib>
00035 #include <cstring>
00036 
00169 namespace imagen
00170 {
00171     typedef signed char         Ibyte;  // 1-byte signed
00172     typedef unsigned char   Iubyte;     // 1-byte unsigned
00173     typedef unsigned short      Iushort;// 2-byte unsigned
00174     typedef unsigned int    Iuint;      // 4-byte unsigned
00175     typedef unsigned long       Iulong; // 4-byte unsigned
00176 
00177     typedef Iubyte  iBYTE;      // 1-byte unsigned
00178     typedef char    iCHAR;
00179     typedef Iushort iWORD;      // 2-byte unsigned
00180     typedef short   iSHORT;
00181     typedef long    iLONG;
00182     typedef Iulong  iDWORD;     // 4-byte unsigned
00183 
00184     enum iDataSeek
00185     {
00186         iSeekStart,
00187         iSeekCur,
00188         iSeekEnd
00189     };
00190 
00191     enum iFileMode
00192     {
00193         iRead,
00194         iWrite,
00195         iReadWrite,
00196         iAppend,
00197         iReadAppend
00198     };
00199 
00200     enum iImageFormat
00201     {
00202         iNULL,  
00203         iMono,  
00204         iIndex, 
00205         iBW,    
00206         iBWA,   
00207         iRGB,   
00208         iRGBA,  
00209         iRGB16  
00210     };
00211 
00212     enum iPalFormat
00213     {
00214         iPalNull,
00215         iPalRGB,
00216         iPalRGBA,
00217         iPalRGB16
00218     };
00219 
00220     enum iImageType
00221     {
00222         iTypeNull,
00223         iTypeRAW,
00224         iTypeBMP,
00225         iTypeJPEG,
00226         iTypePNG,
00227         iTypeTGA
00228     };
00229 
00230     enum iImageOrigin
00231     {
00232         iOriginUL,
00233         iOriginBL,
00234         iOriginUR,
00235         iOriginBR
00236     };
00237 
00238     enum iUnitType
00239     {
00240         iUnit,
00241         iCentimeter,
00242         iMeter,
00243         iInch
00244     };
00245 
00246     enum iWrapMode
00247     {
00248         iWrapBackground,
00249         iWrapClamp,
00250         iWrapRepeat
00251     };
00252 
00253     enum iBitMask
00254     {
00255         iBit0 = 0x00000001,
00256         iBit1 = 0x00000002,
00257         iBit2 = 0x00000004,
00258         iBit3 = 0x00000008,
00259         iBit4 = 0x00000010,
00260         iBit5 = 0x00000020,
00261         iBit6 = 0x00000040,
00262         iBit7 = 0x00000080
00263     };
00264 }
00265 
00266 #endif // __IMAGEN_H__