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:
cxl 2020-06-04 16:52:04 +00:00
parent fc0559a28b
commit 27e2143172
4 changed files with 11 additions and 0 deletions

View file

@ -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(); }

View file

@ -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) {

View file

@ -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);

View file

@ -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;
}