1111#include " agg_renderer_base.h"
1212#include " agg_math_stroke.h"
1313#include " agg_conv_stroke.h"
14+ #include " agg_conv_transform.h"
15+ #include " agg_conv_curve.h"
1416#include " agg_vcgen_stroke.h"
1517#include " agg_rasterizer_scanline_aa.h"
1618#include " agg_renderer_scanline.h"
2022
2123using namespace agg ;
2224
23- typedef agg::rgba8 color_type;
24- typedef agg::pixfmt_rgba32 pixel_format;
25-
25+ #include " agg_typedefs.h"
2626 %}
2727
28- typedef agg::rgba8 color_type;
29- typedef agg::pixfmt_rgba32 pixel_format;
30- // typedef pixel_formats_rgba<blender_rgba32, pixel32_type> pixel_format;
3128
29+ %include " agg_typedefs.h"
3230%include " agg_basics.i"
3331
3432
@@ -59,25 +57,11 @@ typedef agg::pixfmt_rgba32 pixel_format;
5957}
6058
6159%include " agg_buffer.h"
62-
6360%include " agg_color_rgba.h"
6461%include " agg_trans_affine.i"
6562%include " agg_path_storage.i"
6663%include " agg_math_stroke.h"
67- %include " agg_vcgen_stroke.h"
68- #include " agg_conv_adaptor_vcgen.h"
6964
70- // %template(conv_adaptor_vcgen) agg::conv_adaptor_vcgen<agg::path_storage,agg::vcgen_stroke,agg::null_markers>;
71-
72- %rename(null_markers) agg::null_markers;
73- struct agg ::null_markers {};
74-
75- %rename(conv_adaptor_vcgen) conv_adaptor_vcgen<agg::path_storage,agg::vcgen_stroke,agg::null_markers>;
76- class conv_adaptor_vcgen <agg::path_storage,agg::vcgen_stroke,agg::null_markers>
77- {
78- public:
79- conv_adaptor_vcgen<agg::path_storage,agg::vcgen_stroke,agg::null_markers>(agg::path_storage& source);
80- };
8165
8266
8367%include " agg_rendering_buffer.h"
@@ -89,168 +73,16 @@ public:
8973}
9074
9175%include " agg_pixfmt_rgba.h"
92- %template (pixel_format) agg::pixel_formats_rgba<agg::blender_rgba32, agg::pixel32_type>;
93-
94-
95-
96- #include " agg_renderer_base.h"
97- %rename(renderer_base) renderer_base<pixel_format>;
98- class renderer_base <pixel_format>
99- {
100- public:
101- renderer_base<pixel_format>(pixel_format& ren);
102- const pixel_format& ren ();
103- unsigned width () const ;
104- unsigned height () const ;
105- bool clip_box (int x1, int y1, int x2, int y2);
106- void reset_clipping (bool visibility);
107- void clip_box_naked (int x1, int y1, int x2, int y2);
108- bool inbox (int x, int y) const ;
109- void first_clip_box ();
110- bool next_clip_box ();
111- const agg::rect& clip_box () const ;
112- int xmin () const ;
113- int ymin () const ;
114- int xmax () const ;
115- int ymax () const ;
116-
117- const agg::rect& bounding_clip_box () const ;
118- int bounding_xmin () const ;
119- int bounding_ymin () const ;
120- int bounding_xmax () const ;
121- int bounding_ymax () const ;
122- void clear (const color_type& c);
123- void copy_pixel (int x, int y, const color_type& c);
124- void blend_pixel (int x, int y, const color_type& c, agg::cover_type cover);
125- color_type pixel (int x, int y) const ;
126- void copy_hline (int x1, int y, int x2, const color_type& c);
127- void copy_vline (int x, int y1, int y2, const color_type& c);
128- void blend_hline (int x1, int y, int x2,
129- const color_type& c, agg::cover_type cover);
130- void blend_vline (int x, int y1, int y2,
131- const color_type& c, agg::cover_type cover);
132- void copy_bar (int x1, int y1, int x2, int y2, const color_type& c);
133- void blend_bar (int x1, int y1, int x2, int y2,
134- const color_type& c, agg::cover_type cover);
135- void blend_solid_hspan (int x, int y, int len,
136- const color_type& c,
137- const agg::cover_type* covers);
138- void blend_solid_vspan (int x, int y, int len,
139- const color_type& c,
140- const agg::cover_type* covers);
141-
142- void blend_color_hspan (int x, int y, int len,
143- const color_type* colors,
144- const agg::cover_type* covers,
145- agg::cover_type cover = cover_full);
146- void blend_color_vspan (int x, int y, int len,
147- const color_type* colors,
148- const agg::cover_type* covers,
149- agg::cover_type cover = cover_full);
150- void blend_color_hspan_no_clip (int x, int y, int len,
151- const color_type* colors,
152- const agg::cover_type* covers,
153- agg::cover_type cover = cover_full);
154- void blend_color_vspan_no_clip (int x, int y, int len,
155- const color_type* colors,
156- const agg::cover_type* covers,
157- agg::cover_type cover = cover_full);
158- rect clip_rect_area (agg::rect& dst, agg::rect& src, int wsrc, int hsrc) const ;
159- void copy_from (const agg::rendering_buffer& src,
160- const agg::rect* rect_src_ptr = 0 ,
161- int dx = 0 ,
162- int dy = 0 );
163- /* todo fixme
164- template<class SrcPixelFormatRenderer>
165- void blend_from(const SrcPixelFormatRenderer& src,
166- const rect* rect_src_ptr = 0,
167- int dx = 0,
168- int dy = 0);
169- */
170- };
171-
172-
173- #include " agg_conv_stroke.h"
174- %rename(conv_stroke) conv_stroke<agg::path_storage>;
175- struct conv_stroke <agg::path_storage> {
176- conv_stroke<agg::path_storage>(agg::path_storage& vs);
177- void line_cap (agg::line_cap_e lc);
178- void line_join (agg::line_join_e lj);
179- agg::line_cap_e line_cap ();
180- agg::line_join_e line_join ();
181- void width (double w);
182- void miter_limit (double ml);
183- void miter_limit_theta (double t);
184- void approximation_scale (double as);
185- double width () const ;
186- double miter_limit () const ;
187- double approximation_scale ();
188- void shorten (double s);
189- double shorten () const ;
190- };
191-
76+ %template (pixel_format_rgba) agg::pixel_formats_rgba<agg::blender_rgba32, agg::pixel32_type>;
19277
193- #include " agg_rasterizer_scanline_aa.h"
194- %rename(rasterizer_scanline_aa) rasterizer_scanline_aa<>;
195- class rasterizer_scanline_aa <>
196- {
197- public:
198- rasterizer_scanline_aa<>();
199- void reset ();
200- void filling_rule (agg::filling_rule_e filling_rule);
201- void clip_box (double x1, double y1, double x2, double y2);
202- void reset_clipping ();
203- // template<class GammaF> void gamma(const GammaF& gamma_function)
204- unsigned apply_gamma (unsigned cover) const ;
205- void add_vertex (double x, double y, unsigned cmd);
206- void move_to (int x, int y);
207- void line_to (int x, int y);
208- void close_polygon ();
209- void move_to_d (double x, double y);
210- void line_to_d (double x, double y);
211- int min_x () const ;
212- int min_y () const ;
213- int max_x () const ;
214- int max_y () const ;
215-
216- unsigned calculate_alpha (int area);
217- void sort ();
218- bool rewind_scanlines ();
219- // template<class Scanline> bool sweep_scanline(Scanline& sl);
220- bool hit_test (int tx, int ty);
221- // fixme void add_xy(const double* x, const double* y, unsigned n);
222- // template<class VertexSource>
223- void add_path (agg::path_storage& vs, unsigned id=0 );
224- void add_path (agg::conv_stroke<agg::path_storage>& vs, unsigned id=0 );
225-
226- };
22778
79+ %include " agg_renderer_base.i"
80+ %include " agg_conv_curve.i"
81+ %include " agg_conv_transform.i"
82+ %include " agg_conv_stroke.i"
22883
229-
230-
231-
232-
233- #include " agg_renderer_scanline.h"
234- // todo fixme color type
235- %rename(renderer_scanline_aa_solid) renderer_scanline_aa_solid<renderer_base<pixel_format> >;
236- class renderer_scanline_aa_solid <renderer_base<pixel_format> >
237- {
238- public:
239- renderer_scanline_aa_solid<renderer_base<pixel_format> >(renderer_base<pixel_format>& ren);
240- void color (const color_type& c);
241- const color_type& color () const ;
242- void prepare (unsigned );
243- };
244-
245- %rename(renderer_scanline_bin_solid) renderer_scanline_bin_solid<renderer_base<pixel_format> >;
246- class renderer_scanline_bin_solid <renderer_base<pixel_format> >
247- {
248- public:
249- renderer_scanline_bin_solid<renderer_base<pixel_format> >(renderer_base<pixel_format>& ren);
250- void color (const color_type& c);
251- const color_type& color () const ;
252- void prepare (unsigned );
253- };
84+ %include " agg_rasterizer_scanline_aa.i"
85+ %include " agg_renderer_scanline.i"
25486
25587
25688%include " agg_scanline_p.h"
@@ -259,10 +91,7 @@ public:
25991%include " agg_scanline_bin.h"
26092
26193%include " agg_render_scanlines.h"
262- %template (render_scanlines ) agg::render_scanlines<
263- rasterizer_scanline_aa<>,
94+ %template (render_scanlines_rgba ) agg::render_scanlines<
95+ agg:: rasterizer_scanline_aa<>,
26496 agg::scanline_p<agg::int8u>,
265- renderer_scanline_aa_solid<renderer_base<pixel_format> > >;
266-
267-
268-
97+ agg::renderer_scanline_aa_solid<renderer_base_rgba_t > >;
0 commit comments