line renderer
This commit is contained in:
parent
7459a4a0db
commit
082b8a1e92
|
@ -214,6 +214,8 @@ void AGGDraw() {
|
||||||
aggDraw.target->set_font("verdana18_bold");
|
aggDraw.target->set_font("verdana18_bold");
|
||||||
aggDraw.target->set_color(255, 0, 255, 255);
|
aggDraw.target->set_color(255, 0, 255, 255);
|
||||||
aggDraw.target->render_text(60,60, "testing testing testing");
|
aggDraw.target->render_text(60,60, "testing testing testing");
|
||||||
|
|
||||||
|
aggDraw.target->line(60, 90, 100, 100, 4);
|
||||||
//
|
//
|
||||||
//agg_draw_line_pattern(64, 19, 14, 126, 118, 266, 19, 265, .76, 4.69, "C:\\7.bmp");
|
//agg_draw_line_pattern(64, 19, 14, 126, 118, 266, 19, 265, .76, 4.69, "C:\\7.bmp");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
#include "agg_renderer_scanline.h"
|
#include "agg_renderer_scanline.h"
|
||||||
#include "agg_bounding_rect.h"
|
#include "agg_bounding_rect.h"
|
||||||
|
|
||||||
|
#include "agg_renderer_mclip.h"
|
||||||
|
#include "agg_renderer_outline_aa.h"
|
||||||
|
|
||||||
class AggDrawTarget
|
class AggDrawTarget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -49,6 +52,7 @@ public:
|
||||||
virtual void solid_ellipse(int x, int y, int rx, int ry) = 0;
|
virtual void solid_ellipse(int x, int y, int rx, int ry) = 0;
|
||||||
virtual void solid_rectangle(int x1, int y1, int x2, int y2) = 0;
|
virtual void solid_rectangle(int x1, int y1, int x2, int y2) = 0;
|
||||||
virtual void solid_triangle(int x1, int y1, int x2, int y2, int x3, int y3) = 0;
|
virtual void solid_triangle(int x1, int y1, int x2, int y2, int x3, int y3) = 0;
|
||||||
|
virtual void line(int x1, int y1, int x2, int y2, double w) = 0;
|
||||||
|
|
||||||
static const agg::int8u* lookupFont(const std::string& name);
|
static const agg::int8u* lookupFont(const std::string& name);
|
||||||
};
|
};
|
||||||
|
@ -158,6 +162,27 @@ public:
|
||||||
agg::render_scanlines(m_ras, m_sl_p8, ren_aa);
|
agg::render_scanlines(m_ras, m_sl_p8, ren_aa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void line(int x1, int y1, int x2, int y2, double w){
|
||||||
|
|
||||||
|
agg::line_profile_aa profile;
|
||||||
|
profile.width(w);
|
||||||
|
|
||||||
|
typedef agg::renderer_mclip<pixfmt> base_ren_type;
|
||||||
|
typedef agg::renderer_outline_aa<base_ren_type> renderer_type;
|
||||||
|
|
||||||
|
base_ren_type r(pixf);
|
||||||
|
renderer_type ren(r, profile);
|
||||||
|
|
||||||
|
agg::rasterizer_outline_aa<renderer_type> ras(ren);
|
||||||
|
ras.round_cap(true);
|
||||||
|
|
||||||
|
ren.color(renderState.color);
|
||||||
|
|
||||||
|
ras.move_to_d(x1, y1);
|
||||||
|
ras.line_to_d(x2, y2);
|
||||||
|
ras.render(false);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue