예제 #1
0
void copy_constructor()
{
	Ring_Buffer<32> rbuf;
	rbuf.fill(0xAB);

	/// Copy constructor
	Ring_Buffer<24> rbuf2(rbuf);
	assert(rbuf2.full() == true);

	Ring_Buffer<33> rbuf3(rbuf);
	assert(rbuf3.full() == false);

	rbuf3.add<uint8_t>(0xFF);
	assert(rbuf3.full() == true);

	cout << __func__ << endl;
}
예제 #2
0
int main()
{

    agg::grid_value* buf = new agg::grid_value[width * height];
    agg::grid_rendering_buffer rbuf2(buf, width, height, width);

    agg::grid_renderer<agg::span_grid> ren_grid(rbuf2);
    agg::grid_rasterizer ras_grid;
    
    std::clog << "size char: " << sizeof(unsigned char) << "\n";
    std::clog << "size int: " << sizeof(unsigned int) << "\n";

    //ras_grid.gamma(0.0);
    //ras_grid.filling_rule(agg::fill_even_odd);

    ren_grid.clear(' ');

    draw_line(ras_grid, 120,120,20,70,10);
    ras_grid.render(ren_grid, 'a');

    ras_grid.move_to_d(50,50);
    ras_grid.line_to_d(50,100);
    ras_grid.line_to_d(100,100);
    ras_grid.line_to_d(100,50);
    ras_grid.render(ren_grid, 'b');

    draw_ellipse(ras_grid, 120,120,20,70);
    ras_grid.render(ren_grid, 'c');

    ras_grid.move_to_d(200,200);
    ras_grid.line_to_d(200,300);
    ras_grid.line_to_d(300,300);
    ras_grid.line_to_d(300,200);
    ras_grid.render(ren_grid, 'd');

    buf2grid(4,rbuf2);
    delete buf;
    return 0;
}