1 // VirtualDub - Video processing and capture application
2 // Graphics support library
3 // Copyright (C) 1998-2009 Avery Lee
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef f_VD2_KASUMI_REGION_H
20 #define f_VD2_KASUMI_REGION_H
24 #include <vd2/system/vectors.h>
25 #include <vd2/system/vdstl.h>
27 class VDPixmapRegion
{
29 void swap(VDPixmapRegion
& x
);
33 vdfastvector
<uint32
> mSpans
;
37 class VDPixmapPathRasterizer
{
39 VDPixmapPathRasterizer();
40 VDPixmapPathRasterizer(const VDPixmapPathRasterizer
&); // no-op
41 ~VDPixmapPathRasterizer();
43 VDPixmapPathRasterizer
& operator=(const VDPixmapPathRasterizer
&); // no-op
46 void QuadraticBezier(const vdint2 pts
[4]);
47 void CubicBezier(const vdint2 pts
[4]);
48 void Line(const vdint2
& pt1
, const vdint2
& pt2
);
49 void FastLine(int x0
, int y0
, int x1
, int y1
);
51 void ScanConvert(VDPixmapRegion
& region
);
56 void ClearScanBuffer();
57 void ReallocateScanBuffer(int ymin
, int ymax
);
64 enum { kEdgeBlockMax
= 1024 };
70 EdgeBlock(EdgeBlock
*p
) : next(p
) {}
78 EdgeBlock
*mpEdgeBlocks
;
79 EdgeBlock
*mpFreeEdgeBlocks
;
82 Scan
*mpScanBufferBiased
;
87 bool VDPixmapFillRegion(const VDPixmap
& dst
, const VDPixmapRegion
& region
, int x
, int y
, uint32 color
);
88 bool VDPixmapFillRegionAntialiased8x(const VDPixmap
& dst
, const VDPixmapRegion
& region
, int x
, int y
, uint32 color
);
90 void VDPixmapCreateRoundRegion(VDPixmapRegion
& dst
, float r
);
91 void VDPixmapConvolveRegion(VDPixmapRegion
& dst
, const VDPixmapRegion
& r1
, const VDPixmapRegion
& r2
, VDPixmapRegion
*tempCache
= NULL
);