| 779 | } |
| 780 | |
| 781 | UINT32 PNG_getBpp(const PNG_INFO *info) |
| 782 | { |
| 783 | UINT32 bitDepth, colorType; |
| 784 | bitDepth = info->bitDepth; |
| 785 | colorType = info->colorType; |
| 786 | if (colorType == 2) |
| 787 | return (3 * bitDepth); |
| 788 | else if (colorType >= 4) |
| 789 | return (colorType - 2) * bitDepth; |
| 790 | else |
| 791 | return bitDepth; |
| 792 | } |
| 793 | |
| 794 | void PNG_readPngHeader(PNG_INFO *info, const UINT8 *in, UINT32 inlength) |
| 795 | { // read the information from the header and store it in the Info |