MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi__bmp_info

Function stbi__bmp_info

Source/Utils/stb_image.h:7332–7352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7330
7331#ifndef STBI_NO_BMP
7332static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
7333{
7334 void *p;
7335 stbi__bmp_data info;
7336
7337 info.all_a = 255;
7338 p = stbi__bmp_parse_header(s, &info);
7339 if (p == NULL) {
7340 stbi__rewind( s );
7341 return 0;
7342 }
7343 if (x) *x = s->img_x;
7344 if (y) *y = s->img_y;
7345 if (comp) {
7346 if (info.bpp == 24 && info.ma == 0xff000000)
7347 *comp = 3;
7348 else
7349 *comp = info.ma ? 4 : 3;
7350 }
7351 return 1;
7352}
7353#endif
7354
7355#ifndef STBI_NO_PSD

Callers 1

stbi__info_mainFunction · 0.85

Calls 2

stbi__bmp_parse_headerFunction · 0.85
stbi__rewindFunction · 0.85

Tested by

no test coverage detected