裁剪对于很多人来说,也就是设定一块能够操作的区域,这块区域设定之后,任何的操作都会检测是否在该裁剪区域内,如果不在,就会放弃渲染。 Large scaling values, not large windows :-). For now it‘s only rectangular clipping. Well, I feel I need to clarify it. Maybe it‘s a confusing term "polygonal", actually it‘s "vectorial". Now there‘re two levels of clipping. The low level is the scanline-clipping and it‘s done in the renderers. It helps to keep drawing inside the framebuffer only, but in case where the polygon is completely out of bound there‘s still a lot of useless work. Another level is pure vectorial, see agg_conv_clip_polygon.h It clips polygons and in general case produces a new or modified set of vertices. I‘m also thinking about the third level of clipping, based on bounding boxes (kind of rough clipping).
As for arbitrary shapes for clipping there‘re also two different things. One is pixel alpha-masking, I‘ll work on in soon. It‘s not only a visible/invisible flag, it‘s an alpha-value. So, the basic technique is. You render the simple 256 grayscale buffer and then use it as a mask, so that you can have clipping of any shape (and yes, including round ones) with perfectly anti-aliases edges. It‘s a pixel-based mask. The other is called CSG (Constructive Solid Geometry), i.e., unions, intersections, etc. It‘s also done in the vectorial representation before rendering. I‘m thinking about some simple implementation of the intersection operation (arbitrary polygonal clipping).
> > agg::arrowhead ah; > > ah.head(8, 8, 6, 4); > > ah.tail(2, 3, 6, 10); > > agg::conv_stroke<agg::path_storage, agg::gen_markers_term> > > dash(curve); > > agg::conv_marker<agg::gen_markers_term, agg::arrowhead> > > arrow(stroke.markers(), ah); > > > > Here agg::gen_markers_term is a terminal marker locator (a storage of > > coordinates plus orientation). agg::arrowhead is a simplest vertex source > > that determines the shape of the markers. One can use even > > agg::path_storage > > for that. For now there‘s only agg::gen_markers_term implemented but there > > is an infrastructure to create gen_markers_whatever. > Term here means terminal, ie. end of lines? So if you have a polyline, it > will apply to start and end point of that polyline? Correct. Actually, the general approach is that each polygon/polyline (each subpath to be exact) can have any number of types of markers. In this particular case there‘re only two of them - the start and the end ones. They‘re all stored in the marker locator. Each type of markers corresponds with a particular path in the marker generator. > > Also, there‘s "bleeding effect" elimination > > You mean paint leaking?
时间: 2024-10-26 00:07:18