Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

AGG lesson 29 the difference of agg::render_scanlines

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Attach the code:

Agg::rendering_buffer & rbuf = rbuf_window (); / / get the rendering cache

Agg::pixfmt_bgr24 pixf (rbuf); / / make up pixels

Typedef agg::renderer_base renderer_base_type

Renderer_base_type renb (pixf); / / provides a crop region, which is valid for rendering only within the crop region

Typedef agg::renderer_scanline_bin_solid renderder_scanline_type

Renderder_scanline_type rensl (renb); / / customize the underlying renderer

Agg::rasterizer_scanline_aa ras

Agg::scanline_u8 sl

Ras.reset ()

Renb.clear (agg::rgba8 (255255255))

Agg::ellipse ell (320230230)

Agg::conv_stroke stroke (ell)

Ras.add_path (stroke)

Rensl.color (agg::rgba8 (255j0pl 0))

Agg::render_scanlines (ras,sl,rensl)

This method does not provide anti-aliasing effect, using agg::renderer_scanline_bin_solid

Compare the following code:

Agg::rendering_buffer & rbuf = rbuf_window ()

Agg::pixfmt_bgr24 pixf (rbuf)

Typedef agg::renderer_base renderer_base_type

Renderer_base_type renb (pixf)

Renb.clear (agg::rgba8 (255255255))

Agg::rasterizer_scanline_aa ras

Agg::scanline_u8 sl

Ren_bas.clear (agg::rgba8 (255255255))

Agg::ellipse ell (320230230)

Agg::conv_stroke stroke (ell)

Ras.add_path (stroke)

Agg::render_scanlines_aa_solid (ras,sl,renb,agg::rgba8 (255j0pl 0))

The rendered circle is anti-aliased and the effect is very good. Aa actually means anti-aliasing.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report