lib
KoPictureEps.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __koPictureEps_h__
00021 #define __koPictureEps_h__
00022
00023 #include <qstring.h>
00024
00025 class QPainter;
00026 class QSize;
00027 class KoPictureEpsPrivate;
00028
00029
00030
00035 class KoPictureEps : public KoPictureBase
00036 {
00037 public:
00041 KoPictureEps();
00042
00046 virtual ~KoPictureEps();
00047
00048 KoPictureType::Type getType(void) const;
00049
00050 KoPictureBase* newCopy(void) const;
00051
00055 virtual bool isNull(void) const;
00056
00075 virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false);
00076
00077 virtual bool loadData(const QByteArray& array, const QString& extension);
00078
00079 virtual bool save(QIODevice* io) const;
00080
00081 virtual QSize getOriginalSize(void) const;
00082
00083 virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00084
00085 virtual QString getMimeType(const QString& extension) const;
00086
00091 virtual QImage generateImage(const QSize& size);
00092
00093 virtual void clearCache(void);
00094 protected:
00095 QPixmap getPixmap(QImage& image);
00096 void scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony );
00097 QImage scaleWithGhostScript( const QSize& size, const int resolutionx, const int resolutiony );
00098 bool extractPostScriptStream( void );
00099
00100 private:
00101 int tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device );
00116 QString readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr );
00117
00118 private:
00122 QByteArray m_rawData;
00123 QPixmap m_cachedPixmap;
00124 QSize m_originalSize;
00125 QSize m_cachedSize;
00126 QRect m_boundingBox;
00127 uint m_psStreamStart;
00128 uint m_psStreamLength;
00129
00133 bool m_cacheIsInFastMode;
00134 };
00135
00136 #endif
|