mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-28 06:12:37 -06:00
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:
parent
28c32db988
commit
29cdccef55
6 changed files with 50 additions and 32 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue