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:
twanvl
2006-11-17 17:57:04 +00:00
parent ea5be88bdb
commit ce6a83e34b
45 changed files with 1595 additions and 84 deletions
+42 -1
View File
@@ -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