AGG第四十课 SVG 使用的三种管道

The current version of SVG contains 3 pipelines:

Simple polygons:

path_storage ->

conv_curve ->

conv_transform ->

conv_clip

Strokes:

path_storage ->

conv_curve ->

conv_stroke ->

conv_transform ->

conv_clip

Contoured polygons:

path_storage ->

conv_curve ->

conv_contour ->

conv_transform ->

conv_clip

> And is it doubly calculated for

> filling, then stroking (in

> case both apply)?

It is. Otherwise you would have to store the

intermediate result somewhere. But the good news is

that conv_curve works pretty fast, at least stroking

and clipping are much more time consuming tasks.

The only obvious case when we can approximate the

curves in the last step is drawing text. But again,

when it‘s without stroking/outlining/contouring.

>  Also what exactly does conv_contour do?

Exactly half of the work conv_stroke does. :-) It

dilates or erodes polygons depending on the sign of

the width. I used it to eliminate the defects when

joining anti-aliased polygons:http://www.antigrain.com/img/polygon_join_defects.jpg> I hope you dont mind all these questions :)

Of course I don‘t. Afterall I myself started cooking

this porridge :-)

> If so, doesnt this give the same result each time,

> as its done before the

> conv_transform?

Yes, it does, at least seems to do :-)

But the reality is more complex. Here‘s a

contadiction. Yes, we could transform paths before

approximating them with line segments. But conv_stroke

and conv_contour require already decomposed path. So,

the only case we can use this order (conv_transform ->

conv_curve) is a simple filled polygon without a

"border". But the situation is even worse. I use

conv_clip that performs polygonal clipping. Such kind

of a "vectorial" clipping can work with line segments

only, so, the curves must be decomposed before

clipping. Ideally it would be fine to decompose curves

as late as possible, but if the order of the

conversions is different solid and stroked paths will

be inconsistent:http://www.antigrain.com/img/conv_order.gifEventually I decided to set my jaw and to convert the

curves in the first pipeline step. Well, this is the

whole idea of the custom pipelines - in certain cases

you can use different conversion order for the sake of

performance.

时间: 2024-09-30 07:16:37

AGG第四十课 SVG 使用的三种管道的相关文章

SVG 使用的三种管道

The current version of SVG contains 3 pipelines: Simple polygons: path_storage ->  conv_curve ->    conv_transform ->    conv_clip Strokes: path_storage ->  conv_curve ->    conv_stroke ->    conv_transform ->     conv_clip Contoured 

5周第1次课 安装软件包的三种方法 rpm包介绍 yum工具用法 yum搭建本地仓库

Linux 安装软件的三种方式 rpm 工具:此种安装方式即通过rpm 工具对介质上的rpm 包进行安装. yum 工具:核心依然是rpm,但不同的是它是基于网络的源,并会自动安装依赖组件. 源码包:源代码包,需要相应的编译器进行编译,然后才能安装.三种方式里最难的. 1.rpm 工具 rpm包的来源:光盘或其他地方拷贝本次实验,将Centos7虚拟光盘加载到虚拟机上 1.1 进入系统后执行挂载 [[email protected] ~]# mount /dev/cdrom /mntmount:

AGG第四十二课 Blitting an image over another with transparency

问题: I've managed to blit a loaded image onto another through the method "copy_from(...)" of renderer_base. I'd like to know how can i blit the same image and also specifying a color that will NOT overwrite the pixels of the destination image ( a

第四十课、前置操作符和后置操作符

一.i++和++i有没有区别? 1.现代编译器产品会对代码进行优化 2.优化使得最终二进制程序更加高效 3.优化后的二进制程序丢失了c/c++的原生语义 4.不可能从编译后的二进制程序还原c/c++程序 //由此可知,单行的i++和++i在汇编层的代码完全一样 int i = 0; 0123136E mov dword ptr [i],0 i++; 01231375 mov eax,dword ptr [i] 01231378 add eax,1 0123137B mov dword ptr [

第四十课:CSS3 transition详解

W3C中对transition是这样描述的:允许css的属性值在一定的时间内平滑的过渡,也就是说,以动画的效果改变css的属性值. transition主要包含4个属性值:transition-property:样式名:transition-duration:持续时间:transition-timing-function:缓动公式:transition-delay:延迟多长时间才触发.接下来我们来详细讲下这四个属性值. transition-property transition-propert

AGG第四十三课 例子image1从椭圆到矩形替换问题

I am basing my code on the images1 example and I have changed the image 'partner' shape from an ellipse to a rectangle. The partner rectangle comes out at X,Y and scales and rotates, but the top left-hand corner of the image is always stuck at (x,y)=

linux笔记 第四十课 mysql主从复制

1.MYSQL复制的基础概念 2.MYSQL复制的实现 3.MYSQL复制架构及双主模型演示 4.MYSQL复制监控/常见问题及解决方案 5.MariaDB  GTID及多源复制 6.MariaDB  GTID读写分离及mysql-proxy的使用 一.MySQL主从复制的基础知识 二.MySQL主从复制实现(以mariadb 5.5.36为例) 实验环境:主服务器(node1)172.16.100.7 从服务器(node2)172.168.100.8 软件:mariadb-5.5.36-lin

JAVA学习第四十课(常用对象API)- Map集合练习

一.LinkedHashMap集合 import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; public class Main { public static void main(String[] args) { HashMap<Integer, String> hm = new LinkedHashMap<Integer,Stri

python第四十课——构造函数

1.动态给对象添加属性: 在对象创建完毕后,单独为其添加需要的属性:可以理解为:私人定制 [注意]: 添加的属性只有此对象能够使用,别的对象如果用了,直接报错; 2.构造函数/构造方法/构造器: 格式:__init__(self,...): 作用: 1).创建对象 2).为对象的属性赋值 [注意]: 1).构造函数也是函数,同样没有函数重载之说, 也就意味着,如果在一个类中出现多个同名的构造函数,最后一个覆盖之前所有的 2).如果人为不显示的定义构造函数,那么系统会默认提供给类一个空参数的构造,