.developing rainbow

git-svn-id: svn://ultimatepp.org/upp/trunk@3555 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-06-25 16:57:21 +00:00
parent c935495369
commit 0803e97b94
5 changed files with 64 additions and 48 deletions

View file

@ -49,42 +49,54 @@ void Image::Data::PaintImp(SystemDraw& w, int x, int y, const Rect& src, Color c
SystemData& sd = Sys();
}
Image ImageDraw::Get(bool pm) const
{
ImageBuffer result(image.GetSize());
const RGBA *e = image.End();
const RGBA *p = ~image;
RGBA *t = ~result;
if(has_alpha) {
const RGBA *a = ~alpha;
while(p < e) {
*t = *p++;
(t++)->a = (a++)->r;
}
if(pm)
Premultiply(result);
result.SetKind(IMAGE_ALPHA);
}
else {
while(p < e) {
*t = *p++;
(t++)->a = 255;
}
}
return result;
}
Draw& ImageDraw::Alpha()
{
has_alpha = true;
return alpha;
return alpha_painter;
}
ImageDraw::operator Image() const
{
Image image;
return GetResult();
}
Image ImageDraw::GetStraight() const
{
return GetResult();
}
ImageDraw::ImageDraw(Size sz)
: BufferPainter(sz.cx, sz.cy),
alpha(sz.cx, sz.cy)
: ImageDraw__(sz.cx, sz.cy),
BufferPainter(image),
alpha_painter(alpha)
{
has_alpha = false;
}
ImageDraw::ImageDraw(int cx, int cy)
: BufferPainter(image, cx, cy),
alpha(alpha, cx, cy)
: ImageDraw__(cx, cy),
BufferPainter(image),
alpha_painter(alpha)
{
has_alpha = false;
}
ImageDraw::~ImageDraw()
{
}
Image Image::Arrow() { return Null; }
Image Image::Wait() { return Null; }
Image Image::IBeam() { return Null; }