home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scimgdataloader_psd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-25  |  2.0 KB  |  66 lines

  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.  
  15. class ScImgDataLoader_PSD : public ScImgDataLoader
  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. protected:
  39.  
  40.     QList<unsigned int> colorTable;
  41.     QList<ScColor> colorTableSc;
  42.     int random_table[4096];
  43.  
  44.     void initSupportedFormatList();
  45.  
  46.     bool IsValid( const PSDHeader & header );
  47.     bool IsSupported( const PSDHeader & header );
  48.  
  49.     bool LoadPSD( QDataStream & s, const PSDHeader & header);
  50.     bool LoadPSDResources( QDataStream & s, const PSDHeader & header, uint dataOffset );
  51.     bool LoadPSDImgData( QDataStream & s, const PSDHeader & header, uint dataOffset );
  52.     bool loadChannel( QDataStream & s, const PSDHeader & header, QList<PSDLayer> &layerInfo, uint layer, int channel, int component, RawImage &tmpImg);
  53.     bool loadLayerChannels( QDataStream & s, const PSDHeader & header, QList<PSDLayer> &layerInfo, uint layer, bool* firstLayer);
  54.     bool loadLayer( QDataStream & s, const PSDHeader & header);
  55.     bool parseLayer( QDataStream & s, const PSDHeader & header);
  56.     QString getLayerString(QDataStream & s);
  57.     void putDuotone(uchar *ptr, uchar cbyte);
  58.     int maxChannels;
  59.     QVector<int> curveTable1;
  60.     QVector<int> curveTable2;
  61.     QVector<int> curveTable3;
  62.     QVector<int> curveTable4;
  63. };
  64.  
  65. #endif
  66.