gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/canvas.h
diff options
context:
space:
mode:
authorfrancesco <francesco.bbt@gmail.com>2011年01月24日 00:06:49 +0100
committerfrancesco <francesco.bbt@gmail.com>2011年01月24日 00:09:07 +0100
commit6b3dc4b44f45a9bdca4395b8dcfa01210e55808d (patch)
tree2d8866c515e814f71d7515c6a839bfdebc0e18bb /agg-plot/canvas.h
parent5d498b997dc622355f3a857aa1b408e7588418b1 (diff)
downloadgsl-shell-6b3dc4b44f45a9bdca4395b8dcfa01210e55808d.tar.gz
Replaced the template argument for line width with an enum in canvas class.
Diffstat (limited to 'agg-plot/canvas.h')
-rw-r--r--agg-plot/canvas.h 15
1 files changed, 9 insertions, 6 deletions
diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h
index 7c2de5bc..f375ea4c 100644
--- a/agg-plot/canvas.h
+++ b/agg-plot/canvas.h
@@ -21,15 +21,16 @@ class pixel_gamma_corr {
typedef agg::pixfmt_bgr24_gamma<gamma_type> pixel_fmt;
gamma_type m_gamma;
-
public:
typedef pixel_fmt fmt;
+ pixel_fmt pixfmt;
+
pixel_gamma_corr(agg::rendering_buffer& ren_buf):
m_gamma(2.2), pixfmt(ren_buf, m_gamma)
{ };
- pixel_fmt pixfmt;
+ enum { line_width = 150 };
};
struct pixel_simple {
@@ -38,9 +39,11 @@ struct pixel_simple {
typedef agg::pixfmt_bgr24 fmt;
pixel_simple(agg::rendering_buffer& ren_buf): pixfmt(ren_buf) { };
+
+ enum { line_width = 100 };
};
-template <class pixel, int linewidth>
+template <class pixel>
class canvas_gen : private pixel {
typedef agg::renderer_base<typename pixel::fmt> renderer_base;
typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid;
@@ -95,7 +98,7 @@ public:
void draw_outline(VertexSource& vs, agg::rgba8 c)
{
agg::conv_stroke<VertexSource> line(vs);
- line.width(linewidth / 10.0L);
+ line.width(pixel::line_width / 100.0);
line.line_cap(agg::round_cap);
this->ras.add_path(line);
@@ -105,9 +108,9 @@ public:
};
#ifdef DISABLE_GAMMA_CORR
-typedef canvas_gen<pixel_simple, 10> canvas;
+typedef canvas_gen<pixel_simple> canvas;
#else
-typedef canvas_gen<pixel_gamma_corr, 15> canvas;
+typedef canvas_gen<pixel_gamma_corr> canvas;
#endif
#endif
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 23:18:41 +0000

AltStyle によって変換されたページ (->オリジナル) /