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.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-10-11  |  2.0 KB  |  70 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_H
  8. #define SCIMGDATALOADER_H
  9.  
  10. #include "scribusapi.h"
  11. #include <QByteArray>
  12. #include <QImage>
  13. #include <QStringList>
  14.  
  15. #include "scimagestructs.h"
  16. #include "rawimage.h"
  17.  
  18. class ScImgDataLoader
  19. {
  20. protected:
  21.     ScImgDataLoader(void);
  22.  
  23.     QStringList m_supportedFormats;
  24.  
  25.     QImage m_image;
  26.     ImageInfoRecord m_imageInfoRecord;
  27.     QByteArray m_embeddedProfile;
  28.     int m_profileComponents;
  29.  
  30.     typedef enum {
  31.         noMsg = 0,
  32.         warningMsg = 1,
  33.         errorMsg = 2
  34.     } MsgType;
  35.     MsgType m_msgType;
  36.     QString m_message;
  37.  
  38.     void swapRGBA(void);
  39.     void swapRGBA(QImage *img);
  40.  
  41.     QString getPascalString(QDataStream & s);
  42.     double decodePSDfloat(uint data);
  43.     void parseRessourceData( QDataStream & s, const PSDHeader & header, uint size );
  44.  
  45. public:
  46.     virtual ~ScImgDataLoader(void) {};
  47.  
  48.     const QStringList& supportedFormats(void) const { return m_supportedFormats; }
  49.     bool  supportFormat(const QString& fmt);
  50.  
  51.     QImage& image(void) { return m_image; }
  52.     RawImage r_image;
  53.     QByteArray& embeddedProfile(void) { return m_embeddedProfile; }
  54.     ImageInfoRecord& imageInfoRecord(void) { return m_imageInfoRecord; }
  55.     void setRequest(bool valid, QMap<int, ImageLoadRequest> req);
  56.  
  57.     bool  issuedErrorMsg(void) const { return (m_msgType == errorMsg); }
  58.     bool  issuedWarningMsg(void) const { return (m_msgType == warningMsg); }
  59.     const QString& getMessage(void) const { return m_message; }
  60.  
  61.     virtual void initialize(void);
  62.  
  63. //    virtual void preloadAlphaChannel(const QString& fn, int res) = 0;
  64.     virtual bool preloadAlphaChannel(const QString& fn, int page, int res, bool& hasAlpha) = 0;
  65.     virtual void loadEmbeddedProfile(const QString& fn, int page = 0) = 0;
  66.     virtual bool loadPicture(const QString& fn, int page, int res, bool thumbnail) = 0;
  67. };
  68.  
  69. #endif
  70.