mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
PaintImageBuffer - mode parameter
git-svn-id: svn://ultimatepp.org/upp/trunk@891 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
38a8fbf68f
commit
cbcc62bd8b
8 changed files with 36 additions and 34 deletions
|
|
@ -336,11 +336,11 @@ bool Draw::IsPainting(int x, int y, int cx, int cy) const
|
|||
return IsPainting(RectC(x, y, cx, cy));
|
||||
}
|
||||
|
||||
static void (*sIgfn)(ImageBuffer& ib, const Painting& pw, Size sz, Point pos, bool noaa);
|
||||
static void (*sIwfn)(ImageBuffer& ib, const Drawing& p, bool noaa);
|
||||
static void (*sIgfn)(ImageBuffer& ib, const Painting& pw, Size sz, Point pos, int mode);
|
||||
static void (*sIwfn)(ImageBuffer& ib, const Drawing& p, int mode);
|
||||
|
||||
void RegisterPaintingFns__(void (*ig)(ImageBuffer& ib, const Painting& pw, Size sz, Point pos, bool noaa),
|
||||
void (*iw)(ImageBuffer& ib, const Drawing& p, bool noaa))
|
||||
void RegisterPaintingFns__(void (*ig)(ImageBuffer& ib, const Painting& pw, Size sz, Point pos, int mode),
|
||||
void (*iw)(ImageBuffer& ib, const Drawing& p, int mode))
|
||||
{
|
||||
sIgfn = ig;
|
||||
sIwfn = iw;
|
||||
|
|
@ -351,21 +351,21 @@ bool HasPainter()
|
|||
return sIgfn && sIwfn;
|
||||
}
|
||||
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, Size sz, Point pos, bool noaa)
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, Size sz, Point pos, int mode)
|
||||
{
|
||||
if(sIgfn)
|
||||
(*sIgfn)(ib, p, sz, pos, noaa);
|
||||
(*sIgfn)(ib, p, sz, pos, mode);
|
||||
}
|
||||
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, bool noaa)
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, int mode)
|
||||
{
|
||||
PaintImageBuffer(ib, p, ib.GetSize(), Point(0, 0), noaa);
|
||||
PaintImageBuffer(ib, p, ib.GetSize(), Point(0, 0), mode);
|
||||
}
|
||||
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Drawing& iw, bool noaa)
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Drawing& iw, int mode)
|
||||
{
|
||||
if(sIwfn)
|
||||
(*sIwfn)(ib, iw, noaa);
|
||||
(*sIwfn)(ib, iw, mode);
|
||||
}
|
||||
|
||||
void Draw::DrawPaintingOp(const Rect& target, const Painting& pw)
|
||||
|
|
|
|||
|
|
@ -502,10 +502,16 @@ public:
|
|||
Painting(const Nuller&) { size = Null; }
|
||||
};
|
||||
|
||||
enum {
|
||||
MODE_ANTIALIASED = 0,
|
||||
MODE_NOAA = 1,
|
||||
MODE_SUBPIXEL = 2,
|
||||
};
|
||||
|
||||
bool HasPainter();
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, Size sz, Point pos, bool noaa = false);
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, bool noaa = false);
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Drawing& p, bool noaa = false);
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, Size sz, Point pos, int mode = MODE_ANTIALIASED);
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Painting& p, int mode = MODE_ANTIALIASED);
|
||||
void PaintImageBuffer(ImageBuffer& ib, const Drawing& p, int mode = MODE_ANTIALIASED);
|
||||
|
||||
class Draw {
|
||||
protected:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue