mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Basic text rendering working;
Added Font (done) and SymbolFont (skeleton); Added styling to set; Added CountourMap; Some script fixes git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@73 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+42
-1
@@ -14,7 +14,8 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include "../util/prec.hpp"
|
||||
#include <util/prec.hpp>
|
||||
#include <util/real_point.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Resampling
|
||||
|
||||
@@ -103,6 +104,46 @@ void combine_image(Image& a, const Image& b, ImageCombine combine);
|
||||
/// Draw an image to a DC using a combining function
|
||||
void draw_combine_image(DC& dc, UInt x, UInt y, const Image& img, ImageCombine combine);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Masks
|
||||
|
||||
/// An alpha mask is an alpha channel that can be copied to another image
|
||||
/** It is created by treating black in the source image as transparent and white (red) as opaque
|
||||
*/
|
||||
class AlphaMask {
|
||||
public:
|
||||
AlphaMask();
|
||||
~AlphaMask();
|
||||
|
||||
// TODO
|
||||
|
||||
private:
|
||||
Byte* alpha;
|
||||
};
|
||||
|
||||
/// A contour mask stores the size and position of each line in the image
|
||||
/** It is created by treating black in the source image as transparent and white (red) as opaque
|
||||
* The left is the first non-transparent pixel, the right is the last non-transparent pixel
|
||||
*/
|
||||
class ContourMask {
|
||||
public:
|
||||
ContourMask();
|
||||
~ContourMask();
|
||||
|
||||
/// Load a contour mask
|
||||
void load(const String& filename);
|
||||
/// Unload the mask
|
||||
void unload();
|
||||
|
||||
/// Returns the start of a row, when the mask were stretched to size
|
||||
double rowLeft (double y, RealSize size) const;
|
||||
/// Returns the end of a row, when the mask were stretched to size
|
||||
double rowRight(double y, RealSize size) const;
|
||||
|
||||
private:
|
||||
UInt width, height;
|
||||
UInt *lefts, *rights;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------- : Utility
|
||||
|
||||
inline int bot(int x) { return max(0, x); } ///< bottom range check for color values
|
||||
|
||||
Reference in New Issue
Block a user