|
From: Baptiste G. <b_g...@ho...> - 2006-07-12 13:02:28
|
Thank you.
----- Original Message -----
From: "Maxim Shemanarev" <mcs...@ya...>
To: "Anti-Grain Geometry" <vec...@li...>
Sent: Tuesday, July 11, 2006 6:29 PM
Subject: Re: [AGG] Maximum number of curves in path_storage
> Hi Baptiste,
>
> The problem isn't in the path storage. There's a limitation in the
> rasterizer.
> The maximal number of cells is restricted by cell_block_limit, it's
> 4096*1024,
> which consumes at most 67 megs (16 bytes per cell).
> You create a huge shape that must be rendered as a single layer. It's not
> a
> good idea.
> Well, this restriction may look bad, but there's nothing you can do with
> it.
> You can render a scene of any complexity with consecutive calls to
> render_scanlines, but the complexity of a single shape is limited.
> Technically
> it's possible to write a rasterizer without this restriction, but I'm not
> sure
> it makes sense. It will have a huge internal buffer, in your case
> 10000x10000x16.
>
> So, the suggestion is to render the scene in many calls to
> render_scanlines, as
> you did in the second example. But in this case you form the path every
> time
> from scratch.
>
> First, you need to understand that each move_to does not create a separate
> path. It starts a new segment of the *same* path. So that, any number of
> curves, separated by move_to will be rendered as a single layer of paint.
> It's
> very important to draw self-intersecting translucent strokes.
>
> However, you can keep as many paths as you want in a single path_storage.
> To
> start a new path call path.start_new_path() that will return an abstract
> path_id to navigate. You will need to store this ids, for example:
>
> std::vector<unsigned> path_ids;
> for(. . .)
> {
> path_ids.push_back(path.start_new_path());
> path.move_to(. . .);
> . . . make the path;
> }
>
>
> Then you navigate and render them:
>
> conv_curve<path_storage> curve(path);
> conv_stroke<conv_curve<path_storage> > stroke(curve);
>
> for(i = 0; i < path_ids.size(); i++)
> {
> scanlineRasterizer.add_path(stroke, path_ids[i]);
> render_scanlines(scanlineRasterizer, unpackedScanline,
> scanlineRenderer);
> }
>
> McSeem
>
>
>
> --- Baptiste Gaillard <b_g...@ho...> wrote:
>
>> Hello, I'm comparing AGG library to other graphic libraries in terms of
>> performance.
>> To test bezier curves I draw 1000000 curves in a 10000*10000 (3 bytes per
>> pixels) buffer.
>>
>> I first write that:
>> rgba8 color(255,255,255);
>> for(unsigned i = 0; i < 1000; ++i)
>> for(unsigned j = 0; j < 100; ++j) {
>> path.move_to(j * 100, (i*10) + 20);
>> path.curve3(j*100 + 50, i*10, (j + 1) * 100, (i*10) + 20);
>> }
>> scanlineRenderer.color(color);
>> conv_curve<path_storage> curve(path);
>> conv_stroke<conv_curve<path_storage> > stroke(curve);
>> stroke.width(1);
>>
>> scanlineRasterizer.add_path(stroke);
>> render_scanlines(scanlineRasterizer, unpackedScanline,
>> scanlineRenderer);
>>
>>
>> But it seems that not all beziers curves are drawn, I think that the
>> path_storage can't store all curves.
>> So I replace the code by:
>>
>> rgba8 color(255,255,255);
>> scanlineRenderer.color(color);
>>
>> for(unsigned i = 0; i < 1000; ++i) {
>> path.remove_all();
>>
>>
>> for(unsigned j = 0; j < 100; ++j) {
>> path.move_to(j * 100, (i*10) + 20);
>> path.curve3(j*100 + 50, i*10, (j + 1) * 100, (i*10) + 20);
>> }
>> conv_curve<path_storage> curve(path);
>> conv_stroke<conv_curve<path_storage> > stroke(curve);
>> stroke.width(1);
>>
>> scanlineRasterizer.add_path(stroke);
>> render_scanlines(scanlineRasterizer, unpackedScanline,
>> scanlineRenderer);
>> }
>>
>> Now it's ok, so how many curves can I strore in path_storage ? What are
>> the
>> limitations of the path_storage object ?
>> Thanks.
>>
>> Baptiste Gaillard
>>
>> PS: Sorry for my English, I'm french :-)>
>> -------------------------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services, security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> > _______________________________________________
>> Vector-agg-general mailing list
>> Vec...@li...
>> https://lists.sourceforge.net/lists/listinfo/vector-agg-general
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Vector-agg-general mailing list
> Vec...@li...
> https://lists.sourceforge.net/lists/listinfo/vector-agg-general
>
|