author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年07月10日 23:22:02 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年07月10日 23:22:02 +0200 |
commit | 2f1fb2eebff0d6c2febec640ef1a0938a124de36 (patch) | |
tree | c3e3dca07d8adcbf532a1523cfc0f7f384e33ee7 /agg-plot/canvas.h | |
parent | 6a948f2402353a808b85016fdb2e1b6aea60890d (diff) | |
download | gsl-shell-2f1fb2eebff0d6c2febec640ef1a0938a124de36.tar.gz |
-rw-r--r-- | agg-plot/canvas.h | 10 |
diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h index fd618769..3a35a501 100644 --- a/agg-plot/canvas.h +++ b/agg-plot/canvas.h @@ -72,6 +72,12 @@ template <class Pixel> class renderer_subpixel_aa { enum { subpixel_scale = 3 }; + + struct subpixel_scale_trans + { + void transform(double* x, double* y) const { *x = subpixel_scale * (*x); } + }; + public: renderer_subpixel_aa(agg::rendering_buffer& ren_buf, agg::rgba bg_color): m_pixbuf(ren_buf), m_ren_base(m_pixbuf), m_ren_solid(m_ren_base), @@ -105,8 +111,8 @@ public: template <class Rasterizer, class VertexSource> static void add_path(Rasterizer& ras, VertexSource& vs) { - agg::trans_affine_scaling subpixel_mtx(double(subpixel_scale), 1.0); - agg::conv_transform<VertexSource> scaled_vs(vs, subpixel_mtx); + subpixel_scale_trans tr; + agg::conv_transform<VertexSource, subpixel_scale_trans> scaled_vs(vs, tr); ras.add_path(scaled_vs); } |