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

Function stbi__bmp_test_raw

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

Source from the content-addressed store, hash-verified

5881
5882#ifndef STBI_NO_BMP
5883static int stbi__bmp_test_raw(stbi__context* s) {
5884 int r;
5885 int sz;
5886 if (stbi__get8(s) != 'B')
5887 return 0;
5888 if (stbi__get8(s) != 'M')
5889 return 0;
5890 stbi__get32le(s); // discard filesize
5891 stbi__get16le(s); // discard reserved
5892 stbi__get16le(s); // discard reserved
5893 stbi__get32le(s); // discard data offset
5894 sz = stbi__get32le(s);
5895 r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);
5896 return r;
5897}
5898
5899static int stbi__bmp_test(stbi__context* s) {
5900 int r = stbi__bmp_test_raw(s);

Callers 1

stbi__bmp_testFunction · 0.85

Calls 3

stbi__get8Function · 0.85
stbi__get32leFunction · 0.85
stbi__get16leFunction · 0.85

Tested by

no test coverage detected