« Return to Thread: [AGG] Basic image transformations

Re: [AGG] Basic image transformations

by Maxim Shemanarev :: Rate this Message:

| View in Thread

> However, when I change the surfaces and associated pixfmts to the 32 bit
> variety, the output is strange. First of all, it appears monochrome.
> Also, there are solid vertical stripes running down the image in every
> 4th column. If I fill the image with one solid colour, each column in
> the output will appear a different shade of gray, from white when a fill
> colour channel is set to 255, to black when a channel is 0. It's as
> though the interpolation is writing int32s instead of int8s to each
> channel in the output.

Just use pixfmt_bgra32 and span_image_filter_rgba_bilinear.

> While I'm at it, perhaps I'll pose a couple other questions that have
> been bugging me:
>
> 1) What are the xx_pre classes (e.g. pixfmt_bgr24_pre)?

They are premultiplied versions of renderers. That is, they take premultiplied
RGBA colors in the input. As Stephan Assmus showed, the image filters should
work namely in the premultiplied color space.

> 2) If I remove the ellipse part from the above example the output is
> blank. What's going on here? What would I do to make that ellipse a box,
> or just show the whole image?

Well, the image is just one of possible fill types, like solid color, gradient,
pattern, etc. The common idea is that you first prepare geometry - the shape.
And then fill it with a color/image/etc. So that, instead of an ellipse there
must be something, some path. For example, a rectangle:

agg::path_storage path;
path.move_to(0, 0);
path.line_to(width, 0);
path.line_to(width, height);
path.line_to(0, height);
path.close_polygon();

You also need to transform the path, which is also rather confusing.
See also image_perspective.cpp

McSeem



               
__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general

 « Return to Thread: [AGG] Basic image transformations