mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-12 06:12:46 -06:00
.developing rainbow
git-svn-id: svn://ultimatepp.org/upp/trunk@3555 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
c935495369
commit
0803e97b94
5 changed files with 64 additions and 48 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue