• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ren函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ren函数的典型用法代码示例。如果您正苦于以下问题:C++ ren函数的具体用法?C++ ren怎么用?C++ ren使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ren函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: operator

    bool operator()() const
    {
        mapnik::Map m(256,256,"+init=epsg:3857");

        mapnik::parameters params;
        params["type"]="memory";
        auto ds = std::make_shared<mapnik::memory_datasource>(params);
        // add whitespace to trigger phony "reprojection"
        mapnik::layer lay("layer",m.srs() + " ");
        lay.set_datasource(ds);
        lay.add_style("style");
        m.add_layer(lay);
        // dummy style to ensure that layer is processed
        m.insert_style("style",mapnik::feature_type_style());
        // dummy bbox, but "valid" because minx and miny are less
        // with an invalid bbox then layer.visible() returns false
        // and the initial rendering setup is not run
        m.zoom_to_box(mapnik::box2d<double>(-1,-1,0,0));
        for (unsigned i=0;i<iterations_;++i)
        {
            mapnik::image_rgba8 im(256,256);
            mapnik::agg_renderer<mapnik::image_rgba8> ren(m,im);
            ren.apply();
        }
        return true;
    }
开发者ID:CartoDB,项目名称:mapnik,代码行数:26,代码来源:test_noop_rendering.cpp


示例2: render

void render(mapnik::geometry_type & geom,
            mapnik::box2d<double> const& extent,
            std::string const& name)
{
    using path_type = mapnik::coord_transform<mapnik::CoordTransform,mapnik::geometry_type>;
    using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>;
    using renderer = agg::renderer_scanline_aa_solid<ren_base>;
    mapnik::image_32 im(256,256);
    im.set_background(mapnik::color("white"));
    mapnik::box2d<double> padded_extent = extent;
    padded_extent.pad(10);
    mapnik::CoordTransform tr(im.width(),im.height(),padded_extent,0,0);
    agg::rendering_buffer buf(im.raw_data(),im.width(),im.height(), im.width() * 4);
    agg::pixfmt_rgba32_plain pixf(buf);
    ren_base renb(pixf);
    renderer ren(renb);
    ren.color(agg::rgba8(127,127,127,255));
    agg::rasterizer_scanline_aa<> ras;
    mapnik::proj_transform prj_trans(mapnik::projection("+init=epsg:4326"),mapnik::projection("+init=epsg:4326"));
    geom.rewind(0);
    path_type path(tr,geom,prj_trans);
    ras.add_path(path);
    agg::scanline_u8 sl;
    agg::render_scanlines(ras, sl, ren);
    mapnik::save_to_file(im,name);
    geom.rewind(0);
}
开发者ID:Jiangyangyang,项目名称:mapnik,代码行数:27,代码来源:test_polygon_clipping.cpp


示例3: helper

void grid_renderer<T>::process(text_symbolizer const& sym,
                               mapnik::feature_impl & feature,
                               proj_transform const& prj_trans)
{
    agg::trans_affine tr;
    auto transform = get_optional<transform_type>(sym, keys::geometry_transform);
    if (transform) evaluate_transform(tr, feature, common_.vars_, *transform, common_.scale_factor_);
    text_symbolizer_helper helper(
            sym, feature, common_.vars_, prj_trans,
            common_.width_, common_.height_,
            common_.scale_factor_ * (1.0/pixmap_.get_resolution()),
            common_.t_, common_.font_manager_, *common_.detector_,
            common_.query_extent_, tr);
    bool placement_found = false;

    composite_mode_e comp_op = get<composite_mode_e>(sym, keys::comp_op, feature, common_.vars_, src_over);

    grid_text_renderer<T> ren(pixmap_,
                              comp_op,
                              common_.scale_factor_);

    placements_list const& placements = helper.get();
    value_integer feature_id = feature.id();

    for (glyph_positions_ptr glyphs : placements)
    {
        ren.render(*glyphs, feature_id);
        placement_found = true;
    }
    if (placement_found)
    {
        pixmap_.add_feature(feature);
    }
}
开发者ID:agemsa,项目名称:mapnik,代码行数:34,代码来源:process_text_symbolizer.cpp


示例4: main

int main( int argc, char **argv )
{
    QApplication app( argc, argv );

#ifndef QSA_NO_IDE
    QObject::connect( &app, SIGNAL( lastWindowClosed() ),
		      &app, SLOT( quit() ) );

    QSProject proj( 0, "FilterModules" );
    proj.load( "filter.qsa" );

    Renderer ren( proj.interpreter() );
    proj.addObject( &ren );

    ModuleFactory factory;
    proj.interpreter()->addObjectFactory( &factory );

    QSWorkbench workbench( &proj );
    workbench.open();
    app.exec();

    proj.commitEditorContents();
    proj.save( "filter.qsa" );
#else
    QMessageBox::information( 0, "Disabled feature",
			      "QSA Workbench has been disabled. Reconfigure to enable",
			      QMessageBox::Ok );
#endif
    return 0;
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:30,代码来源:main.cpp


示例5: MAPNIK_LOG_DEBUG

void grid_renderer<T>::process(polygon_pattern_symbolizer const& sym,
                               mapnik::feature_impl & feature,
                               proj_transform const& prj_trans)
{
    std::string filename = path_processor_type::evaluate( *sym.get_filename(), feature);

    boost::optional<marker_ptr> mark = marker_cache::instance().find(filename,true);
    if (!mark) return;

    if (!(*mark)->is_bitmap())
    {
        MAPNIK_LOG_DEBUG(agg_renderer) << "agg_renderer: Only images (not '" << filename << "') are supported in the line_pattern_symbolizer";
        return;
    }

    boost::optional<image_ptr> pat = (*mark)->get_bitmap_data();
    if (!pat) return;

    ras_ptr->reset();

    agg::trans_affine tr;
    evaluate_transform(tr, feature, sym.get_transform());

    typedef boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,smooth_tag> conv_types;
    vertex_converter<box2d<double>, grid_rasterizer, polygon_pattern_symbolizer,
                     CoordTransform, proj_transform, agg::trans_affine, conv_types>
        converter(query_extent_,*ras_ptr,sym,t_,prj_trans,tr,scale_factor_);

    if (prj_trans.equal() && sym.clip()) converter.set<clip_poly_tag>(); //optional clip (default: true)
    converter.set<transform_tag>(); //always transform
    converter.set<affine_transform_tag>();
    if (sym.smooth() > 0.0) converter.set<smooth_tag>(); // optional smooth converter


    for ( geometry_type & geom : feature.paths())
    {
        if (geom.size() > 2)
        {
            converter.apply(geom);
        }
    }
    typedef typename grid_renderer_base_type::pixfmt_type pixfmt_type;
    typedef typename grid_renderer_base_type::pixfmt_type::color_type color_type;
    typedef agg::renderer_scanline_bin_solid<grid_renderer_base_type> renderer_type;

    grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_);
    pixfmt_type pixf(buf);

    grid_renderer_base_type renb(pixf);
    renderer_type ren(renb);

    // render id
    ren.color(color_type(feature.id()));
    agg::scanline_bin sl;
    ras_ptr->filling_rule(agg::fill_even_odd);
    agg::render_scanlines(*ras_ptr, sl, ren);

    // add feature properties to grid cache
    pixmap_.add_feature(feature);
}
开发者ID:GISpecialist,项目名称:mapnik,代码行数:60,代码来源:process_polygon_pattern_symbolizer.cpp


示例6: fill

void fill(Rasterizer *ras, Bitmap<Pixel> *bitmap, BlendOp *blendOp, Filler *filler, float opacity)
{
	agg::scanline_pf sl;
	ImageBaseRenderer<Filler> baseRen(*bitmap, blendOp, opacity, filler);
	Renderer<ImageBaseRenderer<Filler> > ren(baseRen);
	
	renderScanlines(*ras, sl, ren);
}
开发者ID:pasberth,项目名称:PaintField,代码行数:8,代码来源:imagepaintengine.cpp


示例7: render

 image_type render(mapnik::Map const & map, double scale_factor) const
 {
     std::stringstream ss;
     std::ostream_iterator<char> output_stream_iterator(ss);
     mapnik::svg_renderer<std::ostream_iterator<char>> ren(map, output_stream_iterator, scale_factor);
     ren.apply();
     return ss.str();
 }
开发者ID:mapycz,项目名称:mapnik,代码行数:8,代码来源:renderer.hpp


示例8: buf

void grid_renderer<T>::render_marker(Feature const& feature, unsigned int step, const int x, const int y, marker &marker, const agg::trans_affine & tr, double opacity)
{
    if (marker.is_vector())
    {
        typedef coord_transform2<CoordTransform,geometry_type> path_type;
        typedef agg::renderer_base<mapnik::pixfmt_gray16> ren_base;
        typedef agg::renderer_scanline_bin_solid<ren_base> renderer;
        agg::scanline_bin sl;
    
        grid_rendering_buffer buf(pixmap_.raw_data(), width_, height_, width_);
        mapnik::pixfmt_gray16 pixf(buf);
    
        ren_base renb(pixf);
        renderer ren(renb);
    
        ras_ptr->reset();

        box2d<double> const& bbox = (*marker.get_vector_data())->bounding_box();
        coord<double,2> c = bbox.center();
        // center the svg marker on '0,0'
        agg::trans_affine mtx = agg::trans_affine_translation(-c.x,-c.y);
        // apply symbol transformation to get to map space
        mtx *= tr;
        mtx *= agg::trans_affine_scaling(scale_factor_*(1.0/step));
        // render the marker at the center of the marker box
        mtx.translate(x+0.5 * marker.width(), y+0.5 * marker.height());

        vertex_stl_adapter<svg_path_storage> stl_storage((*marker.get_vector_data())->source());
        svg_path_adapter svg_path(stl_storage);
        svg_renderer<svg_path_adapter,
                     agg::pod_bvector<path_attributes>,
                     renderer,
                     mapnik::pixfmt_gray16> svg_renderer(svg_path,
                             (*marker.get_vector_data())->attributes());

        svg_renderer.render_id(*ras_ptr, sl, renb, feature.id(), mtx, opacity, bbox);
        
    }
    else
    {
        image_data_32 const& data = **marker.get_bitmap_data();
        if (step == 1 && scale_factor_ == 1.0)
        {
            pixmap_.set_rectangle(feature.id(), data, x, y);    
        }
        else
        {
            double ratio = (1.0/step);
            image_data_32 target(ratio * data.width(), ratio * data.height());
            mapnik::scale_image_agg<image_data_32>(target,data, SCALING_NEAR,
                scale_factor_, 0.0, 0.0, 1.0, ratio);
            pixmap_.set_rectangle(feature.id(), target, x, y);
        }
    }
    pixmap_.add_feature(feature);
}
开发者ID:ParveenArora,项目名称:mapnik,代码行数:56,代码来源:grid_renderer.cpp


示例9: ren

void agg_renderer<T0,T1>::process(group_symbolizer const& sym,
                                  mapnik::feature_impl & feature,
                                  proj_transform const& prj_trans)
{
    thunk_renderer<buffer_type> ren(*this, ras_ptr, current_buffer_, common_);

    render_group_symbolizer(
        sym, feature, common_.vars_, prj_trans, clipping_extent(common_), common_,
        ren);
}
开发者ID:HogwartsRico,项目名称:mapnik,代码行数:10,代码来源:process_group_symbolizer.cpp


示例10: ren

void  grid_renderer<T>::process(group_symbolizer const& sym,
                                mapnik::feature_impl & feature,
                                proj_transform const& prj_trans)
{
    thunk_renderer<T> ren(*this, *ras_ptr, pixmap_, common_, feature);

    render_group_symbolizer(
        sym, feature, common_.vars_, prj_trans, common_.query_extent_, common_,
        ren);
}
开发者ID:artemp,项目名称:mapnik,代码行数:10,代码来源:process_group_symbolizer.cpp


示例11: ren

void cairo_renderer<T>::process(group_symbolizer const& sym,
                                  mapnik::feature_impl & feature,
                                  proj_transform const& prj_trans)
{
    thunk_renderer<T> ren(*this, context_, face_manager_, common_);

    render_group_symbolizer(
        sym, feature, common_.vars_, prj_trans, common_.query_extent_, common_,
        ren);
}
开发者ID:cquest,项目名称:mapnik,代码行数:10,代码来源:process_group_symbolizer.cpp


示例12: do_ren

int do_ren(u8 * _old , u8 * _new){
	s8 ret;
	if (!check_for_args(REN,2)) return 1;
	ret =ren(_old, _new);
	if(ret == -1){
		vd_puts("CANNOT RENAME THIS FILE\n");
		errormessage(geterror());
	}
	fl_clean();
	return 0;
}
开发者ID:priyananda,项目名称:student,代码行数:11,代码来源:dostar.cpp


示例13: validate

 bool validate() const
 {
     mapnik::Map m(256,256);
     mapnik::load_map(m,xml_);
     m.zoom_to_box(extent_);
     mapnik::image_32 im(m.width(),m.height());
     mapnik::agg_renderer<mapnik::image_32> ren(m,im);
     ren.apply();
     //mapnik::save_to_file(im,"test.png");
     return true;
 }
开发者ID:1060460048,项目名称:mapnik,代码行数:11,代码来源:test_polygon_clipping_rendering.cpp


示例14: has_key

void agg_renderer<T0,T1>::process(dot_symbolizer const& sym,
                                  mapnik::feature_impl & feature,
                                  proj_transform const& prj_trans)
{
    double width = 0.0;
    double height = 0.0;
    bool has_width = has_key(sym,keys::width);
    bool has_height = has_key(sym,keys::height);
    if (has_width && has_height)
    {
        width = get<double>(sym, keys::width, feature, common_.vars_, 0.0);
        height = get<double>(sym, keys::height, feature, common_.vars_, 0.0);
    }
    else if (has_width)
    {
        width = height = get<double>(sym, keys::width, feature, common_.vars_, 0.0);
    }
    else if (has_height)
    {
        width = height = get<double>(sym, keys::height, feature, common_.vars_, 0.0);
    }
    double rx = width/2.0;
    double ry = height/2.0;
    double opacity = get<double>(sym, keys::opacity, feature, common_.vars_, 1.0);
    color const& fill = get<mapnik::color>(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128));
    ras_ptr->reset();
    agg::rendering_buffer buf(current_buffer_->raw_data(),current_buffer_->width(),current_buffer_->height(),current_buffer_->width() * 4);
    using blender_type = agg::comp_op_adaptor_rgba_pre<agg::rgba8, agg::order_rgba>;
    using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba<blender_type, agg::rendering_buffer>;
    using renderer_base = agg::renderer_base<pixfmt_comp_type>;
    using renderer_type = agg::renderer_scanline_aa_solid<renderer_base>;
    pixfmt_comp_type pixf(buf);
    pixf.comp_op(static_cast<agg::comp_op_e>(get<composite_mode_e>(sym, keys::comp_op, feature, common_.vars_, src_over)));
    renderer_base renb(pixf);
    renderer_type ren(renb);
    agg::scanline_u8 sl;
    ren.color(agg::rgba8_pre(fill.red(), fill.green(), fill.blue(), int(fill.alpha() * opacity)));
    agg::ellipse el(0,0,rx,ry);
    unsigned num_steps = el.num_steps();
    for (geometry_type const& geom : feature.paths()) {
        double x,y,z = 0;
        unsigned cmd = 1;
        geom.rewind(0);
        while ((cmd = geom.vertex(&x, &y)) != mapnik::SEG_END) {
            if (cmd == SEG_CLOSE) continue;
            prj_trans.backward(x,y,z);
            common_.t_.forward(&x,&y);
            el.init(x,y,rx,ry,num_steps);
            ras_ptr->add_path(el);
            agg::render_scanlines(*ras_ptr, sl, ren);
        }
    }
}
开发者ID:NavtechInc,项目名称:mapnik,代码行数:53,代码来源:process_dot_symbolizer.cpp


示例15: render_layer_for_grid

void render_layer_for_grid(mapnik::Map const& map,
                                  mapnik::grid & grid,
                                  unsigned layer_idx,
                                  boost::python::list const& fields,
                                  double scale_factor,
                                  unsigned offset_x,
                                  unsigned offset_y)
{
    std::vector<mapnik::layer> const& layers = map.layers();
    std::size_t layer_num = layers.size();
    if (layer_idx >= layer_num) {
        std::ostringstream s;
        s << "Zero-based layer index '" << layer_idx << "' not valid, only '"
          << layer_num << "' layers are in map\n";
        throw std::runtime_error(s.str());
    }

    // convert python list to std::set
    boost::python::ssize_t num_fields = boost::python::len(fields);
    for(boost::python::ssize_t i=0; i<num_fields; i++) {
        boost::python::extract<std::string> name(fields[i]);
        if (name.check())
        {
            grid.add_field(name());
        }
        else
        {
            std::stringstream s;
            s << "list of field names must be strings";
            throw mapnik::value_error(s.str());
        }
    }

    // copy field names
    std::set<std::string> attributes = grid.get_fields();
    // todo - make this a static constant
    std::string known_id_key = "__id__";
    if (attributes.find(known_id_key) != attributes.end())
    {
        attributes.erase(known_id_key);
    }

    std::string join_field = grid.get_key();
    if (known_id_key != join_field &&
        attributes.find(join_field) == attributes.end())
    {
        attributes.insert(join_field);
    }

    mapnik::grid_renderer<mapnik::grid> ren(map,grid,scale_factor,offset_x,offset_y);
    mapnik::layer const& layer = layers[layer_idx];
    ren.apply(layer,attributes);
}
开发者ID:davenquinn,项目名称:python-mapnik,代码行数:53,代码来源:python_grid_utils.cpp


示例16: operator

 void operator()() const
 {
     mapnik::Map m(256,256);
     mapnik::load_map(m,xml_);
     m.zoom_to_box(extent_);
     for (unsigned i=0;i<iterations_;++i)
     {
         mapnik::image_32 im(m.width(),m.height());
         mapnik::agg_renderer<mapnik::image_32> ren(m,im);
         ren.apply();
     }
 }
开发者ID:1060460048,项目名称:mapnik,代码行数:12,代码来源:test_polygon_clipping_rendering.cpp


示例17: buf

void  agg_renderer<T>::process(line_pattern_symbolizer const& sym,
                               mapnik::feature_ptr const& feature,
                               proj_transform const& prj_trans)
{
    typedef agg::conv_clip_polyline<geometry_type> clipped_geometry_type;
    typedef coord_transform2<CoordTransform,clipped_geometry_type> path_type;
    typedef agg::line_image_pattern<agg::pattern_filter_bilinear_rgba8> pattern_type;
    typedef agg::renderer_base<agg::pixfmt_rgba32_plain> renderer_base;
    typedef agg::renderer_outline_image<renderer_base, pattern_type> renderer_type;
    typedef agg::rasterizer_outline_aa<renderer_type> rasterizer_type;

    agg::rendering_buffer buf(pixmap_.raw_data(),width_,height_, width_ * 4);
    agg::pixfmt_rgba32_plain pixf(buf);

    std::string filename = path_processor_type::evaluate( *sym.get_filename(), *feature);

    boost::optional<marker_ptr> mark = marker_cache::instance()->find(filename,true);
    if (!mark) return;

    if (!(*mark)->is_bitmap())
    {
        std::clog << "### Warning only images (not '" << filename << "') are supported in the line_pattern_symbolizer\n";
        return;
    }

    boost::optional<image_ptr> pat = (*mark)->get_bitmap_data();

    if (!pat) return;

    box2d<double> ext = query_extent_ * 1.1;
    renderer_base ren_base(pixf);
    agg::pattern_filter_bilinear_rgba8 filter;
    pattern_source source(*(*pat));
    pattern_type pattern (filter,source);
    renderer_type ren(ren_base, pattern);
    // TODO - should be sensitive to buffer size
    ren.clip_box(0,0,width_,height_);
    rasterizer_type ras(ren);
    //metawriter_with_properties writer = sym.get_metawriter();
    for (unsigned i=0;i<feature->num_geometries();++i)
    {
        geometry_type & geom = feature->get_geometry(i);
        if (geom.num_points() > 1)
        {
            clipped_geometry_type clipped(geom);
            clipped.clip_box(ext.minx(),ext.miny(),ext.maxx(),ext.maxy());
            path_type path(t_,clipped,prj_trans);
            ras.add_path(path);
            //if (writer.first) writer.first->add_line(path, *feature, t_, writer.second);
        }
    }
}
开发者ID:novldp,项目名称:mapnik,代码行数:52,代码来源:process_line_pattern_symbolizer.cpp


示例18: buf

void grid_renderer<T>::process(building_symbolizer const& sym,
                               mapnik::feature_impl & feature,
                               proj_transform const& prj_trans)
{
    using pixfmt_type = typename grid_renderer_base_type::pixfmt_type;
    using color_type = typename grid_renderer_base_type::pixfmt_type::color_type;
    using renderer_type = agg::renderer_scanline_bin_solid<grid_renderer_base_type>;
    using transform_path_type = transform_path_adapter<view_transform, vertex_adapter>;
    agg::scanline_bin sl;

    grid_rendering_buffer buf(pixmap_.raw_data(), common_.width_, common_.height_, common_.width_);
    pixfmt_type pixf(buf);

    grid_renderer_base_type renb(pixf);
    renderer_type ren(renb);

    ras_ptr->reset();

    double height = get<value_double>(sym, keys::height, feature, common_.vars_, 0.0);

    render_building_symbolizer(
        feature, height,
        [&](path_type const& faces)
        {
            vertex_adapter va(faces);
            transform_path_type faces_path (common_.t_,va,prj_trans);
            ras_ptr->add_path(faces_path);
            ren.color(color_type(feature.id()));
            agg::render_scanlines(*ras_ptr, sl, ren);
            ras_ptr->reset();
        },
        [&](path_type const& frame)
        {
            vertex_adapter va(frame);
            transform_path_type path(common_.t_,va,prj_trans);
            agg::conv_stroke<transform_path_type> stroke(path);
            ras_ptr->add_path(stroke);
            ren.color(color_type(feature.id()));
            agg::render_scanlines(*ras_ptr, sl, ren);
            ras_ptr->reset();
        },
        [&](path_type const& roof)
        {
            vertex_adapter va(roof);
            transform_path_type roof_path (common_.t_,va,prj_trans);
            ras_ptr->add_path(roof_path);
            ren.color(color_type(feature.id()));
            agg::render_scanlines(*ras_ptr, sl, ren);
        });

    pixmap_.add_feature(feature);
}
开发者ID:Airphrame,项目名称:mapnik,代码行数:52,代码来源:process_building_symbolizer.cpp


示例19: helper

void  grid_renderer<T>::process(shield_symbolizer const& sym,
                                mapnik::feature_impl & feature,
                                proj_transform const& prj_trans)
{
    shield_symbolizer_helper<face_manager<freetype_engine>,
        label_collision_detector4> helper(
            sym, feature, prj_trans,
            width_, height_,
            scale_factor_,
            t_, font_manager_, *detector_,
            query_extent_);
    bool placement_found = false;

    text_renderer<T> ren(pixmap_,
                         font_manager_,
                         sym.get_halo_rasterizer(),
                         sym.comp_op(),
                         scale_factor_);

    text_placement_info_ptr placement;
    while (helper.next())
    {
        placement_found = true;
        placements_type const& placements = helper.placements();
        for (unsigned int ii = 0; ii < placements.size(); ++ii)
        {
            // get_marker_position returns (minx,miny) corner position,
            // while (currently only) agg_renderer::render_marker newly
            // expects center position;
            // until all renderers and shield_symbolizer_helper are
            // modified accordingly, we must adjust the position here
            pixel_position pos = helper.get_marker_position(placements[ii]);
            pos.x += 0.5 * helper.get_marker_width();
            pos.y += 0.5 * helper.get_marker_height();
            render_marker(feature,
                          pixmap_.get_resolution(),
                          pos,
                          helper.get_marker(),
                          helper.get_image_transform(),
                          sym.get_opacity(),
                          sym.comp_op());

            ren.prepare_glyphs(placements[ii]);
            ren.render_id(feature.id(), placements[ii].center);
        }
    }
    if (placement_found)
        pixmap_.add_feature(feature);
}
开发者ID:jy4618272,项目名称:mapnik,代码行数:49,代码来源:process_shield_symbolizer.cpp


示例20: on_draw

    virtual void on_draw()
    {
        typedef agg::gamma_lut<agg::int8u, agg::int8u, 8, 8> gamma_lut_type;
        typedef agg::pixfmt_bgr24_gamma<gamma_lut_type> pixfmt;
        typedef agg::renderer_base<pixfmt> renderer_base;
        typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid;

        gamma_lut_type gamma(m_gamma.value());
        pixfmt pixf(rbuf_window(), gamma);
        renderer_base rb(pixf);
        renderer_solid ren(rb);

        rb.clear(m_white_on_black.status() ? agg::rgba(0,0,0) : agg::rgba(1,1,1));

        agg::rasterizer_scanline_aa<> ras;
        agg::scanline_p8 sl;

        agg::ellipse e;

        // Render two "control" circles
        ren.color(agg::rgba8(127,127,127));
        e.init(m_x[0], m_y[0], 3, 3, 16);
        ras.add_path(e);
        agg::render_scanlines(ras, sl, ren);
        e.init(m_x[1], m_y[1], 3, 3, 16);
        ras.add_path(e);
        agg::render_scanlines(ras, sl, ren);

        double d = m_offset.value();

        // Creating a rounded rectangle
        agg::rounded_rect r(m_x[0]+d, m_y[0]+d, m_x[1]+d, m_y[1]+d, m_radius.value());
        r.normalize_radius();

        // Drawing as an outline
        agg::conv_stroke<agg::rounded_rect> p(r);
        p.width(1.0);
        ras.add_path(p);
        ren.color(m_white_on_black.status() ? agg::rgba(1,1,1) : agg::rgba(0,0,0));
        agg::render_scanlines(ras, sl, ren);

        ras.gamma(agg::gamma_none());

        // Render the controls
        agg::render_ctrl(ras, sl, rb, m_radius);
        agg::render_ctrl(ras, sl, rb, m_gamma);
        agg::render_ctrl(ras, sl, rb, m_offset);
        agg::render_ctrl(ras, sl, rb, m_white_on_black);
    }
开发者ID:Rodeo314,项目名称:vasFMC,代码行数:49,代码来源:rounded_rect.cpp



注:本文中的ren函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rename函数代码示例发布时间:2022-05-30
下一篇:
C++ removevars函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap