Can anybody talk about example "trans_curve2"

View: New views
3 Messages — Rating Filter:   Alert me  

Can anybody talk about example "trans_curve2"

by jjyy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everybody!
I can't understand the example "trans_curve2"

What is agg::conv_segmentator to do.and conv_transform

how did a series of font point turn to go along the curve?

i try to learn some form agg but it is so hard.and turtorial is so little :-).

is there some turtorial about this。or about agg.no documents on the web site of agg.

thanks a lot.

------------------------------------------------------------------------------

_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Can anybody talk about example "trans_curve2"

by Stephan Assmus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On 2009-07-22 at 08:59:26 [+0200], 万瑞瑞 <dulton@...> wrote:
> I can't understand the example "trans_curve2"
>
> What is agg::conv_segmentator to do.and conv_transform

The agg::conv_segmentator turns a long straight line into a series of short
straight line segments, so that another transformer could bend the straight
line, like the agg::trans_curve transformer. agg::conv_transform is a path
converter that takes a vertex source and a transformer.

In AGG, you have a number of simple "interfaces". One of the most basic
ones is called a "vertex source". A vertex source must provide these two
methods:

        unsigned vertex(double* x, double* y);
        void rewind(unsigned pathID);

It's an iterator interface to iterate over all the points of the vertex
source and obtain the associated path commands for each such point.

The next interface/concept is called a "converter". It takes an input
vertex source, but implements the vertex source interface itself, to
produce new vertex output. Another interface in AGG is the "transformer".
It must provide the method

        void transform(double* x, double* y);

When you formulate template pipelines in your code, you chain all these
classes together at compile time.

> how did a series of font point turn to go along the curve?

That's what the agg::trans_curve transformer does. It computes a local
transformation by mapping the path to the baseline of the text and vice
versa. Then this transformation is applied to the glyphs path segments. The
pipeline in the example uses the vertex source from the text glyphs and
feeds them as input to the agg::conv_transform object, which was assigned a
agg::trans_curve transformer to produce the final/transformed vertices.

Best regards,
-Stephan

------------------------------------------------------------------------------
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

Re: Can anybody talk about example "trans_curve2"

by jjyy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

To Stephan Assmus

 
Thanks so much for so many words.
I got it. :-)

2009/7/22 Stephan Assmus <superstippi@...>
Hi,

On 2009-07-22 at 08:59:26 [+0200], 万瑞瑞 <dulton@...> wrote:
> I can't understand the example "trans_curve2"
>
> What is agg::conv_segmentator to do.and conv_transform

The agg::conv_segmentator turns a long straight line into a series of short
straight line segments, so that another transformer could bend the straight
line, like the agg::trans_curve transformer. agg::conv_transform is a path
converter that takes a vertex source and a transformer.

In AGG, you have a number of simple "interfaces". One of the most basic
ones is called a "vertex source". A vertex source must provide these two
methods:

       unsigned vertex(double* x, double* y);
       void rewind(unsigned pathID);

It's an iterator interface to iterate over all the points of the vertex
source and obtain the associated path commands for each such point.

The next interface/concept is called a "converter". It takes an input
vertex source, but implements the vertex source interface itself, to
produce new vertex output. Another interface in AGG is the "transformer".
It must provide the method

       void transform(double* x, double* y);

When you formulate template pipelines in your code, you chain all these
classes together at compile time.

> how did a series of font point turn to go along the curve?

That's what the agg::trans_curve transformer does. It computes a local
transformation by mapping the path to the baseline of the text and vice
versa. Then this transformation is applied to the glyphs path segments. The
pipeline in the example uses the vertex source from the text glyphs and
feeds them as input to the agg::conv_transform object, which was assigned a
agg::trans_curve transformer to produce the final/transformed vertices.

Best regards,
-Stephan

------------------------------------------------------------------------------
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general


------------------------------------------------------------------------------

_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general