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

Function stbi__psd_is16

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

Source from the content-addressed store, hash-verified

8091}
8092
8093static int stbi__psd_is16(stbi__context* s) {
8094 int channelCount, depth;
8095 if (stbi__get32be(s) != 0x38425053) {
8096 stbi__rewind(s);
8097 return 0;
8098 }
8099 if (stbi__get16be(s) != 1) {
8100 stbi__rewind(s);
8101 return 0;
8102 }
8103 stbi__skip(s, 6);
8104 channelCount = stbi__get16be(s);
8105 if (channelCount < 0 || channelCount > 16) {
8106 stbi__rewind(s);
8107 return 0;
8108 }
8109 STBI_NOTUSED(stbi__get32be(s));
8110 STBI_NOTUSED(stbi__get32be(s));
8111 depth = stbi__get16be(s);
8112 if (depth != 16) {
8113 stbi__rewind(s);
8114 return 0;
8115 }
8116 return 1;
8117}
8118#endif
8119
8120#ifndef STBI_NO_PIC

Callers 1

stbi__is_16_mainFunction · 0.85

Calls 4

stbi__get32beFunction · 0.85
stbi__rewindFunction · 0.85
stbi__get16beFunction · 0.85
stbi__skipFunction · 0.85

Tested by

no test coverage detected