5#if defined(AST_WITH_AGG)
7A_SUPPRESS_WARNINGS_BEGIN
8#include "agg/agg_basics.h"
9#include "agg/agg_rendering_buffer.h"
10#include "agg/agg_rasterizer_scanline_aa.h"
11#include "agg/agg_scanline_p.h"
12#include "agg/agg_renderer_scanline.h"
13#include "agg/agg_pixfmt_rgba.h"
14#include "agg/agg_path_storage.h"
15#include "agg/agg_conv_stroke.h"
16#include "agg/agg_conv_transform.h"
17#include "agg/agg_conv_curve.h"
18#include "agg/agg_conv_dash.h"
19#include "agg/agg_trans_affine.h"
20#include "agg/agg_color_rgba.h"
21#include "agg/agg_gsv_text.h"
22A_SUPPRESS_WARNINGS_END
24#include "LineStyle.hpp"
33 typedef agg::pixfmt_rgba32 pixfmt_type;
34 typedef agg::renderer_base<pixfmt_type> renderer_base_type;
35 typedef agg::renderer_scanline_aa_solid<renderer_base_type> renderer_aa_type;
36 typedef agg::rasterizer_scanline_aa<> rasterizer_type;
37 typedef agg::scanline_p8 scanline_type;
39 AggRenderer(
unsigned int width,
unsigned int height,
double dpi = 96.0);
40 AggRenderer(
const AggRenderer&) =
delete;
41 AggRenderer& operator=(
const AggRenderer&) =
delete;
44 unsigned int width()
const {
return width_; }
45 unsigned int height()
const {
return height_; }
46 double dpi()
const {
return dpi_; }
49 void clear(
const agg::rgba& bg = agg::rgba(1.0, 1.0, 1.0, 1.0));
52 void draw_line(
const double* x,
const double* y,
size_t n,
53 const LineStyle& style,
const agg::trans_affine& trans);
56 void draw_path(agg::path_storage& path,
const LineStyle& style,
57 const agg::trans_affine& trans,
bool hasFace =
false);
60 void draw_filled_rect(
double x1,
double y1,
double x2,
double y2,
61 const agg::rgba& fill_color,
62 const agg::trans_affine& trans);
69 void draw_text(
const char* text,
double x,
double y,
double size_pt,
70 const agg::rgba& color,
double angle_deg = 0.0);
78 void draw_marker(
int shape,
double cx,
double cy,
double size_pt,
79 const agg::rgba& edge_color,
const agg::rgba& fill_color,
83 const unsigned char* buffer()
const {
return pixBuffer_; }
86 void save_bmp(
const char* filename)
const;
90 void draw_stroke_impl();
92 unsigned int width_, height_;
95 agg::int8u* pixBuffer_{};
96 agg::rendering_buffer rbuf_{};
97 pixfmt_type pixFmt_{};
98 renderer_base_type renBase_{};
99 renderer_aa_type renAA_{};
100 rasterizer_type ras_{};