Draw: CachedSetColorKeepAlpha, PdfDraw: compresion of repeated images

git-svn-id: svn://ultimatepp.org/upp/trunk@6594 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-11-21 09:54:19 +00:00
parent 28c32db988
commit 29cdccef55
6 changed files with 50 additions and 32 deletions

View file

@ -228,5 +228,30 @@ Image CachedRescalePaintOnly(const Image& m, Size sz, int filter)
return CachedRescalePaintOnly(m, sz, m.GetSize(), filter);
}
struct sColorize : public ImageMaker
{
Image img;
Color color;
virtual String Key() const {
StringBuffer h;
RawCat(h, color);
RawCat(h, img.GetSerialId());
return h;
}
virtual Image Make() const {
return SetColorKeepAlpha(img, color);
}
};
Image CachedSetColorKeepAlpha(const Image& img, Color color)
{
sColorize m;
m.img = img;
m.color = color;
return MakeImage(m);
}
END_UPP_NAMESPACE