#include #include //#include //#include int PASCAL WinMain(HINSTANCE /*hInstance*/,HINSTANCE /*hPrevInstance*/,LPSTR /*lpszCmdLine*/,int /*nCmdShow*/) { BTree treeStrings; String firstString("SEAN"); String secondString("RONI"); treeStrings.insertItem(firstString,TRUE); treeStrings.insertItem(secondString,TRUE); treeStrings.insertItem(secondString,TRUE); return treeStrings.leaves(); } #if 0 #include #include #include #include #include #include #include #include #include #include #include void testPhaseThree(String srcBitmap,String dstBitmap); void testPhaseFour(void); void main() { String bitmapOneName("C:\\WORK\\SCENE\\BMP\\COMPTILE.BMP"); String bitmapTwoName("C:\\WORK\\SCENE\\BMP\\RIDEN.BMP"); Bitmap bitmapOne(bitmapOneName); Bitmap bitmapTwo(bitmapTwoName); PurePalette paletteTwo((HPALETTE)bitmapTwo); PurePalette paletteOne((HPALETTE)bitmapOne); if(!paletteOne.isIdentityPalette())cout << (LPSTR)bitmapOneName << " is not identity" << endl; else cout << (LPSTR)bitmapOneName << " is identity" << endl; paletteOne.identityPalette(); if(!paletteOne.isIdentityPalette())cout << (LPSTR)bitmapOneName << " is not identity" << endl; else cout << (LPSTR)bitmapOneName << " is identity" << endl; if(!(paletteOne==paletteTwo))cout << "Palettes are not identical" << endl; else cout << "Palettes are identical" << endl; bitmapOne.setPalette(paletteOne); bitmapOne.saveBitmap("C:\\WORK\\SCENE\\BMP\\RIDEN2.BMP"); #if 0 PurePalette::PaletteIndex paletteIndex; String bitmapOneName("C:\\WORK\\SCENE\\BMP\\RIDEN.BMP"); String bitmapTwoName("C:\\WORK\\SCENE\\BMP\\RIDEN2.BMP"); String bitmapOrgName("C:\\WORK\\SCENE\\BMP\\RSKY1.BMP"); Bitmap bitmapOne(bitmapOneName); Bitmap bitmapTwo(bitmapTwoName); Bitmap bitmapOrg(bitmapOrgName); PurePalette bitmapOnePalette((HPALETTE)bitmapOne); PurePalette bitmapTwoPalette((HPALETTE)bitmapTwo); PurePalette bitmapOrgPalette((HPALETTE)bitmapOrg); RGBColor rgbColorOne; RGBColor rgbColorTwo; RGBColor rgbColorOrg; BYTE bmOneByte; BYTE bmTwoByte; BYTE bmOrgByte; short bmDelta; short errors(0); char ch; if(bitmapOne.width()!=bitmapTwo.width()||bitmapOne.height()!=bitmapTwo.height()) {cout << "Bitmaps have same dimensions" << endl;return;} for(short rowIndex=0;rowIndex> ch; if('q'==ch)return; } } } return; #endif } #if 0 int PASCAL WinMain(HINSTANCE /*hInstance*/,HINSTANCE /*hPrevInstance*/,LPSTR /*lpszCmdLine*/,int /*nCmdShow*/) { testPhaseFour(); return FALSE; } #endif void testPhaseFour() { ffblk ffblk; String firstFile; String secondFile; String pathFileSpec; String pathString("C:\\WORK\\ENGINE\\BMP"); String separator("\\"); String extensionString("*.BMP"); pathFileSpec=pathString; pathFileSpec+=separator; pathFileSpec+=extensionString; if(!::findfirst(pathFileSpec,&ffblk,FA_ARCH)) { firstFile=pathString; firstFile+=separator; firstFile+=String(ffblk.ff_name); while(!::findnext(&ffblk)) { secondFile=pathString; secondFile+=separator; secondFile+=String(ffblk.ff_name); testPhaseThree(firstFile,secondFile); firstFile=secondFile; } } } void testPhaseThree(String srcBitmap,String dstBitmap) { PureVector rgbColorOne; PureVector rgbColorTwo; PureVector rgbIndexColorOne; PureVector rgbIndexColorTwo; RGBTree bspTree; RGBIndex searchRGB; WORD errorCount(0); cout << "Looking at <" << (LPSTR)srcBitmap << ">" << endl << "<" << (LPSTR)dstBitmap << ">" << endl; Bitmap imageBitmapOne(srcBitmap); Bitmap imageBitmapTwo(dstBitmap); PurePalette purePaletteOne((HPALETTE)imageBitmapOne); PurePalette purePaletteTwo((HPALETTE)imageBitmapTwo); purePaletteOne.getPaletteColors(rgbColorOne); purePaletteTwo.getPaletteColors(rgbColorTwo); rgbIndexColorOne.size(rgbColorOne.size()); rgbIndexColorTwo.size(rgbColorTwo.size()); for(short index=0;index