Cairo Drawing Model
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的更多相关文章
- Programming with gtkmm 3
https://developer.gnome.org/gtkmm-tutorial/unstable/index.html.zh_CN 1. 序言 1.1. 本书 1.2. gtkmm 2. 安 ...
- 【IOS笔记】View Programming Guide for iOS -1
原文:View Programming Guide for iOS View and Window Architecture Views and windows present your applic ...
- UIView 的粗浅解析
The UIView class defines a rectangular area on the screen and the interfaces for managing the conten ...
- 图形变幻矩阵 Transforms
https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d ...
- View Programming Guide for iOS_读书笔记[正在更新……]
原文:View Programming Guide for iOS 1 Introduction 先熟悉一下基本概念. Window Windows do not have any visible c ...
- Core Animation Manages Your App’s Content
Core Animation 是对现有图片的操作函数. https://developer.apple.com/library/content/documentation/Cocoa/Conceptu ...
- View Programming Guide for iOS ---- iOS 视图编程指南(二)---View and Window Architecture
View and Window Architecture 视图和窗口架构 Views and windows present your application’s user interface and ...
- Flot Reference flot参考文档
Consider a call to the plot function:下面是对绘图函数plot的调用: var plot = $.plot(placeholder, data, options) ...
- iOS视图更新与事件循环
iOS使用的是事件循环+标志更新(视图)机制. The View Drawing Cycle The UIView class uses an on-demand drawing model for ...
随机推荐
- Lua 5.1.1 源代码阅读笔记
http://blog.csdn.net/hamenny/article/details/4506130
- SQL2005恢复只有mdf文件的数据库
我把原来的数据库分离后,直接把日志文件给干掉了.原来在SQL 2000里经常这么干,只用一个mdf就附加了.没想到sql2005居然不行.我试验了一圈 终于找到一个成功的方法.转载,供后来者参考. S ...
- Atom 基本使用
插件 simplified-Chinese-menu:汉化 Markdown-preview-plus:Markdown 实时预览 Atom 自带 Markdown-preview,这个插件是其增强版 ...
- python-codecs.open()使用举例
代码: import codecs from unidecode import unidecode def main(): fullFilename="123.txt" inFID ...
- 洛谷 - P1582 - 倒水 - 位运算
https://www.luogu.org/problemnew/show/P1582 要求用最少的瓶子,那肯定不能有两个一样的瓶子,否则合并更优. 枚举其二进制位,每次加上lowbit,将最后一个1 ...
- atcoder#073D(枚舉)
題目鏈接: http://arc073.contest.atcoder.jp/tasks/arc073_b 題意: 給出n, m兩個數, n是物品數目, m是背包容量, 接下來n行輸入, wi, vi ...
- CF939D Love Rescue
题意 给定两个长度为n的由小写字母组成的字符串 每次可以花费1的代价,指定两个字母,把其中一个全部变为另一个 求使两个字符串相同的最小花费 n <= 100000 因为谁变成谁没有关系反正相等就 ...
- 解决element 照片墙上传时回显问题
1.先看看样式: <el-upload class="imgList" action="1165165" list-type="picture- ...
- springboot与shiro和mybatis和mysql
测试项目已上传到GitHub:https://github.com/xiaostudy/springboot_shiro_test1 1.创建springboot项目 <!-- 数据库连接池 - ...
- JDK1.7 和 jetty配置教程
系统是windows 7 64位版本,32位版本同理,xp系统的自己google设置环境变量 打开设置环境变量窗口,右键计算机->我的电脑,选择属性 点击高级系统设置 选择环境变量 红线为需要设 ...