Scribus
Open source desktop publishing at your fingertips
scimgdataloader_psd.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 #ifndef SCIMGDATALOADER_PSD_H
8 #define SCIMGDATALOADER_PSD_H
9 
10 #include <QVector>
11 #include <QList>
12 #include "scimgdataloader.h"
13 #include "sccolor.h"
14 
16 {
17 public:
18 
19  enum PSDColorMode
20  {
21  CM_BITMAP = 0,
22  CM_GRAYSCALE = 1,
23  CM_INDEXED = 2,
24  CM_RGB = 3,
25  CM_CMYK = 4,
26  CM_MULTICHANNEL = 7,
27  CM_DUOTONE = 8,
28  CM_LABCOLOR = 9
29  };
30 
31  ScImgDataLoader_PSD(void);
32 
33 // virtual void preloadAlphaChannel(const QString& fn, int res);
34  virtual bool preloadAlphaChannel(const QString& fn, int page, int res, bool& hasAlpha);
35  virtual void loadEmbeddedProfile(const QString& fn, int page = 0);
36  virtual bool loadPicture(const QString& fn, int page, int res, bool thumbnail);
37 
38  virtual bool useRawImage() { return true; }
39 
40 protected:
41 
42  QList<unsigned int> colorTable;
43  QList<ScColor> colorTableSc;
44  int random_table[4096];
45 
46  void initSupportedFormatList();
47 
48  bool IsValid( const PSDHeader & header );
49  bool IsSupported( const PSDHeader & header );
50 
51  bool LoadPSD( QDataStream & s, const PSDHeader & header);
52  bool LoadPSDResources( QDataStream & s, const PSDHeader & header, uint dataOffset );
53  bool LoadPSDImgData( QDataStream & s, const PSDHeader & header, uint dataOffset );
54  bool loadChannel( QDataStream & s, const PSDHeader & header, QList<PSDLayer> &layerInfo, uint layer, int channel, int component, RawImage &tmpImg);
55  bool loadLayerChannels( QDataStream & s, const PSDHeader & header, QList<PSDLayer> &layerInfo, uint layer, bool* firstLayer);
56  bool loadLayer( QDataStream & s, const PSDHeader & header);
57  bool parseLayer( QDataStream & s, const PSDHeader & header);
58  QString getLayerString(QDataStream & s);
59  void putDuotone(uchar *ptr, uchar cbyte);
60  int maxChannels;
61  QVector<int> curveTable1;
62  QVector<int> curveTable2;
63  QVector<int> curveTable3;
64  QVector<int> curveTable4;
65 };
66 
67 #endif
Definition: scimgdataloader.h:19
Definition: scimgdataloader_psd.h:15
Definition: rawimage.h:15
Definition: scimagestructs.h:39