MCPcopy Create free account
hub / github.com/DentonW/DevIL / iCheckBlp1

Function iCheckBlp1

DevIL/src-IL/src/il_blp.cpp:531–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529
530
531ILboolean 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
553ILboolean iLoadBlp1()

Callers 1

iLoadBlp1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected