mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 14:07:01 -04:00
New class CachedScriptableMask: like CachedScriptableImage, only containing an AlphaMask instead of an Image/Bitmap.
Use CachedScriptableMask for all masks. TODO: This introduces some duplicate code in ValueViewers that could be fixed by moving mask to the Style base class. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1182 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+5
-4
@@ -167,8 +167,9 @@ class AlphaMask : public IntrusivePtrBase<AlphaMask> {
|
||||
/// Apply the alpha mask to a bitmap
|
||||
void setAlpha(Bitmap& b) const;
|
||||
|
||||
/// Is the given location fully transparent?
|
||||
bool isTransparent(int x, int y) const;
|
||||
/// Is the given location opaque (not fully transparent)? when the mask were stretched to size
|
||||
bool isOpaque(const RealPoint& p, const RealSize& size) const;
|
||||
bool isOpaque(int x, int y) const;
|
||||
|
||||
/// Determine a convex hull polygon *around* the mask
|
||||
void convexHull(vector<wxPoint>& points) const;
|
||||
@@ -178,9 +179,9 @@ class AlphaMask : public IntrusivePtrBase<AlphaMask> {
|
||||
|
||||
/// Returns the start of a row, when the mask were stretched to size
|
||||
/** This is: the x coordinate of the first non-transparent pixel */
|
||||
double rowLeft (double y, RealSize size) const;
|
||||
double rowLeft (double y, const RealSize& size) const;
|
||||
/// Returns the end of a row, when the mask were stretched to size
|
||||
double rowRight(double y, RealSize size) const;
|
||||
double rowRight(double y, const RealSize& size) const;
|
||||
|
||||
/// Does this mask have the given size?
|
||||
inline bool hasSize(const wxSize& compare_size) const { return size == compare_size; }
|
||||
|
||||
Reference in New Issue
Block a user