Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed9fb76

Browse files
committed
updated agg wrapper example
svn path=/trunk/matplotlib/; revision=1383
1 parent 7cd24f9 commit ed9fb76

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

examples/agg_test.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,30 @@
1717
white = agg.rgba8(255,255,255,255)
1818
yellow = agg.rgba8(192,192,255,255)
1919

20+
2021
path = agg.path_storage()
2122
path.move_to(10,10)
2223
path.line_to(100,100)
2324
path.line_to(200,200)
2425
path.line_to(100,200)
2526
path.close_polygon()
2627

27-
stroke = agg.conv_stroke(path)
28+
stroke = agg.conv_stroke_path(path)
2829
stroke.width(3.0)
2930

30-
pf = agg.pixel_format(rbuf)
31-
rbase = agg.renderer_base(pf)
32-
rbase.clear(blue)
31+
pf = agg.pixel_format_rgba(rbuf)
32+
rbase = agg.renderer_base_rgba(pf)
33+
rbase.clear_rgba8(blue)
3334

34-
renderer = agg.renderer_scanline_aa_solid(rbase);
35-
renderer.color( red )
35+
renderer = agg.renderer_scanline_aa_solid_rgba(rbase);
36+
renderer.color_rgba8( red )
3637

3738
rasterizer = agg.rasterizer_scanline_aa()
3839
rasterizer.add_path(stroke)
3940

4041
scanline = agg.scanline_p8()
4142

42-
agg.render_scanlines(rasterizer, scanline, renderer);
43+
agg.render_scanlines_rgba(rasterizer, scanline, renderer);
4344

4445
s = buffer.to_string()
4546
print len(s)

swig/agg_renderer_base.i

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "agg_renderer_base.h"
22
%include "agg_renderer_base.h"
3-
43
%template(renderer_base_rgba) agg::renderer_base<pixfmt_rgba_t>;
54
%extend agg::renderer_base<pixfmt_rgba_t> {
65
void clear_rgba8(const agg::rgba8& color) {
@@ -11,3 +10,6 @@
1110
}
1211
}
1312

13+
14+
15+

0 commit comments

Comments
 (0)