krita
kis_pattern.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __kis_pattern_h__
00022 #define __kis_pattern_h__
00023
00024 #include <kio/job.h>
00025
00026 #include "kis_debug_areas.h"
00027 #include "kis_resource.h"
00028 #include "kis_types.h"
00029
00030 class QPoint;
00031 class QImage;
00032 class KisColorSpace;
00033 class KisPaintDevice;
00034
00035 class KisPattern : public KisResource {
00036 typedef KisResource super;
00037 Q_OBJECT
00038
00039 public:
00040 KisPattern(const QString& file);
00041 KisPattern(KisPaintDevice* image, int x, int y, int w, int h);
00042 virtual ~KisPattern();
00043
00044 virtual bool load();
00045 virtual bool save();
00046 virtual QImage img();
00047
00052 KisPaintDeviceSP image(KisColorSpace * colorSpace);
00053
00054 Q_INT32 width() const;
00055 Q_INT32 height() const;
00056
00057 void setImage(const QImage& img);
00058
00059 KisPattern* clone() const;
00060
00061 protected:
00062 void setWidth(Q_INT32 w);
00063 void setHeight(Q_INT32 h);
00064
00065 private:
00066 bool init();
00067
00068 private:
00069 QByteArray m_data;
00070 QImage m_img;
00071 QMap<QString, KisPaintDeviceSP> m_colorspaces;
00072 bool m_hasFile;
00073
00074 Q_INT32 m_width;
00075 Q_INT32 m_height;
00076 };
00077
00078 #endif
00079
|