本文整理汇总了C++中agg::rasterizer_scanline_aa::render_ctrl方法的典型用法代码示例。如果您正苦于以下问题:C++ rasterizer_scanline_aa::render_ctrl方法的具体用法?C++ rasterizer_scanline_aa::render_ctrl怎么用?C++ rasterizer_scanline_aa::render_ctrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agg::rasterizer_scanline_aa
的用法示例。
在下文中一共展示了rasterizer_scanline_aa::render_ctrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_draw
virtual void on_draw()
{
typedef agg::renderer_base<pixfmt> ren_base;
typedef agg::renderer_scanline_p_solid<ren_base> renderer_solid;
typedef agg::renderer_scanline_bin_solid<ren_base> renderer_bin_solid;
pixfmt pixf(rbuf_window());
ren_base rbase(pixf);
renderer_solid r(rbase);
renderer_bin_solid rb(rbase);
trans_roundoff roundoff;
if(m_redraw_flag)
{
g_rasterizer.gamma(agg::gamma_none());
rbase.clear(agg::rgba8(255,255,255));
g_rasterizer.filling_rule(agg::fill_non_zero);
g_rasterizer.render_ctrl(g_scanline, r, m_rotate);
g_rasterizer.render_ctrl(g_scanline, r, m_even_odd);
g_rasterizer.render_ctrl(g_scanline, r, m_draft);
g_rasterizer.render_ctrl(g_scanline, r, m_roundoff);
g_rasterizer.render_ctrl(g_scanline, r, m_angle_delta);
m_redraw_flag = false;
}
else
{
rbase.copy_bar(0,
int(32.0 * rbuf_window().height() / m_dy),
rbuf_window().width(),
rbuf_window().height(),
agg::rgba8(255,255,255));
}
if(m_draft.status())
{
g_rasterizer.gamma(agg::gamma_threshold(0.4));
}
agg::trans_affine mtx;
mtx.reset();
mtx *= agg::trans_affine_rotation(g_angle * agg::pi / 180.0);
mtx *= agg::trans_affine_translation(m_dx / 2, m_dy / 2 + 10);
mtx *= agg::trans_affine_scaling(rbuf_window().width() / m_dx,
rbuf_window().height() / m_dy);
agg::conv_transform<agg::path_storage> fill(g_path, mtx);
agg::conv_transform
<
agg::conv_transform<agg::path_storage>,
trans_roundoff
>
fill_roundoff(fill, roundoff);
agg::conv_stroke
<
agg::conv_transform<agg::path_storage>
>
stroke(fill);
agg::conv_stroke
<
agg::conv_transform
<
agg::conv_transform<agg::path_storage>,
trans_roundoff
>
>
stroke_roundoff(fill_roundoff);
g_pflag = m_even_odd.status() ? agg::fill_even_odd : agg::fill_non_zero;
unsigned i;
for(i = 0; i < g_npaths; i++)
{
g_rasterizer.filling_rule(g_pflag);
r.color(g_attr[i].fill_color);
rb.color(g_attr[i].fill_color);
if(m_roundoff.status()) g_rasterizer.add_path(fill_roundoff, g_attr[i].index);
else g_rasterizer.add_path(fill, g_attr[i].index);
if(m_draft.status())
{
g_rasterizer.render(g_scanline, rb);
}
else
{
g_rasterizer.render(g_scanline, r);
}
if(g_attr[i].stroke_width > 0.001)
{
r.color(g_attr[i].stroke_color);
rb.color(g_attr[i].stroke_color);
stroke.width(g_attr[i].stroke_width * mtx.scale());
stroke_roundoff.width(g_attr[i].stroke_width * mtx.scale());
if(m_roundoff.status()) g_rasterizer.add_path(stroke_roundoff, g_attr[i].index);
else g_rasterizer.add_path(stroke, g_attr[i].index);
if(m_draft.status())
{
//.........这里部分代码省略.........