tabs to spaces
This commit is contained in:
parent
2338eeb4c0
commit
cd6f798b85
File diff suppressed because it is too large
Load Diff
@ -8,63 +8,63 @@
|
|||||||
|
|
||||||
namespace nv
|
namespace nv
|
||||||
{
|
{
|
||||||
enum PsdColorMode
|
enum PsdColorMode
|
||||||
{
|
{
|
||||||
PsdColorMode_Bitmap = 0,
|
PsdColorMode_Bitmap = 0,
|
||||||
PsdColorMode_GrayScale = 1,
|
PsdColorMode_GrayScale = 1,
|
||||||
PsdColorMode_Indexed = 2,
|
PsdColorMode_Indexed = 2,
|
||||||
PsdColorMode_RGB = 3,
|
PsdColorMode_RGB = 3,
|
||||||
PsdColorMode_CMYK = 4,
|
PsdColorMode_CMYK = 4,
|
||||||
PsdColorMode_MultiChannel = 7,
|
PsdColorMode_MultiChannel = 7,
|
||||||
PsdColorMode_DuoTone = 8,
|
PsdColorMode_DuoTone = 8,
|
||||||
PsdColorMode_LabColor = 9
|
PsdColorMode_LabColor = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
/// PSD header.
|
/// PSD header.
|
||||||
struct PsdHeader
|
struct PsdHeader
|
||||||
{
|
{
|
||||||
uint32 signature;
|
uint32 signature;
|
||||||
uint16 version;
|
uint16 version;
|
||||||
uint8 reserved[6];
|
uint8 reserved[6];
|
||||||
uint16 channel_count;
|
uint16 channel_count;
|
||||||
uint32 height;
|
uint32 height;
|
||||||
uint32 width;
|
uint32 width;
|
||||||
uint16 depth;
|
uint16 depth;
|
||||||
uint16 color_mode;
|
uint16 color_mode;
|
||||||
|
|
||||||
bool isValid() const
|
bool isValid() const
|
||||||
{
|
{
|
||||||
return signature == 0x38425053; // '8BPS'
|
return signature == 0x38425053; // '8BPS'
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSupported() const
|
bool isSupported() const
|
||||||
{
|
{
|
||||||
if (version != 1) {
|
if (version != 1) {
|
||||||
nvDebug("*** bad version number %u\n", version);
|
nvDebug("*** bad version number %u\n", version);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (channel_count > 4) {
|
if (channel_count > 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (depth != 8) {
|
if (depth != 8) { // @@ Add support for 16 bit depths.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (color_mode != PsdColorMode_RGB) {
|
if (color_mode != PsdColorMode_RGB) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline Stream & operator<< (Stream & s, PsdHeader & head)
|
inline Stream & operator<< (Stream & s, PsdHeader & head)
|
||||||
{
|
{
|
||||||
s << head.signature << head.version;
|
s << head.signature << head.version;
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
s << head.reserved[i];
|
s << head.reserved[i];
|
||||||
}
|
}
|
||||||
return s << head.channel_count << head.height << head.width << head.depth << head.color_mode;
|
return s << head.channel_count << head.height << head.width << head.depth << head.color_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // nv namespace
|
} // nv namespace
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user