本文整理汇总了C++中Image32::raw_data方法的典型用法代码示例。如果您正苦于以下问题:C++ Image32::raw_data方法的具体用法?C++ Image32::raw_data怎么用?C++ Image32::raw_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image32
的用法示例。
在下文中一共展示了Image32::raw_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
void render(geometry_type& geom, Image32& image) const
{
typedef agg::renderer_base<agg::pixfmt_rgba32> ren_base;
agg::row_ptr_cache<agg::int8u> buf(image.raw_data(),image.width(),image.height(),
image.width()*4);
agg::pixfmt_rgba32 pixf(buf);
ren_base renb(pixf);
Color const& col = stroke_.get_color();
double r=col.red()/255.0;
double g=col.green()/255.0;
double b=col.blue()/255.0;
if (0) //stroke_.width() == 1.0)
{
typedef agg::renderer_outline_aa<ren_base> renderer_oaa;
typedef agg::rasterizer_outline_aa<renderer_oaa> rasterizer_outline_aa;
agg::line_profile_aa prof;
prof.width(stroke_.get_width());
renderer_oaa ren_oaa(renb, prof);
rasterizer_outline_aa ras_oaa(ren_oaa);
ren_oaa.color(agg::rgba(r, g, b, stroke_.get_opacity()));
ras_oaa.add_path(geom);
//LineRasterizerAA<Image32> rasterizer(image);
//rasterizer.render<SHIFT0>(geom,stroke_.get_color());
}
else
{
//typedef agg::renderer_base<agg::pixfmt_rgba32> ren_base;
typedef agg::renderer_scanline_aa_solid<ren_base> renderer;
renderer ren(renb);
agg::rasterizer_scanline_aa<> ras;
agg::scanline_u8 sl;
if (stroke_.has_dash())
{
agg::conv_dash<geometry<vertex2d,vertex_vector> > dash(geom);
dash_array const& d = stroke_.get_dash_array();
dash_array::const_iterator itr = d.begin();
dash_array::const_iterator end = d.end();
while (itr != end)
{
dash.add_dash(itr->first, itr->second);
++itr;
}
agg::conv_stroke<agg::conv_dash<geometry<vertex2d,vertex_vector> > > stroke(dash);
line_join_e join=stroke_.get_line_join();
if ( join == MITER_JOIN)
stroke.generator().line_join(agg::miter_join);
else if( join == MITER_REVERT_JOIN)
stroke.generator().line_join(agg::miter_join);
else if( join == ROUND_JOIN)
stroke.generator().line_join(agg::round_join);
else
stroke.generator().line_join(agg::bevel_join);
line_cap_e cap=stroke_.get_line_cap();
if (cap == BUTT_CAP)
stroke.generator().line_cap(agg::butt_cap);
else if (cap == SQUARE_CAP)
stroke.generator().line_cap(agg::square_cap);
else
stroke.generator().line_cap(agg::round_cap);
stroke.generator().miter_limit(4.0);
stroke.generator().width(stroke_.get_width());
ras.clip_box(0,0,image.width(),image.height());
ras.add_path(stroke);
ren.color(agg::rgba(r, g, b, stroke_.get_opacity()));
agg::render_scanlines(ras, sl, ren);
}
else
{
agg::conv_stroke<geometry<vertex2d,vertex_vector> > stroke(geom);
line_join_e join=stroke_.get_line_join();
if ( join == MITER_JOIN)
stroke.generator().line_join(agg::miter_join);
else if( join == MITER_REVERT_JOIN)
stroke.generator().line_join(agg::miter_join);
else if( join == ROUND_JOIN)
stroke.generator().line_join(agg::round_join);
else
stroke.generator().line_join(agg::bevel_join);
line_cap_e cap=stroke_.get_line_cap();
if (cap == BUTT_CAP)
stroke.generator().line_cap(agg::butt_cap);
else if (cap == SQUARE_CAP)
stroke.generator().line_cap(agg::square_cap);
//.........这里部分代码省略.........