line image pattern and filters

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

line image pattern and filters

by George-156 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all

I've been trying to get a better understanding of the line_image_pattern
class and the bilinear_rgba8 filter. Basically I am trying to render a
pattern along a line but the quality is quite bad loosing a few of the
edges (arrows). Tried nn filter and that produced horrible results. If
anyone has some sample code or ideas please help (also trying to specify
how often to render the pattern - x spacing)

Code is simple enough:

                void DrawPath (agg::path_storage& path, agg::pixel_map*
pm, double startAt, double scale)
                {
                   
                    typedef
agg::line_image_pattern<agg::pattern_filter_bilinear_rgba8>      
pattern_type;
                    typedef agg::renderer_outline_image<baseRenderer,
pattern_type>          renderer_type;
                    typedef agg::rasterizer_outline_aa<renderer_type>    
                    rasterizer_type;

                   
_base_ren->clip_box((int)_clipBox->x1,(int)_clipBox->y1,(int)_clipBox->x2,(int)_clipBox->y2);    


                    rendering_buffer                                    
                rbuf(pm->buf(), pm->width(), pm->height(), pm->stride());
                    pixfmt                                            
                  img_pixf(rbuf);
                   
                    agg::pattern_filter_bilinear_rgba8                
                    fltr;
                    pattern_type                                        
                patt(fltr,img_pixf);
                    renderer_type                                        
                ren_img(*_base_ren, patt);
                   
ren_img.clip_box((int)_clipBox->x1,(int)_clipBox->y1,(int)_clipBox->x2,(int)_clipBox->y2);
                    ren_img.start_x(startAt);
                    ren_img.scale_x(scale);

                    rasterizer_type                                    
                    ras_img(ren_img);
                   
                    ras_img.add_path(path);

                }


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general