5#if defined(AST_WITH_AGG)
7#include "agg/agg_basics.h"
8#include "agg/agg_rendering_buffer.h"
9#include "agg/agg_rasterizer_scanline_aa.h"
10#include "agg/agg_scanline_p.h"
11#include "agg/agg_renderer_scanline.h"
12#include "agg/agg_pixfmt_rgba.h"
13#include "agg/agg_path_storage.h"
14#include "agg/agg_conv_stroke.h"
15#include "agg/agg_conv_transform.h"
16#include "agg/agg_conv_curve.h"
17#include "agg/agg_conv_dash.h"
18#include "agg/agg_trans_affine.h"
19#include "agg/agg_color_rgba.h"
20#include "agg/agg_gsv_text.h"
22#include "LineStyle.hpp"
31 typedef agg::pixfmt_rgba32 pixfmt_type;
32 typedef agg::renderer_base<pixfmt_type> renderer_base_type;
33 typedef agg::renderer_scanline_aa_solid<renderer_base_type> renderer_aa_type;
34 typedef agg::rasterizer_scanline_aa<> rasterizer_type;
35 typedef agg::scanline_p8 scanline_type;
37 AggRenderer(
unsigned int width,
unsigned int height,
double dpi = 96.0);
38 AggRenderer(
const AggRenderer&) =
delete;
39 AggRenderer& operator=(
const AggRenderer&) =
delete;
42 unsigned int width()
const {
return width_; }
43 unsigned int height()
const {
return height_; }
44 double dpi()
const {
return dpi_; }
47 void clear(
const agg::rgba& bg = agg::rgba(1.0, 1.0, 1.0, 1.0));
50 void draw_line(
const double* x,
const double* y,
size_t n,
51 const LineStyle& style,
const agg::trans_affine& trans);
54 void draw_path(agg::path_storage& path,
const LineStyle& style,
55 const agg::trans_affine& trans,
bool hasFace =
false);
58 void draw_filled_rect(
double x1,
double y1,
double x2,
double y2,
59 const agg::rgba& fill_color,
60 const agg::trans_affine& trans);
67 void draw_text(
const char* text,
double x,
double y,
double size_pt,
68 const agg::rgba& color,
double angle_deg = 0.0);
76 void draw_marker(
int shape,
double cx,
double cy,
double size_pt,
77 const agg::rgba& edge_color,
const agg::rgba& fill_color,
81 const unsigned char* buffer()
const {
return pixBuffer_; }
84 void save_bmp(
const char* filename)
const;
88 void draw_stroke_impl();
90 unsigned int width_, height_;
93 agg::int8u* pixBuffer_;
94 agg::rendering_buffer rbuf_;
96 renderer_base_type renBase_;
97 renderer_aa_type renAA_;