Cairo Drawing Model

Cairo是一个强力的2D绘图库.

Destination

是你最终绘图的目标, 可以是一系列Pixel或者绑定到SVG或PDF文件上.

Source

是实际在绘图时使用的图层, 可以是多种颜色也可以包含透明通道, 可以是某种模式或者由另一个Source(Surface)创建.

Mask

Mask是处于Source和Destination之间的图层, 包含遮罩效果. 当Source需要stamp到Destination上时, 需要根据Mask的属性来决定, 可能直接绘图, 也可能没有效果.

Path

在Mask层和Context中可能存在的, 类似绘图中的线.

Context

Context维护所有的绘图动作, 其中还包括一个destination, 一个sourece, 一个mask, 以及其他一些变量. 在做任意的绘图操作前都应该创建一个context. 例如:

cairo_surface_t *surface;
cairo_t *cr; surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 120, 120);
cr = cairo_create (surface);

Verbs

就是绘图的基本操作.

Stroke(行程)

类似于画笔, 一般是在mask层, 在source上面的图像经过mask层的遮罩, 映射到destination层时, 仅在画笔中的图像可以通过.

Fill

类似stroke, 就是在mask层挖洞, 可以让source层的图像映射到destination层.

其他一些操作都是api级别的, 了解了绘图模型就可以直接使用了. 需要的时候自行查找文档.

Cairo Drawing Model的更多相关文章

  1. Programming with gtkmm 3

      https://developer.gnome.org/gtkmm-tutorial/unstable/index.html.zh_CN 1. 序言 1.1. 本书 1.2. gtkmm 2. 安 ...

  2. 【IOS笔记】View Programming Guide for iOS -1

    原文:View Programming Guide for iOS View and Window Architecture Views and windows present your applic ...

  3. UIView 的粗浅解析

    The UIView class defines a rectangular area on the screen and the interfaces for managing the conten ...

  4. 图形变幻矩阵 Transforms

    https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d ...

  5. View Programming Guide for iOS_读书笔记[正在更新……]

    原文:View Programming Guide for iOS 1 Introduction 先熟悉一下基本概念. Window Windows do not have any visible c ...

  6. Core Animation Manages Your App’s Content

    Core Animation 是对现有图片的操作函数. https://developer.apple.com/library/content/documentation/Cocoa/Conceptu ...

  7. View Programming Guide for iOS ---- iOS 视图编程指南(二)---View and Window Architecture

    View and Window Architecture 视图和窗口架构 Views and windows present your application’s user interface and ...

  8. Flot Reference flot参考文档

    Consider a call to the plot function:下面是对绘图函数plot的调用: var plot = $.plot(placeholder, data, options) ...

  9. iOS视图更新与事件循环

    iOS使用的是事件循环+标志更新(视图)机制. The View Drawing Cycle The UIView class uses an on-demand drawing model for ...

随机推荐

  1. java命令行编译运行、打包jar

    过程:java文件→class文件→exe执行文件 --------------------------------------------- 一.编译:从.java生成.class   (1)ecl ...

  2. windows ping得通,连接不上网

    这是被电脑安装的软件拦截的现象,我们只需要使用.   netsh winsock reset   重启电脑即可

  3. vue.eslintrc.js常用配置

    vue.eslintrc.js module.exports = { root: true, env: { node: true }, extends: [ "plugin:vue/esse ...

  4. E20190402-hm

    porxy n. 代理服务器; 代表权; 代理人,代替物; 委托书; enroll  v. 招收; 注册; 登记; 加入; enrollment n. 注册; 登记; 入会;

  5. [題解]51nod_1515_明辨是非

    好久沒有話多了,是覺得有點浪費時間,今天考試和一中用的一樣的題,結果反而考得不好,不過Jackpei一句知恥而後勇點醒夢中人偷偷@Jackpei 就是這樣吧 還有我極度懷疑我的鍵帽打油了......我 ...

  6. AKOJ-2021-逆序对(归并,二分)

    链接:https://oj.ahstu.cc/JudgeOnline/problem.php?id=2021 题意: 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们 ...

  7. c/c++学习系列之内存对齐

    1.C++内存对齐规则 每个特定平台上的编译器都有自己的默认“对齐系数”(也叫对齐模数).程序员可以通过预编译命令#pragma pack(n),n=1,2,4,8,16来改变这一系数,其中的n就是你 ...

  8. php post提交超过1000个字段的时候服务器会截断多余部分

    采取将子字段转化为json的形式,合并多个字段于一个字段

  9. 如何连接MDB数据,并且获取相关的数据

    不说了直接上代码: try{ String str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + address + & ...

  10. myBatis-类型关联

    1.一对多 collection <resultMap id="deptsql" type="Dept"> <id column=" ...