Internal function used to check if the HEADER is a valid .bmp header.
| 133 | |
| 134 | // Internal function used to check if the HEADER is a valid .bmp header. |
| 135 | ILboolean iCheckBmp (const BMPHEAD * CONST_RESTRICT Header) |
| 136 | { |
| 137 | //if ((Header->bfType != ('B'|('M'<<8))) || ((Header->biSize != 0x28) && (Header->biSize != 0x0C))) |
| 138 | if ((Header->bfType != ('B'|('M'<<8))) || (Header->biSize != 0x28)) |
| 139 | return IL_FALSE; |
| 140 | if (Header->biHeight == 0 || Header->biWidth < 1) |
| 141 | return IL_FALSE; |
| 142 | if (Header->biPlanes > 1) // Not sure... |
| 143 | return IL_FALSE; |
| 144 | if(Header->biCompression != 0 && Header->biCompression != 1 && |
| 145 | Header->biCompression != 2 && Header->biCompression != 3) |
| 146 | return IL_FALSE; |
| 147 | if(Header->biCompression == 3 && Header->biBitCount != 16 && Header->biBitCount != 32) |
| 148 | return IL_FALSE; |
| 149 | if (Header->biBitCount != 1 && Header->biBitCount != 4 && Header->biBitCount != 8 && |
| 150 | Header->biBitCount != 16 && Header->biBitCount != 24 && Header->biBitCount != 32) |
| 151 | return IL_FALSE; |
| 152 | return IL_TRUE; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | ILboolean iCheckOS2 (const OS2_HEAD * CONST_RESTRICT Header) |
no outgoing calls
no test coverage detected