Moved the AColor type to a gfx/ header, so other code can use it.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@847 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-05-16 19:49:14 +00:00
parent 36c7e3ef43
commit d70c3d6d74
11 changed files with 118 additions and 81 deletions
+1 -21
View File
@@ -16,6 +16,7 @@
#include <util/prec.hpp>
#include <util/real_point.hpp>
#include <gfx/color.hpp>
// ----------------------------------------------------------------------------- : Resampling
@@ -198,26 +199,5 @@ class ContourMask {
int *lefts, *rights;
};
// ----------------------------------------------------------------------------- : Color utility functions
inline int bot(int x) { return max(0, x); } ///< bottom range check for color values
inline int top(int x) { return min(255, x); } ///< top range check for color values
inline int col(int x) { return top(bot(x)); } ///< top and bottom range check for color values
/// Linear interpolation between colors
Color lerp(const Color& a, const Color& b, double t);
/// convert HSL to RGB, h,s,l must be in range [0...1)
Color hsl2rgb(double h, double s, double l);
/// A darker version of a color
Color darken(const Color& c);
/// A saturated version of a color
Color saturate(const Color& c, double amount);
/// Fills an image with the specified color
void fill_image(Image& image, const Color& color);
// ----------------------------------------------------------------------------- : EOF
#endif