rectangular clipping

裁剪对于很多人来说,也就是设定一块能够操作的区域,这块区域设定之后,任何的操作都会检测是否在该裁剪区域内,如果不在,就会放弃渲染。
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

rectangular clipping的相关文章

AGG 邮件往来翻译

追忆http://www.antigrain.com!! I also fugured out how to implement the alpha-masking in a simple and very elegant way 指出如何简单而又优雅的实现alpha-masking,什么东东!! Here's a picture that explains (I hope) the construction of the conversion pipelines 作者试图解释转换管道的构造过程

ACdream 1429 Rectangular Polygon

Rectangular Polygon Time Limit: 1000MS   Memory Limit: 256000KB   64bit IO Format: %lld & %llu Description A rectangular polygon is a polygon whose edges are all parallel to the coordinate axes. The polygon must have a single, non-intersecting bounda

[转] Fix: Screen Clipping Shortcut In OneNote Not Working After Upgrading To Windows 8.1

RECOMMENDED: Click here to fix Windows errors and optimize system performance No doubt, OneNote is yet another useful component of Microsoft‘ productivity suite aka Office. Using OneNote, you can easily clip your immediate notes. For this to be worke

[算法]A General Polygon Clipping Library

A General Polygon Clipping Library Version 2.32    http://www.cs.man.ac.uk/~toby/alan/software/gpc.html Alan Murta Advanced Interfaces Group Department of Computer Science University of Manchester Manchester M13 9PL, UK Abstract: This document descri

How to set up a clipping rectangle ?

What is the best way to set up a clipping rectangle with AGG ? I guess I could specify a subset of the output buffer by tweaking its origin and its width/height, yet keeping the same byte width, but this won't clip what gets rasterized. A bit OT, but

acdream 1429 Rectangular Polygon【dp】

题目:acdream 1429 Rectangular Polygon 题意:给出n个数,是边长,然后问你能不能组成多边形,其边必须是平行于x轴或者平行于y轴的.如果可以的话输出任意一种方案. 分析:分析发现,就是给你一堆数,然后让你尽可能挑出多的数,分成两部分的和相等,我们可以用dp来解决这个问题. 定义dp[i][j] 前 i 个数中挑出一些书其两部分的差值是 j 的最大个数. 转移方程: dp[i][j] = max(dp[i][j],dp[i-1][j]); //不放 dp[i][j-a

Largest Rectangular Area in a Histogram

题目地址:https://oj.leetcode.com/problems/largest-rectangle-in-histogram/ ,刚开始其实没做这个题,而是在做https://oj.leetcode.com/problems/maximal-rectangle/其中很重要的一步就是用到Largest Rectangular Area in a Histogram题中的算法. Given n non-negative integers representing the histogra

poj 2836 Rectangular Covering(状压DP)

Rectangular Covering Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1716   Accepted: 468 Description n points are given on the Cartesian plane. Now you have to use some rectangles whose sides are parallel to the axes to cover them. Ever

POJ 2836 Rectangular Covering 题解 《挑战程序设计竞赛》

POJ 2836 Rectangular Covering铺地板:坐标平面上有n各点,用任意大小(非零)的地板砖覆盖它们,求最省的地板砖总面积.3.4熟练掌握动态规划状态压缩DP先预处理数据,将n个点两两组合形成n * (n-1) / 2个矩形,计算每个矩形的面积和内部点个数.接着利用预处理数据来枚举,定义dp[S] := 矩形集为S时的最省面积先假设平面上没有矩形,那么dp[0]=0,接着一个一个地往平面上加矩形,递推关系是:dp[新矩形集合] = min(dp[新矩形集合], dp[旧矩形集