16 #include <agg_pixfmt_rgba.h> 17 #include <agg_rasterizer_scanline_aa.h> 18 #include <agg_renderer_base.h> 19 #include <agg_renderer_scanline.h> 20 #include <agg_scanline_p.h> 26 main (
int argc,
const char* argv[])
30 const int imageWidth = 100;
31 const int imageHeight = 100;
36 const int pixelSize = PixelFormat::pix_width;
40 RendererBaseType rBase;
42 unsigned char *imageBuffer =
new unsigned char[imageWidth * imageHeight * pixelSize];
45 renderBuffer.attach (imageBuffer, imageWidth, imageHeight, imageWidth * pixelSize);
46 pixFmt.attach(renderBuffer);
49 const agg::rgba8 transparentWhiteColor (0xff, 0xff, 0xff, 0);
53 rBase.clear(transparentWhiteColor);
58 ras.auto_close(
false);
65 { agg::path_cmd_move_to, 10, 10 },
66 { agg::path_cmd_line_to, 90, 10 },
67 { agg::path_cmd_line_to, 90, 90 },
68 { agg::path_cmd_line_to, 10, 90 },
69 { agg::path_cmd_line_to, 10, 10 },
72 { agg::path_cmd_move_to, 30, 30 },
73 { agg::path_cmd_line_to, 70, 30 },
74 { agg::path_cmd_line_to, 70, 70 },
75 { agg::path_cmd_line_to, 30, 70 },
76 { agg::path_cmd_line_to, 30, 30 },
92 squares[6] = squares[8];
100 agg::render_scanlines_aa_solid(ras, scanline, rBase, redColor);
104 char fileName[1000] = { 0 };
107 sprintf (fileName,
"%s/", argv[1]);
109 strcat(fileName,
"tutorial_path_3.png");
110 writePng<RendererBaseType> (fileName, rBase);
116 printf (
"%s\n", ex.getMessage());
121 printf (
"Unknown exception detected.\n");