#include <kis_alpha_mask.h>
Public Member Functions | |
| KisAlphaMask (const TQImage &img) | |
| KisAlphaMask (const TQImage &img, bool hasColor) | |
| KisAlphaMask (TQ_INT32 width, TQ_INT32 height) | |
| TQ_INT32 | height () const |
| TQ_INT32 | width () const |
| TQ_UINT8 | alphaAt (TQ_INT32 x, TQ_INT32 y) const |
| void | setAlphaAt (TQ_INT32 x, TQ_INT32 y, TQ_UINT8 alpha) |
Static Public Member Functions | |
| static KisAlphaMaskSP | interpolate (KisAlphaMaskSP mask1, KisAlphaMaskSP mask2, double t) |
Detailed Description
KisAlphaMask is intended to create alpha values from a TQImage for use in brush creation.
It is not a generic alpha mask that can be used with KisPaintDevices: use a KisSelection for that.
Definition at line 34 of file kis_alpha_mask.h.
Constructor & Destructor Documentation
◆ KisAlphaMask() [1/3]
| KisAlphaMask::KisAlphaMask | ( | const TQImage & | img | ) |
Create an alpha mask based on the specified TQImage.
If the image is not a grayscale, the mask value is calculated from the effective grey level and alpha value.
Definition at line 41 of file kis_alpha_mask.cpp.
◆ KisAlphaMask() [2/3]
| KisAlphaMask::KisAlphaMask | ( | const TQImage & | img, |
| bool | hasColor ) |
As above except quicker as the image does not need to be scanned to see if it has any colour pixels.
Definition at line 28 of file kis_alpha_mask.cpp.
◆ KisAlphaMask() [3/3]
| KisAlphaMask::KisAlphaMask | ( | TQ_INT32 | width, |
| TQ_INT32 | height ) |
Create a transparent mask.
Definition at line 54 of file kis_alpha_mask.cpp.
◆ ~KisAlphaMask()
|
virtual |
Definition at line 62 of file kis_alpha_mask.cpp.
Member Function Documentation
◆ alphaAt()
|
inline |
- Returns
- the alpha value at the specified position.
Returns TQ_UINT8 OPACITY_TRANSPARENT if the value is outside the bounds of the mask.
XXX: this is, of course, not the best way of masking. Better would be to let KisAlphaMask fill a chunk of memory with the alpha values at the right position, something like void applyMask(TQ_UINT8 *pixeldata, TQ_INT32 pixelWidth, TQ_INT32 alphaPos). That would be fastest, or we could provide an iterator over the mask, that would be nice, too.
Definition at line 80 of file kis_alpha_mask.h.
◆ height()
| TQ_INT32 KisAlphaMask::height | ( | ) | const |
- Returns
- the number of alpha values in a scanline.
Definition at line 71 of file kis_alpha_mask.cpp.
◆ interpolate()
|
static |
Definition at line 112 of file kis_alpha_mask.cpp.
◆ setAlphaAt()
| void KisAlphaMask::setAlphaAt | ( | TQ_INT32 | x, |
| TQ_INT32 | y, | ||
| TQ_UINT8 | alpha ) |
Definition at line 76 of file kis_alpha_mask.cpp.
◆ width()
| TQ_INT32 KisAlphaMask::width | ( | ) | const |
- Returns
- the number of lines in the mask.
Definition at line 66 of file kis_alpha_mask.cpp.
The documentation for this class was generated from the following files:
