1 前言
该话题是由于讨论整型和浮点型的线宽之间的差异,从而引出的低级渲染器的出现时机,实际上主要是考虑到性能。
2 翻译
实际上,如果需要渲染1个像素宽度的横线或者竖线,通常和像素对齐,就是占满坐标格子)实际上,如果确定不需要使用AGG的任何转换,最好使用低级的渲染器render_base.
Actually, if you need to draw horizontal and vertical lines of exactly 1 pixel width, always aligned to pixels (say, coordinate grid), and if you are absolutely sure you won‘t need to transform them using AGG converters, it‘s better to use low level renderer_base::copy_hline(), copy_vline(), blend_hline(), blend_vline(), or, if you need to draw dashed/dotted lines, blend_solid_hspan(), blend_solid_vspan(). The latest require an array of "covers", that can be 0 for gaps and 255 for dashes. Intermediate values will be drawn with respective opacity.
时间: 2024-10-25 00:17:04