mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Draw: Image::IsOpaque, ScanOpaque(Image&), iml now using ScanOpaque
git-svn-id: svn://ultimatepp.org/upp/trunk@14549 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fc0559a28b
commit
27e2143172
4 changed files with 11 additions and 0 deletions
|
|
@ -186,6 +186,7 @@ public:
|
|||
int GetKindNoScan() const;
|
||||
int GetKind() const;
|
||||
int GetResolution() const;
|
||||
bool IsOpaque() const { return GetKind() == IMAGE_OPAQUE; }
|
||||
|
||||
const RGBA *Begin() const { return data ? ~data->buffer : NULL; }
|
||||
const RGBA *begin() const { return Begin(); }
|
||||
|
|
|
|||
|
|
@ -61,6 +61,13 @@ Image CreateImage(Size sz, Color color)
|
|||
return CreateImage(sz, (RGBA)color);
|
||||
}
|
||||
|
||||
void ScanOpaque(Image& m)
|
||||
{
|
||||
ImageBuffer ib(m);
|
||||
ib.SetKind(ib.ScanKind());
|
||||
m = ib;
|
||||
}
|
||||
|
||||
force_inline Size DstSrc(ImageBuffer& dest, Point& p, const Image& src, Rect& sr)
|
||||
{
|
||||
if(p.x < 0) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ void SetResolution(Image& m, int res);
|
|||
Image WithResolution(const Image& m, int res);
|
||||
Image WithResolution(const Image& m, const Image& res);
|
||||
|
||||
void ScanOpaque(Image& m);
|
||||
|
||||
void Over(ImageBuffer& dest, Point p, const Image& src, const Rect& srect);
|
||||
void Over(Image& dest, const Image& src);
|
||||
void Copy(ImageBuffer& dest, Point p, const Image& src, const Rect& srect);
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ Image Iml::Get(int i)
|
|||
}
|
||||
if(!IsNull(m.image) && (mode & GUI_MODE_UHD)) // this is to support legacy code mostly
|
||||
SetResolution(m.image, IMAGE_RESOLUTION_UHD);
|
||||
ScanOpaque(m.image);
|
||||
}
|
||||
m.loaded = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue