00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: pltester.h,v 1.26 2004/04/15 19:09:38 uzadow Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | 00008 \-------------------------------------------------------------------- 00009 */ 00010 00011 #ifndef INCL_PLTESTER 00012 #define INCL_PLTESTER 00013 00014 #include "pltest.h" 00015 #include "config.h" 00016 00017 #ifdef _WINDOWS 00018 #include <windows.h> 00019 #else 00020 #include "plpaintlibdefs.h" 00021 #endif 00022 00023 #include "plbitmap.h" 00024 #include "planybmp.h" 00025 00026 #ifdef PL_SUPPORT_SDL 00027 #include "plsdlbmp.h" 00028 #endif 00029 00030 #ifdef PL_SUPPORT_DFB 00031 #include "pldirectfbbmp.h" 00032 #endif 00033 00034 #ifdef _WINDOWS 00035 #include "pldibsect.h" 00036 // #include "plddrawbmp.h" 00037 #endif 00038 00039 #include "plpicenc.h" 00040 #include "plpicdec.h" 00041 00042 #include <string> 00043 00044 class PLFilter; 00045 00046 class PLTester: public PLTest 00047 { 00048 00049 public: 00050 PLTester (); 00051 00052 virtual ~PLTester(); 00053 00054 virtual void RunTests (); 00055 00056 static const std::string m_sTestFileDir; 00057 static const std::string m_sTestFileList; 00058 00059 private: 00060 void testBmpInfo (PLBmpInfo& BmpInfo); 00061 void testPLBmp (PLBmp& Bmp); 00062 #ifdef PL_SUPPORT_SDL 00063 void testPLSDLBmp (); 00064 #endif 00065 #ifdef _WINDOWS 00066 void testPLWinBmp (PLWinBmp& Bmp); 00067 void testLoadRes (); 00068 void testDIBSect (PLDIBSection& Bmp); 00069 #endif 00070 void testPixels (); 00071 void testPoint (); 00072 void testRect (); 00073 00074 void testCodec (const PLPicEncoder& Encoder, const PLPicDecoder& Decoder); 00075 void testCodecBmp (PLBmp& Bmp, const PLPicEncoder& Encoder, 00076 const PLPicDecoder& Decoder, char * pszFName); 00077 #ifdef PL_SUPPORT_TIFF 00078 void testCTIFFEx (PLBmp& Bmp); 00079 #endif 00080 00081 void setUpBmp (PLBmp& Bmp, int BPP); 00082 void setUp (); 00083 void tearDown (); 00084 void dumpBmp (PLBmp& bmp); 00085 bool almostEqual (PLBmp& bmp1, PLBmp& bmp2, int epsilon); 00086 00087 PLAnyBmp m_AnyBmp8; 00088 PLAnyBmp m_AnyBmp24; 00089 PLAnyBmp m_AnyBmp32; 00090 #ifdef PL_SUPPORT_SDL 00091 PLSDLBmp m_SDLBmp; 00092 #endif 00093 00094 #ifdef PL_SUPPORT_DFB 00095 PLDirectFBBmp * m_pDirectFBBmp; 00096 #endif 00097 00098 #ifdef _WINDOWS 00099 PLDIBSection m_DIBSect8; 00100 PLDIBSection m_DIBSect32; 00101 #endif 00102 00103 // PLDDrawBmp m_DDBmp8; 00104 // PLDDrawBmp m_DDBmp32; 00105 }; 00106 00107 #endif 00108 /* 00109 /-------------------------------------------------------------------- 00110 | 00111 | $Log: pltester.h,v $ 00112 | Revision 1.26 2004/04/15 19:09:38 uzadow 00113 | - Moved TestBmpList to test source, where it is versioned. 00114 | - All test output goes to cerr now. 00115 | 00116 | Revision 1.25 2003/07/27 13:50:49 uzadow 00117 | Added support for DirectFB surfaces. 00118 | 00119 | Revision 1.24 2003/04/13 21:51:43 uzadow 00120 | Added exif loading - windows ver. 00121 | 00122 | Revision 1.23 2003/03/08 15:16:02 uzadow 00123 | Added PLSDLBmp::Attach(). 00124 | 00125 | Revision 1.22 2003/03/08 14:32:20 uzadow 00126 | Added support for bitmaps in SDL surface format. 00127 | 00128 | Revision 1.21 2002/11/27 22:32:24 uzadow 00129 | Now works if TIFF, PNG and/or JPEG support are not available 00130 | 00131 | Revision 1.20 2002/08/04 20:08:01 uzadow 00132 | Added PLBmpInfo class, ability to extract metainformation from images without loading the whole image and proper greyscale support. 00133 | 00134 | Revision 1.19 2002/02/24 13:00:49 uzadow 00135 | Documentation update; removed buggy PLFilterRotate. 00136 | 00137 | Revision 1.18 2001/10/06 20:44:45 uzadow 00138 | Linux compatibility 00139 | 00140 | Revision 1.17 2001/10/03 14:00:29 uzadow 00141 | Much improved quality in FilterResizeBilinear. 00142 | 00143 | Revision 1.16 2001/09/30 19:55:37 uzadow 00144 | Fixed bug for 8 bpp in PLFilterCrop. 00145 | 00146 | Revision 1.15 2001/09/28 19:50:56 uzadow 00147 | Added some 24 bpp stuff & other minor features. 00148 | 00149 | Revision 1.14 2001/09/24 14:19:19 uzadow 00150 | Added PLPoint & PLRect tests. 00151 | 00152 | Revision 1.13 2001/09/16 20:57:17 uzadow 00153 | Linux version name prefix changes 00154 | 00155 | Revision 1.12 2001/09/16 19:03:23 uzadow 00156 | Added global name prefix PL, changed most filenames. 00157 | 00158 | Revision 1.11 2001/09/15 14:30:20 uzadow 00159 | Fixed PLPixel32 initialization bug. 00160 | 00161 | Revision 1.10 2001/09/13 20:49:31 uzadow 00162 | Added fill filters. 00163 | 00164 | Revision 1.9 2001/01/15 15:05:31 uzadow 00165 | Added PLBmp::ApplyFilter() and PLBmp::CreateFilteredCopy() 00166 | 00167 | Revision 1.8 2001/01/13 20:06:16 uzadow 00168 | Added Flip and Mirror filters. 00169 | 00170 | Revision 1.7 2000/12/18 22:42:53 uzadow 00171 | Replaced RGBAPIXEL with PLPixel32. 00172 | 00173 | Revision 1.6 2000/12/09 12:16:26 uzadow 00174 | Fixed several memory leaks. 00175 | 00176 | Revision 1.5 2000/12/04 23:59:02 uzadow 00177 | Added filter tests. 00178 | 00179 | Revision 1.4 2000/12/03 21:15:43 uzadow 00180 | Fixed png handling in configure; test/ adapted to linux 00181 | 00182 | Revision 1.3 2000/12/02 19:42:30 uzadow 00183 | Added PLTIFFEncoderEx test. 00184 | 00185 | Revision 1.2 2000/11/21 23:28:53 uzadow 00186 | Moved PLBmp tests from testdec to test. 00187 | 00188 | Revision 1.1 2000/11/21 20:29:39 uzadow 00189 | Added test project. 00190 | 00191 | 00192 \-------------------------------------------------------------------- 00193 */