lib Library API Documentation

koPictureEps.h

00001 /* This file is part of the KDE project 00002 Copyright (c) 2001 Simon Hausmann <hausmann@kde.org> 00003 Copyright (C) 2002, 2003, 2004 Nicolas GOUTTE <goutte@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 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 // TODO: fix documentation 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 00074 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); 00075 00076 virtual bool load(const QByteArray& array, const QString& extension); 00077 00078 virtual bool save(QIODevice* io); 00079 00080 virtual QSize getOriginalSize(void) const; 00081 00082 virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false); 00083 00084 virtual QString getMimeType(const QString& extension) const; 00085 00090 virtual QImage generateImage(const QSize& size); 00091 00092 virtual void clearCache(void); 00093 protected: 00094 QPixmap getPixmap(QImage& image); 00095 void scaleAndCreatePixmap(const QSize& size, bool fastMode, const int resolutionx, const int resolutiony ); 00096 QImage scaleWithGhostScript( const QSize& size, const int resolutionx, const int resolutiony ); 00097 bool extractPostScriptStream( void ); 00098 00099 private: 00100 int tryScaleWithGhostScript(QImage &image, const QSize& size, const int resolutionx, const int resolutiony, const char* device ); 00115 QString KoPictureEps::readLine( const QByteArray& array, const uint start, const uint length, uint& pos, bool& lastCharWasCr ); 00116 00117 private: 00121 QByteArray m_rawData; 00122 QPixmap m_cachedPixmap; 00123 QSize m_originalSize; 00124 QSize m_cachedSize; 00125 QRect m_boundingBox; 00126 uint m_psStreamStart; 00127 uint m_psStreamLength; 00128 00132 bool m_cacheIsInFastMode; 00133 }; 00134 00135 #endif /* __koPictureEps_h__ */
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:00 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003