00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "plstdpch.h"
00017 #include "plbmpdec.h"
00018 #include "plexcept.h"
00019
00020 PLBmpDecoder::PLBmpDecoder
00021 () : PLPicDecoder()
00022
00023 {
00024 }
00025
00026
00027 PLBmpDecoder::~PLBmpDecoder
00028 ()
00029 {
00030 }
00031
00032
00033 void PLBmpDecoder::DoDecode
00034 ( PLBmp * pBmp,
00035 PLDataSource * pDataSrc
00036 )
00037 {
00038 WINBITMAPINFOHEADER * pBMI = NULL;
00039
00040 try
00041 {
00042 PLPixel32 Pal[256];
00043 pBMI = getInfoHeader (pDataSrc, &Pal[0]);
00044
00045 int DestBPP = pBMI->biBitCount;
00046 bool bAlpha = false;
00047 if (DestBPP == 32)
00048 bAlpha = true;
00049 if (DestBPP > 8)
00050 DestBPP = 32;
00051 if (DestBPP < 8)
00052 DestBPP = 8;
00053
00054 pBmp->Create (pBMI->biWidth, pBMI->biHeight, DestBPP, bAlpha);
00055 if (DestBPP == 8)
00056 pBmp->SetPalette (&Pal[0]);
00057
00058 pBmp->Lock(false, true);
00059
00060 try
00061 {
00062 switch (pBMI->biBitCount)
00063 {
00064 case 1:
00065 decode1bpp (pDataSrc, pBmp);
00066 break;
00067 case 4:
00068 if (pBMI->biCompression == BI_RGB)
00069 decode4bpp (pDataSrc, pBmp);
00070 else
00071 decodeRLE4 (pDataSrc, pBmp);
00072 break;
00073 case 8:
00074 if (pBMI->biCompression == BI_RGB)
00075 decode8bpp (pDataSrc, pBmp);
00076 else
00077 decodeRLE8 (pDataSrc, pBmp);
00078 break;
00079 case 16:
00080 decodeHiColor (pDataSrc, pBmp, pBMI);
00081 break;
00082 case 24:
00083 case 32:
00084 decodeTrueColor (pDataSrc, pBmp, pBMI->biBitCount);
00085 break;
00086 default:
00087
00088 raiseError (PL_ERRFORMAT_UNKNOWN,
00089 "Decoding bmp: Illegal bpp value.");
00090 }
00091 PLPoint DPI(0,0);
00092
00093 if (pBMI->biXPelsPerMeter > 0)
00094 DPI.x = (int)((float)pBMI->biXPelsPerMeter / 39.37f+0.5);
00095 if (DPI.x <= 1)
00096 DPI.x = 150;
00097
00098 if (pBMI->biYPelsPerMeter > 0)
00099 DPI.y = (int)((float)pBMI->biYPelsPerMeter / 39.37f+0.5);
00100 if (DPI.y <= 1)
00101 DPI.y = 150;
00102 pBmp->SetResolution(DPI);
00103
00104 pBmp->Unlock();
00105
00106 delete pBMI;
00107 pBMI = NULL;
00108 Trace (3, "Decoding finished.\n");
00109 }
00110 catch (...)
00111 {
00112 pBmp->Unlock();
00113 throw;
00114 }
00115 }
00116 catch (PLTextException)
00117 {
00118 if (pBMI)
00119 delete pBMI;
00120 throw;
00121 }
00122 catch(...)
00123 {
00124 delete pBMI;
00125 throw;
00126 }
00127 }
00128
00129 WINBITMAPINFOHEADER * PLBmpDecoder::getInfoHeader
00130 ( PLDataSource * pDataSrc,
00131 PLPixel32* pPal
00132 )
00133
00134 {
00135 WINBITMAPFILEHEADER BFH;
00136 WINBITMAPINFOHEADER * pBMI;
00137 int offset = 0;
00138
00139 BFH.bfType = ReadIWord (pDataSrc);
00140
00141 while (BFH.bfType == 0x4142)
00142 {
00143 BFH.bfSize = ReadILong (pDataSrc);
00144 BFH.bfReserved1 = ReadIWord (pDataSrc);
00145 BFH.bfReserved2 = ReadIWord (pDataSrc);
00146 BFH.bfOffBits = ReadILong (pDataSrc);
00147 BFH.bfType = ReadIWord (pDataSrc);
00148 offset += 14;
00149 }
00150
00151 BFH.bfSize = ReadILong (pDataSrc);
00152 BFH.bfReserved1 = ReadIWord (pDataSrc);
00153 BFH.bfReserved2 = ReadIWord (pDataSrc);
00154 BFH.bfOffBits = ReadILong (pDataSrc);
00155
00156
00157
00158 if (!((BFH.bfType == 0x4142) || (BFH.bfType == 0x4d42) ||
00159 (BFH.bfType == 0x4349) || (BFH.bfType == 0x5043) ||
00160 (BFH.bfType == 0x4943) || (BFH.bfType == 0x5043)))
00161 raiseError (PL_ERRWRONG_SIGNATURE,
00162 "Bitmap decoder: This isn't a bitmap.");
00163
00164 Trace (2, "Bitmap file signature found\n");
00165
00166 pBMI = new WINBITMAPINFOHEADER;
00167
00168 try
00169 {
00170 int Colors = 0;
00171
00172 pBMI->biSize = ReadILong (pDataSrc);
00173
00174 if (pBMI->biSize == 12)
00175 {
00176
00177 pBMI->biWidth = ReadIWord(pDataSrc);
00178 pBMI->biHeight = ReadIWord(pDataSrc);
00179 pBMI->biPlanes = ReadIWord(pDataSrc);
00180 pBMI->biBitCount = ReadIWord(pDataSrc);
00181
00182 pBMI->biCompression = 0;
00183 pBMI->biSizeImage = 0;
00184 pBMI->biXPelsPerMeter = 0;
00185 pBMI->biYPelsPerMeter = 0;
00186 pBMI->biClrUsed = 0;
00187 pBMI->biClrImportant = 0;
00188
00189
00190 if (pBMI->biBitCount <= 8)
00191 {
00192 Colors = readPalette (pBMI, pDataSrc, pPal, 3);
00193 pDataSrc->Skip(BFH.bfOffBits - 26 - 3 * Colors - offset);
00194 }
00195 }
00196 else if (pBMI->biSize == 40)
00197 {
00198
00199 pBMI->biWidth = ReadILong (pDataSrc);
00200 pBMI->biHeight = ReadILong (pDataSrc);
00201 pBMI->biPlanes = ReadIWord (pDataSrc);
00202 pBMI->biBitCount = ReadIWord (pDataSrc);
00203 pBMI->biCompression = ReadILong (pDataSrc);
00204 pBMI->biSizeImage = ReadILong (pDataSrc);
00205 pBMI->biXPelsPerMeter = ReadILong (pDataSrc);
00206 pBMI->biYPelsPerMeter = ReadILong (pDataSrc);
00207 pBMI->biClrUsed = ReadILong (pDataSrc);
00208 pBMI->biClrImportant = ReadILong (pDataSrc);
00209
00210
00211 if (pBMI->biBitCount <= 8)
00212 Colors = readPalette (pBMI, pDataSrc, pPal, 4);
00213 }
00214 else
00215 {
00216
00217 pBMI->biWidth = ReadILong (pDataSrc);
00218 pBMI->biHeight = ReadILong (pDataSrc);
00219 pBMI->biPlanes = ReadIWord (pDataSrc);
00220 pBMI->biBitCount = ReadIWord (pDataSrc);
00221 pBMI->biCompression = ReadILong (pDataSrc);
00222 pBMI->biSizeImage = ReadILong (pDataSrc);
00223 pBMI->biXPelsPerMeter = ReadILong (pDataSrc);
00224 pBMI->biYPelsPerMeter = ReadILong (pDataSrc);
00225 pBMI->biClrUsed = ReadILong (pDataSrc);
00226 pBMI->biClrImportant = ReadILong (pDataSrc);
00227 pDataSrc->Skip(pBMI->biSize - sizeof (WINBITMAPINFOHEADER));
00228
00229
00230 if (pBMI->biBitCount <= 8)
00231 Colors = readPalette (pBMI, pDataSrc, pPal, 3);
00232 }
00233
00234 Trace (2, "Bitmap header is ok.\n");
00235
00236 }
00237 catch (PLTextException)
00238 {
00239 if (pBMI)
00240 delete pBMI;
00241 throw;
00242 }
00243 catch(...)
00244 {
00245 delete pBMI;
00246 throw;
00247 }
00248 return pBMI;
00249 }
00250
00251 void PLBmpDecoder::decode1bpp
00252 ( PLDataSource * pDataSrc,
00253 PLBmp * pBmp
00254 )
00255
00256
00257 {
00258 int i;
00259 int y;
00260 int x;
00261
00262 PLBYTE * pDest;
00263 PLBYTE * pSrc;
00264 PLBYTE BTable[8];
00265 PLBYTE SrcByte;
00266 int XSize = pBmp->GetWidth();
00267 int LineLen = ((XSize+7)/8 + 3) & ~3;
00268
00269
00270 int LinePadding = LineLen-((XSize+7)/8);
00271 PLBYTE ** pLineArray = pBmp->GetLineArray();
00272
00273
00274 int OpaqueBlack = 0x00000000;
00275 *(((PLBYTE*)&OpaqueBlack)+PL_RGBA_ALPHA) = 0xFF;
00276
00277 Trace (2, "Decoding 1 bit per pixel bitmap.\n");
00278
00279
00280 for (i=0; i<8; i++)
00281 {
00282 BTable[i] = 1<<i;
00283 }
00284
00285 for (y=0; y<pBmp->GetHeight(); y++)
00286 {
00287 pDest = pLineArray[pBmp->GetHeight()-y-1];
00288 for (x=0; x<XSize/8; x++)
00289 {
00290 pSrc = pDataSrc->Read1Byte();
00291 SrcByte = *(pSrc);
00292 for (i=7; i>=0; i--)
00293 {
00294 if (SrcByte & BTable[i])
00295 *pDest = 0x01;
00296 else
00297 *pDest = 0x00;
00298 pDest++;
00299 }
00300 }
00301
00302
00303 if (XSize & 7)
00304 {
00305 pSrc = pDataSrc->Read1Byte();
00306 SrcByte = *(pSrc);
00307 for (i=7; i>7-(XSize & 7); i--)
00308 {
00309 if (SrcByte & BTable[i])
00310 *pDest = 0x01;
00311 else
00312 *pDest = 0x00;
00313 pDest++;
00314 }
00315 }
00316 pDataSrc->Skip (LinePadding);
00317 }
00318 }
00319
00320
00321 void PLBmpDecoder::decode4bpp
00322 ( PLDataSource * pDataSrc,
00323 PLBmp * pBmp
00324 )
00325
00326 {
00327 int y;
00328 int x;
00329
00330 PLBYTE * pDest;
00331 PLBYTE * pSrc;
00332 PLBYTE SrcByte;
00333 int XSize = pBmp->GetWidth();
00334 int LineLen = ((XSize+1)/2 + 3) & ~3;
00335
00336
00337 int LinePadding = LineLen-((XSize+1)/2);
00338 PLBYTE ** pLineArray = pBmp->GetLineArray();
00339
00340
00341 Trace (2, "Decoding uncompressed 4 bit per pixel bitmap.\n");
00342
00343 for (y=0; y<pBmp->GetHeight(); y++)
00344 {
00345 pDest = pLineArray[pBmp->GetHeight()-y-1];
00346 for (x=0; x<XSize/2; x++)
00347 {
00348 pSrc = pDataSrc->Read1Byte();
00349 SrcByte = *(pSrc);
00350
00351 *pDest = SrcByte>>4;
00352 pDest++;
00353 *pDest = SrcByte & 15;
00354 pDest++;
00355 }
00356
00357
00358 if (XSize & 1)
00359 {
00360 pSrc = pDataSrc->Read1Byte();
00361 *pDest = (*(pSrc))>>4;
00362 pDest++;
00363 }
00364 pDataSrc->Skip (LinePadding);
00365 }
00366 }
00367
00368
00369 void PLBmpDecoder::decode8bpp
00370 ( PLDataSource * pDataSrc,
00371 PLBmp * pBmp
00372 )
00373
00374 {
00375 int y;
00376 int x;
00377
00378 PLBYTE * pDest;
00379 PLBYTE * pSrc;
00380 int XSize = pBmp->GetWidth();
00381 int LineLen = (XSize + 3) & ~3;
00382
00383
00384 int LinePadding = LineLen-XSize;
00385 PLBYTE ** pLineArray = pBmp->GetLineArray();
00386
00387
00388 Trace (2, "Decoding uncompressed 8 bit per pixel bitmap.\n");
00389
00390 for (y=0; y<pBmp->GetHeight(); y++)
00391 {
00392 pDest = pLineArray[pBmp->GetHeight()-y-1];
00393 for (x=0; x<XSize; x++)
00394 {
00395 pSrc = pDataSrc->Read1Byte();
00396 *pDest = *pSrc;
00397 pDest++;
00398 }
00399 pDataSrc->Skip (LinePadding);
00400 }
00401 }
00402
00403
00404 void PLBmpDecoder::decodeRLE4
00405 ( PLDataSource * pDataSrc,
00406 PLBmp * pBmp
00407 )
00408
00409 {
00410 int y;
00411
00412 PLBYTE * pSrc;
00413 PLBYTE * pDest;
00414 int XSize = pBmp->GetWidth();
00415 PLBYTE SrcByte;
00416
00417 PLBYTE RunLength;
00418 bool bOdd;
00419
00420 bool bEOL;
00421 bool bEOF=false;
00422
00423 PLBYTE * pLineBuf;
00424 PLBYTE * pBuf;
00425 PLBYTE ** pLineArray = pBmp->GetLineArray();
00426
00427
00428 Trace (2, "Decoding RLE4-compressed bitmap.\n");
00429
00430
00431
00432 pLineBuf = new PLBYTE [XSize*4+28];
00433
00434 for (y=0; y<pBmp->GetHeight() && !bEOF; y++)
00435 {
00436 pBuf = pLineBuf;
00437 bEOL=false;
00438 while (!bEOL)
00439 {
00440 pSrc = pDataSrc->Read1Byte();
00441 RunLength = *pSrc;
00442 if (RunLength==0)
00443 {
00444 pSrc = pDataSrc->Read1Byte();
00445 RunLength = *pSrc;
00446 switch (RunLength)
00447 {
00448 case 0:
00449 bEOL = true;
00450 break;
00451 case 1:
00452 bEOF = true;
00453 bEOL = true;
00454 break;
00455 case 2:
00456
00457 delete [] pLineBuf;
00458 raiseError (PL_ERRFORMAT_NOT_SUPPORTED,
00459 "Encountered delta escape.");
00460 break;
00461 default:
00462
00463 bOdd = (RunLength & 1);
00464 RunLength /= 2;
00465 for (int i=0; i<RunLength; i++)
00466 {
00467 pSrc = pDataSrc->Read1Byte();
00468 decode2Nibbles (pBuf, *pSrc);
00469 pBuf += 2;
00470 }
00471 if (bOdd)
00472 {
00473 pSrc = pDataSrc->Read1Byte();
00474 *pBuf = (*(pSrc))>>4;
00475 pBuf++;
00476 }
00477
00478 if ((RunLength + bOdd) & 1) pDataSrc->Skip(1);
00479 }
00480 }
00481 else
00482 {
00483
00484
00485 pSrc = pDataSrc->Read1Byte();
00486 SrcByte = *pSrc;
00487 for (int i=0; i<RunLength/2; i++)
00488 {
00489 decode2Nibbles (pBuf, SrcByte);
00490 pBuf += 2;
00491 }
00492 if (RunLength & 1)
00493 {
00494 *pBuf = (*(pSrc))>>4;
00495 pBuf++;
00496 }
00497 }
00498 }
00499 pDest = pLineArray[pBmp->GetHeight()-y-1];
00500 memcpy (pDest, pLineBuf, XSize);
00501 }
00502 delete [] pLineBuf;
00503 }
00504
00505
00506 void PLBmpDecoder::decodeRLE8
00507 ( PLDataSource * pDataSrc,
00508 PLBmp * pBmp
00509 )
00510
00511 {
00512 int y;
00513
00514 PLBYTE * pDest;
00515 PLBYTE * pSrc;
00516 PLBYTE RunLength;
00517 bool bEOL;
00518 bool bEOF=false;
00519 PLBYTE ** pLineArray = pBmp->GetLineArray();
00520
00521
00522 Trace (2, "Decoding RLE8-compressed bitmap.\n");
00523
00524 for (y=0; y<pBmp->GetHeight() && !bEOF; y++)
00525 {
00526 pDest = pLineArray[pBmp->GetHeight()-y-1];
00527 bEOL=false;
00528 while (!bEOL)
00529 {
00530 pSrc = pDataSrc->Read1Byte();
00531 RunLength = *pSrc;
00532 if (RunLength==0)
00533 {
00534 pSrc = pDataSrc->Read1Byte();
00535 RunLength = *pSrc;
00536 switch (RunLength)
00537 {
00538 case 0:
00539 bEOL = true;
00540 break;
00541 case 1:
00542 bEOF = true;
00543 bEOL = true;
00544 break;
00545 case 2:
00546
00547 raiseError (PL_ERRFORMAT_NOT_SUPPORTED,
00548 "Encountered delta escape.");
00549 bEOL = true;
00550 bEOF = true;
00551 break;
00552 default:
00553
00554 pSrc = pDataSrc->ReadNBytes(RunLength);
00555 memcpy (pDest, pSrc, RunLength);
00556 pDest += RunLength;
00557
00558 if (RunLength & 1) pDataSrc->Skip(1);
00559 }
00560 }
00561 else
00562 {
00563
00564 pSrc = pDataSrc->Read1Byte();
00565 memset (pDest, *pSrc, RunLength);
00566 pDest += RunLength;
00567 }
00568 }
00569 }
00570 }
00571
00572 void PLBmpDecoder::decodeHiColor
00573 ( PLDataSource * pDataSrc,
00574 PLBmp * pBmp,
00575 WINBITMAPINFOHEADER * pBMI
00576 )
00577 {
00578 if (pBMI->biCompression == BI_RGB)
00579 decodeTrueColor (pDataSrc, pBmp, 15);
00580 else
00581 {
00582 PLASSERT (pBMI->biCompression == BI_BITFIELDS);
00583
00584 PLULONG * pColMask;
00585 pDataSrc->Read4Bytes();
00586 pColMask = (PLULONG *) pDataSrc->ReadNBytes(4);
00587 pDataSrc->Read4Bytes();
00588 if (*pColMask == 0x03E0)
00589 decodeTrueColor (pDataSrc, pBmp, 15);
00590 else
00591 decodeTrueColor (pDataSrc, pBmp, 16);
00592 }
00593 }
00594
00595
00596 void PLBmpDecoder::decodeTrueColor
00597 ( PLDataSource * pDataSrc,
00598 PLBmp * pBmp,
00599 int SrcBPP
00600 )
00601
00602 {
00603 int y;
00604 PLBYTE * pDest;
00605 PLBYTE ** pLineArray = pBmp->GetLineArray();
00606
00607
00608 Trace (2, "Decoding true-color bitmap.\n");
00609
00610 for (y=0; y<pBmp->GetHeight(); y++)
00611 {
00612 pDest = pLineArray[pBmp->GetHeight()-y-1];
00613 switch (SrcBPP)
00614 {
00615 case 15:
00616 decode15bppLine (pDataSrc, pBmp, pDest);
00617 break;
00618 case 16:
00619 decode16bppLine (pDataSrc, pBmp, pDest);
00620 break;
00621 case 24:
00622 decode24bppLine (pDataSrc, pBmp, pDest);
00623 break;
00624 case 32:
00625 decode32bppLine (pDataSrc, pBmp, pDest);
00626 break;
00627 default:
00628
00629 PLASSERT (false);
00630 }
00631 }
00632 }
00633
00634 void PLBmpDecoder::decode15bppLine
00635 ( PLDataSource * pDataSrc,
00636 PLBmp * pBmp,
00637 PLBYTE * pDest
00638 )
00639 {
00640 int LineLen = (pBmp->GetWidth()*2 + 3) & ~3;
00641
00642 int LinePadding = LineLen - pBmp->GetWidth()*2;
00643
00644 int x;
00645 for (x=0; x<pBmp->GetWidth(); x++)
00646 {
00647 PLBYTE * pSrc = pDataSrc->ReadNBytes(2);
00648 PLWORD Pixel = *(PLWORD*)pSrc;
00649 *(pDest+PL_RGBA_RED) = PLBYTE (( Pixel >> 7 ) & 0x0F8);
00650 *(pDest+PL_RGBA_GREEN) = PLBYTE (( Pixel >> 2 ) & 0x0F8);
00651 *(pDest+PL_RGBA_BLUE) = PLBYTE (( Pixel & 0x1F ) * 8);
00652 *(pDest+PL_RGBA_ALPHA) = 0xFF;
00653 pDest += 4;
00654 }
00655 pDataSrc->Skip (LinePadding);
00656 }
00657
00658 void PLBmpDecoder::decode16bppLine
00659 ( PLDataSource * pDataSrc,
00660 PLBmp * pBmp,
00661 PLBYTE * pDest
00662 )
00663 {
00664 int LineLen = (pBmp->GetWidth()*2 + 3) & ~3;
00665
00666 int LinePadding = LineLen - pBmp->GetWidth()*2;
00667
00668 int x;
00669 for (x=0; x<pBmp->GetWidth(); x++)
00670 {
00671 PLBYTE * pSrc = pDataSrc->ReadNBytes(2);
00672 PLWORD Pixel = *(PLWORD*)pSrc;
00673 *(pDest+PL_RGBA_RED) = PLBYTE (( Pixel >> 8 ) & 0x0F8);
00674 *(pDest+PL_RGBA_GREEN) = PLBYTE (( Pixel >> 3 ) & 0x0F8);
00675 *(pDest+PL_RGBA_BLUE) = PLBYTE (( Pixel & 0x1F ) * 8);
00676 *(pDest+PL_RGBA_ALPHA) = 0xFF;
00677 pDest += 4;
00678 }
00679 pDataSrc->Skip (LinePadding);
00680 }
00681
00682
00683 void PLBmpDecoder::decode24bppLine
00684 ( PLDataSource * pDataSrc,
00685 PLBmp * pBmp,
00686 PLBYTE * pDest
00687 )
00688 {
00689 int LineLen = (pBmp->GetWidth()*3 + 3) & ~3;
00690
00691 int LinePadding = LineLen - pBmp->GetWidth()*3;
00692
00693 int x;
00694 for (x=0; x<pBmp->GetWidth(); x++)
00695 {
00696 PLBYTE * pSrc;
00697 pSrc = pDataSrc->ReadNBytes(3);
00698 *(pDest+PL_RGBA_BLUE) = ((WINRGBQUAD *)pSrc)->rgbBlue;
00699 *(pDest+PL_RGBA_GREEN) = ((WINRGBQUAD *)pSrc)->rgbGreen;
00700 *(pDest+PL_RGBA_RED) = ((WINRGBQUAD *)pSrc)->rgbRed;
00701 *(pDest+PL_RGBA_ALPHA) = 0xFF;
00702 pDest += 4;
00703 }
00704 pDataSrc->Skip (LinePadding);
00705 }
00706
00707 void PLBmpDecoder::decode32bppLine
00708 ( PLDataSource * pDataSrc,
00709 PLBmp * pBmp,
00710 PLBYTE * pDest
00711 )
00712 {
00713 PLBYTE * pSrc = pDataSrc->ReadNBytes (pBmp->GetWidth()*4);
00714 memcpy (pDest, pSrc, pBmp->GetWidth()*4);
00715 }
00716
00717
00718 void PLBmpDecoder::decode2Nibbles
00719 ( PLBYTE * pDest,
00720 PLBYTE SrcByte
00721 )
00722
00723 {
00724 *pDest = SrcByte>>4;
00725 *(pDest+1) = SrcByte & 15;
00726 }
00727
00728 int PLBmpDecoder::readPalette
00729 ( WINBITMAPINFOHEADER * pBMI,
00730 PLDataSource * pDataSrc,
00731 PLPixel32 * pPal,
00732 int RGBSize
00733 )
00734
00735 {
00736 Trace (3, "Reading palette.\n");
00737 int i;
00738
00739 int NumColors;
00740 if (pBMI->biClrUsed == 0)
00741 NumColors = 1<<(pBMI->biBitCount);
00742 else
00743 NumColors = pBMI->biClrUsed;
00744
00745 PLBYTE * pFilePal = (PLBYTE *) pDataSrc->ReadNBytes (NumColors*RGBSize);
00746 WINRGBQUAD * pCurEntry;
00747
00748
00749 for (i=0; i<NumColors; i++)
00750 {
00751 pCurEntry = (WINRGBQUAD *)(pFilePal+(RGBSize)*i);
00752 pPal[i].Set (pCurEntry->rgbRed, pCurEntry->rgbGreen,
00753 pCurEntry->rgbBlue, 0xFF);
00754 }
00755
00756 return NumColors;
00757 }
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842