| 529 | |
| 530 | |
| 531 | ILboolean iCheckBlp1(BLP1HEAD *Header) |
| 532 | { |
| 533 | // The file signature is 'BLP1'. |
| 534 | if (strncmp((char*)Header->Sig, "BLP1", 4)) |
| 535 | return IL_FALSE; |
| 536 | // Valid types are JPEG and RAW. JPEG is not common, though. |
| 537 | if (Header->Compression != BLP_TYPE_JPG && Header->Compression != BLP_RAW) |
| 538 | return IL_FALSE; |
| 539 | //@TODO: Find out what Flags is for. |
| 540 | |
| 541 | // PictureType determines whether this has an alpha list. |
| 542 | if (Header->PictureType != BLP_RAW_PLUS_ALPHA1 && Header->PictureType != BLP_RAW_PLUS_ALPHA2 |
| 543 | && Header->PictureType != BLP_RAW_NO_ALPHA) |
| 544 | return IL_FALSE; |
| 545 | // Width or height of 0 makes no sense. |
| 546 | if (Header->Width == 0 || Header->Height == 0) |
| 547 | return IL_FALSE; |
| 548 | |
| 549 | return IL_TRUE; |
| 550 | } |
| 551 | |
| 552 | |
| 553 | ILboolean iLoadBlp1() |