MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__bmp_info

Function stbi__bmp_info

lite/example/cpp_example/mge/cv/stb_image.h:8031–8052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8029
8030#ifndef STBI_NO_BMP
8031static int stbi__bmp_info(stbi__context* s, int* x, int* y, int* comp) {
8032 void* p;
8033 stbi__bmp_data info;
8034
8035 info.all_a = 255;
8036 p = stbi__bmp_parse_header(s, &info);
8037 if (p == NULL) {
8038 stbi__rewind(s);
8039 return 0;
8040 }
8041 if (x)
8042 *x = s->img_x;
8043 if (y)
8044 *y = s->img_y;
8045 if (comp) {
8046 if (info.bpp == 24 && info.ma == 0xff000000)
8047 *comp = 3;
8048 else
8049 *comp = info.ma ? 4 : 3;
8050 }
8051 return 1;
8052}
8053#endif
8054
8055#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