2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
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, or (at your option)
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 GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
25 #include "SubtitleFile.h"
27 #include "GlyphPath.h"
28 #include "..\..\SubPic\ISubPic.h"
42 struct {int x1
, y1
, x2
, y2
;};
43 struct {unsigned __int64 first
, second
;};
45 union Span(int _x1
, int _y1
, int _x2
, int _y2
) {x1
= _x1
; y1
= _y1
; x2
= _x2
; y2
= _y2
;}
46 union Span(unsigned __int64 _first
, unsigned __int64 _second
) {first
= _first
; second
= _second
;}
49 Array
<Span
> mOutline
, mWideOutline
, mWideOutlineTmp
;
52 struct Edge
{int next
, posandflag
;}* mpEdgeBuffer
;
53 unsigned int mEdgeHeapSize
;
54 unsigned int mEdgeNext
;
55 unsigned int* mpScanBuffer
;
58 BYTE
* mpOverlayBuffer
;
59 int mOverlayWidth
, mOverlayHeight
;
60 int mPathOffsetX
, mPathOffsetY
;
61 int mOffsetX
, mOffsetY
;
65 void _ReallocEdgeBuffer(int edges
);
66 void _EvaluateBezier(const CPoint
& p0
, const CPoint
& p1
, const CPoint
& p2
, const CPoint
& p3
);
67 void _EvaluateLine(CPoint p0
, CPoint p1
);
68 void _OverlapRegion(Array
<Span
>& dst
, Array
<Span
>& src
, int dx
, int dy
);
72 virtual ~Rasterizer();
74 bool ScanConvert(GlyphPath
& path
, const CRect
& bbox
);
75 bool CreateWidenedRegion(int r
);
76 bool Rasterize(int xsub
, int ysub
);
77 void Reuse(Rasterizer
& r
);
79 void Blur(float n
, int plane
);
80 CRect
Draw(const SubPicDesc
& spd
, const CRect
& clip
, int xsub
, int ysub
, const DWORD
* switchpts
, int plane
);