コード例 #1
0
ファイル: agg_renderer.cpp プロジェクト: Jiangyangyang/mapnik
void agg_renderer<T0,T1>::draw_geo_extent(box2d<double> const& extent, mapnik::color const& color)
{
    box2d<double> box = common_.t_.forward(extent);
    double x0 = box.minx();
    double x1 = box.maxx();
    double y0 = box.miny();
    double y1 = box.maxy();
    unsigned rgba = color.rgba();
    for (double x=x0; x<x1; x++)
    {
        pixmap_.setPixel(x, y0, rgba);
        pixmap_.setPixel(x, y1, rgba);
    }
    for (double y=y0; y<y1; y++)
    {
        pixmap_.setPixel(x0, y, rgba);
        pixmap_.setPixel(x1, y, rgba);
    }
}
コード例 #2
0
void set_pixel(mapnik::image_32 & im, unsigned x, unsigned y, mapnik::color const& c)
{
    im.setPixel(x, y, c.rgba());
}
コード例 #3
0
ファイル: image_view.cpp プロジェクト: CartoDB/mapnik
    // Check that row_size is correct
    CHECK(view_all.row_size() == 16);
    CHECK(view_blue.row_size() == 8);
    CHECK(view_green.row_size() == 8);
    CHECK(view_yellow.row_size() == 8);
    CHECK(view_red.row_size() == 8);
    
    // Check that get_premultiplied is correct
    CHECK_FALSE(view_all.get_premultiplied());
    CHECK_FALSE(view_blue.get_premultiplied());
    CHECK_FALSE(view_green.get_premultiplied());
    CHECK_FALSE(view_yellow.get_premultiplied());
    CHECK_FALSE(view_red.get_premultiplied());

    // Check that operator to retrieve value works properly
    CHECK(view_all(0,0) == c_blue.rgba());
    CHECK(view_blue(0,0) == c_blue.rgba());
    CHECK(view_green(0,0) == c_green.rgba());
    CHECK(view_yellow(0,0) == c_yellow.rgba());
    CHECK(view_red.row_size() == 8);
    
    // Check that offset is correct
    CHECK(view_all.get_offset() == 0.0);
    CHECK(view_blue.get_offset() == 0.0);
    CHECK(view_green.get_offset() == 0.0);
    CHECK(view_yellow.get_offset() == 0.0);
    CHECK(view_red.get_offset() == 0.0);
    
    // Check that scaling is correct
    CHECK(view_all.get_scaling() == 1.0);
    CHECK(view_blue.get_scaling() == 1.0);