00001 #ifndef MYTHIMAGE_H_ 00002 #define MYTHIMAGE_H_ 00003 00004 // Base class, inherited by painter-specific classes. 00005 00006 #include "mythpainter.h" 00007 00008 #include <qimage.h> 00009 00010 class QPixmap; 00011 00012 class MythImage : public QImage 00013 { 00014 public: 00015 MythImage(MythPainter *parent); 00016 00017 void UpRef(void); 00018 bool DownRef(void); 00019 00020 virtual void SetChanged(bool change = true) { m_Changed = change; } 00021 bool IsChanged() { return m_Changed; } 00022 00023 void Assign(const QImage &img); 00024 void Assign(const QPixmap &pix); 00025 00026 // *NOTE* *DELETES* img! 00027 static MythImage *FromQImage(QImage **img); 00028 00029 bool Load(const QString &filename); 00030 00031 void Resize(const QSize &newSize); 00032 00040 static MythImage *Gradient(const QSize & size, const QColor &begin, const QColor &end, uint alpha); 00041 00042 protected: 00043 static void MakeGradient(QImage &image, const QColor &begin, const QColor &end, int alpha); 00044 00045 virtual ~MythImage(); 00046 00047 bool m_Changed; 00048 MythPainter *m_Parent; 00049 00050 int m_RefCount; 00051 00052 bool m_isGradient; 00053 QColor m_gradBegin; 00054 QColor m_gradEnd; 00055 int m_gradAlpha; 00056 }; 00057 00058 #endif 00059
1.5.5