MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__psd_info

Function stbi__psd_info

include/stb/stb_image.h:7359–7392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7357
7358#ifndef STBI_NO_PSD
7359static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
7360{
7361 int channelCount, dummy, depth;
7362 if (!x) x = &dummy;
7363 if (!y) y = &dummy;
7364 if (!comp) comp = &dummy;
7365 if (stbi__get32be(s) != 0x38425053) {
7366 stbi__rewind( s );
7367 return 0;
7368 }
7369 if (stbi__get16be(s) != 1) {
7370 stbi__rewind( s );
7371 return 0;
7372 }
7373 stbi__skip(s, 6);
7374 channelCount = stbi__get16be(s);
7375 if (channelCount < 0 || channelCount > 16) {
7376 stbi__rewind( s );
7377 return 0;
7378 }
7379 *y = stbi__get32be(s);
7380 *x = stbi__get32be(s);
7381 depth = stbi__get16be(s);
7382 if (depth != 8 && depth != 16) {
7383 stbi__rewind( s );
7384 return 0;
7385 }
7386 if (stbi__get16be(s) != 3) {
7387 stbi__rewind( s );
7388 return 0;
7389 }
7390 *comp = 4;
7391 return 1;
7392}
7393
7394static int stbi__psd_is16(stbi__context *s)
7395{

Callers 1

stbi__info_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