Back to index

scribus-ng  1.3.4.dfsg+svn20071115
scimgdataloader_psd.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef SCIMGDATALOADER_PSD_H
00008 #define SCIMGDATALOADER_PSD_H
00009 
00010 #include <qvaluelist.h>
00011 #include "scimgdataloader.h"
00012 #include "sccolor.h"
00013 
00014 class ScImgDataLoader_PSD : public ScImgDataLoader
00015 {
00016 public:
00017 
00018        enum PSDColorMode
00019        {
00020               CM_BITMAP = 0,
00021               CM_GRAYSCALE = 1,
00022               CM_INDEXED = 2,
00023               CM_RGB = 3,
00024               CM_CMYK = 4,
00025               CM_MULTICHANNEL = 7,
00026               CM_DUOTONE = 8,
00027               CM_LABCOLOR = 9
00028        };
00029 
00030        ScImgDataLoader_PSD(void);
00031 
00032        virtual void preloadAlphaChannel(const QString& fn, int res);
00033        virtual void loadEmbeddedProfile(const QString& fn);
00034        virtual bool loadPicture(const QString& fn, int res, bool thumbnail);
00035 
00036 protected:
00037 
00038        QValueList<unsigned int> colorTable;
00039        QValueList<ScColor> colorTableSc;
00040        int random_table[4096];
00041 
00042        void initSupportedFormatList();
00043 
00044        bool IsValid( const PSDHeader & header );
00045        bool IsSupported( const PSDHeader & header );
00046 
00047        bool LoadPSD( QDataStream & s, const PSDHeader & header);
00048        bool LoadPSDResources( QDataStream & s, const PSDHeader & header, uint dataOffset );
00049        bool LoadPSDImgData( QDataStream & s, const PSDHeader & header, uint dataOffset );
00050        bool loadChannel( QDataStream & s, const PSDHeader & header, QValueList<PSDLayer> &layerInfo, uint layer, int channel, int component, RawImage &tmpImg);
00051        bool loadLayerChannels( QDataStream & s, const PSDHeader & header, QValueList<PSDLayer> &layerInfo, uint layer, bool* firstLayer);
00052        bool loadLayer( QDataStream & s, const PSDHeader & header);
00053        bool parseLayer( QDataStream & s, const PSDHeader & header);
00054        QString getLayerString(QDataStream & s);
00055        void putDuotone(uchar *ptr, uchar cbyte);
00056        int maxChannels;
00057        QMemArray<int> curveTable1;
00058        QMemArray<int> curveTable2;
00059        QMemArray<int> curveTable3;
00060        QMemArray<int> curveTable4;
00061 };
00062 
00063 #endif