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

Function stbi__psd_is16

Source/Utils/stb_image.h:7391–7416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7389}
7390
7391static int stbi__psd_is16(stbi__context *s)
7392{
7393 int channelCount, depth;
7394 if (stbi__get32be(s) != 0x38425053) {
7395 stbi__rewind( s );
7396 return 0;
7397 }
7398 if (stbi__get16be(s) != 1) {
7399 stbi__rewind( s );
7400 return 0;
7401 }
7402 stbi__skip(s, 6);
7403 channelCount = stbi__get16be(s);
7404 if (channelCount < 0 || channelCount > 16) {
7405 stbi__rewind( s );
7406 return 0;
7407 }
7408 STBI_NOTUSED(stbi__get32be(s));
7409 STBI_NOTUSED(stbi__get32be(s));
7410 depth = stbi__get16be(s);
7411 if (depth != 16) {
7412 stbi__rewind( s );
7413 return 0;
7414 }
7415 return 1;
7416}
7417#endif
7418
7419#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