|
From: Maxim S. <mcs...@ya...> - 2005-11-10 05:30:41
|
Thanks for the explanations. Now it's clear.
> - Create a new grayscale image 1 pixel wide and 1 pixel high.
> - Click on Image/Image Size and enter a new image size (e.g. 100x100 pixels)
> and select bilinear filter. Click OK.
> - The resulting image is a solid black rectangle. You can also do similar
> experiments with different bit patterns and you will notice that image edges
> are preserved and that there no gradients at the edges of the image.
Yes, I understand the problem now, but it's technically impossible to do so in
the filters themselves. Well, it's possible if you just scale the image, not
rotating it. But for arbitrary transformations we need to know the
corresponding pixel at the edge. It might be nontrivial to calculate it.
The first solution is to extend the source image and then to copy the boundary
pixels. There's no such functionality in AGG, but it's trivial to do even
without AGG or anything else.
The second solution is a kinda hack with patterns. Just use
agg::span_pattern_filter_nnnnn instead of agg::span_image_filter_nnnnn. You can
set the wrapping mode to reflect by X and Y:
typedef agg::wrap_mode_reflect_auto_pow2 wrap_type;
typedef span_pattern_filter_rgb<color_type,
component_order,
interpolator_type,
wrap_type,
wrap_type> span_gen_type;
So that, you will have tiled surface. If you restrict your shape with the
initial image size (with the respective scaling, of course), you will have
exactly what you need, that is, repeating boundary pixels.
McSeem
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
|