MCPcopy Create free account
hub / github.com/DentonW/DevIL / iCheckPsd

Function iCheckPsd

DevIL/src-IL/src/il_psd.cpp:119–139  ·  view source on GitHub ↗

Internal function used to check if the HEADER is a valid Psd header.

Source from the content-addressed store, hash-verified

117
118// Internal function used to check if the HEADER is a valid Psd header.
119ILboolean iCheckPsd(PSDHEAD *Header)
120{
121 ILuint i;
122
123 if (strncmp((char*)Header->Signature, "8BPS", 4))
124 return IL_FALSE;
125 if (Header->Version != 1)
126 return IL_FALSE;
127 for (i = 0; i < 6; i++) {
128 if (Header->Reserved[i] != 0)
129 return IL_FALSE;
130 }
131 if (Header->Channels < 1 || Header->Channels > 24)
132 return IL_FALSE;
133 if (Header->Height < 1 || Header->Width < 1)
134 return IL_FALSE;
135 if (Header->Depth != 1 && Header->Depth != 8 && Header->Depth != 16)
136 return IL_FALSE;
137
138 return IL_TRUE;
139}
140
141
142//! Reads a Psd file

Callers 2

iIsValidPsdFunction · 0.85
iLoadPsdInternalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected