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 ...
随机推荐
- CF-831C
C. Jury Marks time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...
- python数据分析笔记中panda(1)
1 例子1 from pandas import read_csv; df = read_csv('H://pythonCode//4.1//1.csv') df 截图 1.1 修改表的内容编码 df ...
- Flutter实战视频-移动电商-22.JSON解析和复杂数据模型转换技巧
22.JSON解析和复杂数据模型转换技巧 json转Model类 创建model文件夹,在里面新建category.dart类 主要根据这个json来分析我们要做成类的样子 { ", &qu ...
- 3-1Java程序的执行流程
3-1Java程序的执行流程 用记事本写一个简单的程序 存到:E:\java路径下 class HelloImooc{ public static void main(String[] agrg ...
- UVa 12333 Revenge of Fibonacci (字典树+大数)
题意:给定一个长度小于40的序列,问你那是Fib数列的哪一项的前缀. 析:首先用大数把Fib数列的前100000-1项算出来,注意,一定不能是100000,要不然会WA的,然后每个数取前40位,不足4 ...
- ASP.NET Response.Cookies
//设置cookie Response.Cookies["loginPage"].Value = "login.aspx"; //命名并给值 Response. ...
- MS SQL server对象类型type
执行下面代码,将获取ms sql server对象类型以及其说明 IF OBJECT_ID('tempdb.dbo.#type') IS NOT NULL DROP TABLE #type CREAT ...
- Git之忽略提交 .gitignore
1.touch .gitignore 创建忽略文件,若此文件已存在,请忽略这一步 2.vi .gitignore 编辑忽略文件,将需要忽略的文件添加到忽略文件中 3.git status 发现忽 ...
- hexo新建md文档推送到blog出错
1. git错误提示 $ hexo g INFO Start processing FATAL Something's wrong. Maybe you can find the solution h ...
- 535. Encode and Decode TinyURL(rand and srand)
Note: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL sho ...