krita
kis_alpha_mask.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KIS_ALPHA_MASK_
00019 #define KIS_ALPHA_MASK_
00020
00021 #include <qimage.h>
00022 #include <qvaluevector.h>
00023
00024 #include <ksharedptr.h>
00025
00026 #include "kis_global.h"
00027 #include "kis_types.h"
00028
00034 class KisAlphaMask : public KShared {
00035
00036 public:
00042 KisAlphaMask(const QImage& img);
00043
00048 KisAlphaMask(const QImage& img, bool hasColor);
00049
00053 KisAlphaMask(Q_INT32 width, Q_INT32 height);
00054
00055 virtual ~KisAlphaMask();
00056
00060 Q_INT32 height() const;
00061
00065 Q_INT32 width() const;
00066
00080 Q_UINT8 alphaAt(Q_INT32 x, Q_INT32 y) const;
00081
00082 void setAlphaAt(Q_INT32 x, Q_INT32 y, Q_UINT8 alpha);
00083
00084
00085
00086 static KisAlphaMaskSP interpolate(KisAlphaMaskSP mask1, KisAlphaMaskSP mask2, double t);
00087
00088 private:
00089 void computeAlpha(const QImage& img);
00090 void copyAlpha(const QImage& img);
00091
00092 QValueVector<Q_UINT8> m_data;
00093 Q_INT32 m_width;
00094 Q_INT32 m_height;
00095 };
00096
00097 #endif // KIS_ALPHA_MASK_
00098
|