12 "PSD_ERROR_OPENING_FILE",
19 "PSD_INDEX_OUT_OF_RANGE",
20 "PSD_FILE_HEADER_NOT_VALID",
23 "PSD_CHANNEL_INDEX_OUT_OF_RANGE",
24 "PSD_LAYER_INDEX_OUT_OF_RANGE",
25 "PSD_DECOMPRESSION_ERROR",
30 namespace adsk {
namespace libPSD {
135 RESOLUTIONINFO() : hRes(0), hResUnit(0), WidthUnit(0), vRes(0), vResUnit(0), HeightUnit(0) {}
149 IMAGERESOURCES() : signature(
'8BIM'), key(0), resName(0), resLength(0), variableResData(0) {}
161 PSD_FILE_HEADER() : signature(
'8BPS'), version(1), channels(4), height(0), width(0), depthValue(8), colorMode(3) {}
222 friend class PSDFile;
266 void setName(
const QString& layerName);
270 void setOpacity(
float opacity);
274 void setTransparencyProtected(
bool trsProtected);
277 void setLocked(
bool locked =
true) { m_bLocked = locked; }
281 void setVisibility(
bool visFlag);
288 void setLayerRect(
int top,
int left,
int bottom,
int right);
290 unsigned short nbChannel = 4);
293 void readEachLayerRecord(PSDFile* psdFile,
294 unsigned int & actualSize);
299 unsigned char m_opacity;
300 unsigned char m_optionFlags;
314 friend class PSDFile;
317 unsigned int version;
318 bool hasRealMergedData;
323 unsigned int fileVersion;
324 VersionInfo() : version(0), hasRealMergedData(0), writerNameL(0),
325 writerName(0), readerNameL(0), readerName(0), fileVersion(0) {}
329 class ThumbnailResource
334 unsigned int width_bytes;
335 unsigned int total_size;
336 unsigned int size_after_compression;
337 unsigned int bits_per_pixel;
338 unsigned int number_of_planes;
339 unsigned char* jfif_data;
340 unsigned int* thumbnail_data;
341 ThumbnailResource() : format(0), width(0), height(0),
342 width_bytes(0), total_size(0), size_after_compression(0),
343 bits_per_pixel(0), number_of_planes(0), jfif_data(0), thumbnail_data(0) {}
348 void DestroyThumbnail();
350 RESOLUTIONINFO* m_pResolutionInfo;
351 unsigned int m_imageResourcesSize;
352 unsigned char* m_colorData;
353 unsigned int m_colorDataSize;
354 LAYERSTATE* m_pLayerState;
355 PSDFileMeta& operator= (
const PSDFileMeta &FM);
363 float GetXResolution()
const;
364 void SetXResolution(
float xres);
368 float GetYResolution()
const;
369 void SetYResolution(
float yres);
374 unsigned short GetResUnit()
const;
375 void SetResUnit(
unsigned short resUnit);
376 bool SetFileHeaderStruct(
unsigned int inWidth,
unsigned int inHeight,
377 unsigned short inColorDepth,
378 unsigned short inChannels);
384 void SetNbLayers(
unsigned int nbLayers) { m_numLayers = nbLayers; }
387 bool SetColorModeData(
unsigned char* colorModeData,
388 unsigned int colorModeDataSize);
393 void SetLayerState(
unsigned short layerState);
476 unsigned int layerIndex);
516 unsigned int layerIndex,
517 unsigned int channelIndex,
522 unsigned int layerIndex,
523 unsigned int channelIndex,
532 unsigned int imageWidth,
533 unsigned int imageHeight,
538 unsigned int imageWidth,
539 unsigned int imageHeight,
545 unsigned int imageWidth,
546 unsigned int imageHeight,
589 unsigned char* bSrc,
unsigned char* aSrc,
590 float glbOpacity,
LRect inRectLayer1,
591 int blendMode,
unsigned int inWidth,
unsigned int inHeight,
592 unsigned char* &rDst,
unsigned char* &gDst,
593 unsigned char* &bDst,
unsigned char* &aDst);
616 const unsigned char *
b,
const unsigned char *
a,
617 unsigned int *target,
bool multAlpha=
true);
641 const unsigned short *
r,
const unsigned short *
g,
642 const unsigned short *
b,
const unsigned short *
a,
643 unsigned short *target,
bool multAlpha=
true);
668 const float *
b,
const float *
a,
669 float *target,
bool multAlpha=
true);
694 const unsigned short *
b,
const unsigned short *
a,
695 unsigned int *target,
bool multAlpha=
true);
719 const float *
b,
const float *
a,
720 unsigned int *target,
bool multAlpha=
true);
GLdouble GLdouble GLdouble r
bool MBDLL_DECL PSDWrite4ChanCompositeImageData(PSDFile *psdFile, unsigned int imageWidth, unsigned int imageHeight, CompressionMethod compressMethod, void **ARGBPixels)
bool MBDLL_DECL PSDWriteCompositeImageData(PSDFile *psdFile, unsigned int imageWidth, unsigned int imageHeight, CompressionMethod compressMethod, void *buffer, size_t bufferSize)
bool MBDLL_DECL PSDWriteChannelImageData(PSDFile *psdFile, unsigned int layerIndex, unsigned int channelIndex, void *buffer, size_t bufferSize)
PSDError MBDLL_DECL PSDGetLastError(PSDFile *psdFile)
Obtain the last status of libPSD.
bool MBDLL_DECL PSDReadChannelImageData(PSDFile *psdFile, unsigned int layerIndex, unsigned int channelIndex, void *buffer, size_t bufferSize)
Read the channel image data for this layer and this channel of psdFile object.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void MBDLL_DECL PSDInterleaveImageData32(int nPixels, const float *r, const float *g, const float *b, const float *a, unsigned int *target, bool multAlpha=true)
InterleaveImageData32 takes the 4 separate 32 bit float RGBA planes and interleaves them into a singl...
unsigned short HeightUnit
LRect(int left=0, int top=0, int right=0, int bottom=0)
const MBDLL_DECL PSDFileMeta * PSDGetFileMeta(const PSDFile *psdFile)
Get the file metadata of a PSD file.
void MBDLL_DECL PSDInterleaveImageData32_32(int nPixels, const float *r, const float *g, const float *b, const float *a, float *target, bool multAlpha=true)
InterleaveImageData32 takes the 4 separate 32 bit float RGBA planes and interleaves them into a singl...
bool MBDLL_DECL PSDReadCompositeImageData(PSDFile *psdFile, unsigned int imageWidth, unsigned int imageHeight, void *buffer, size_t bufferSize)
LRect & operator=(const LRect &LR)
GLenum GLsizei GLenum format
void MBDLL_DECL PSDInterleaveImageData16_16(int nPixels, const unsigned short *r, const unsigned short *g, const unsigned short *b, const unsigned short *a, unsigned short *target, bool multAlpha=true)
InterleaveImageData16 takes the 4 separate 16 bit RGBA planes and interleaves them into a single 16 b...
GLenum GLsizei GLsizei height
PSDFile MBDLL_DECL * PSDOpen(const QString &fileName, bool write=false)
Open a Photoshop(PSD) file and fill internally meta data (file meta and layers meta data)...
CompressionMethod channelCompression
bool MBDLL_DECL PSDBlendLayers(unsigned char *rSrc, unsigned char *gSrc, unsigned char *bSrc, unsigned char *aSrc, float glbOpacity, LRect inRectLayer1, int blendMode, unsigned int inWidth, unsigned int inHeight, unsigned char *&rDst, unsigned char *&gDst, unsigned char *&bDst, unsigned char *&aDst)
BlendLayers is a helper function that blend 2 layers based on the src's blend mode.
void MBDLL_DECL PSDInterleaveImageData(int nPixels, const unsigned char *r, const unsigned char *g, const unsigned char *b, const unsigned char *a, unsigned int *target, bool multAlpha=true)
InterleaveImageData takes the 4 seperate RGBA planes and interleaves them into a single RGBA image –...
void MBDLL_DECL PSDInterleaveImageData16(int nPixels, const unsigned short *r, const unsigned short *g, const unsigned short *b, const unsigned short *a, unsigned int *target, bool multAlpha=true)
InterleaveImageData16 takes the 4 separate 16 bit RGBA planes and interleaves them into a single 8 bi...
static const char * PSDErrorString[]
void MBDLL_DECL PSDClose(PSDFile *psdFile)
Close the psdFile object and free all private data.
GLubyte GLubyte GLubyte a
bool MBDLL_DECL PSDSetFileMeta(PSDFile *psdFile, const PSDFileMeta *psdFileMeta)
Set the file metadata of psdFile.
void MBDLL_DECL PSDSetLayerMeta(PSDFile *psdFile, unsigned int layerIndex, PSDLayerMeta *psdLayerMeta)
Set the layer meta data for layerIndex of psdFile object.
const MBDLL_DECL PSDLayerMeta * PSDGetLayerMeta(const PSDFile *psdFile, unsigned int layerIndex)
Get the layer meta data for layerIndex of psdFile object.
unsigned short depthValue
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
unsigned char * variableData