Support for masks for color fields

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@325 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-05-06 18:15:18 +00:00
parent 6625792b04
commit efa1992f4a
7 changed files with 95 additions and 37 deletions
+13
View File
@@ -56,3 +56,16 @@ Color saturate(const Color& c, double amount) {
col(static_cast<int>( (b - amount * l) / (1 - amount) ))
);
}
void fill_image(Image& image, const Color& color) {
Byte* pos = image.GetData();
Byte* end = pos + image.GetWidth() * image.GetHeight() * 3;
Byte r = color.Red(), g = color.Green(), b = color.Blue();
// fill the image
while (pos != end) {
*pos++ = r;
*pos++ = g;
*pos++ = b;
}
}