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 ...
随机推荐
- Servlet中init-param与context-param的区别
web.xml文件中Servlet中配置如下: <servlet> <servlet-name>loginServlet</servlet-name> <se ...
- Identity Server 4 原理和实战(完结)_建立Identity Server 4项目,Client Credentials 授权实例
创建项目 dotnet new -i IdentityServer4.Templates 多出来的这些模板 adminUI用来测试,想要用再生产环境,需要交钱 结合core的 Identity来使用 ...
- 【转】Win8 下 管理无线网络
Ref:http://windows.microsoft.com/zh-CN/windows-8/manage-wireless-network-profiles 管理无线网络配置文件 适用于 Win ...
- 网络编程-http连接-GET&POST
GetRequest package com.net.http; import java.io.BufferedReader; import java.io.IOException; import j ...
- [WIP]webpack入门
创建: 2019/04/09 安装 npm install --save-dev webpack # 最新版 npm install --save-dev webpack@<version&g ...
- SCUT - 114 - 作业之数学篇 - 杜教筛
https://scut.online/p/114 \(A(n)=\sum\limits_{i=1}^{n} \frac{lcm(i,n)}{gcd(i,n)}\) \(=\sum\limits_{i ...
- Two sum(给定一个无重复数组和目标值,查找数组中和为目标值的两个数,并输出其下标)
示例: nums = [1,2,5,7] target = [6] return [0,2] Python解决方案1: def twoSum(nums, target): ""&q ...
- DataGridView Index -1 does not have a value 错误
遇到一个非常奇怪的问题, 一个DataGridView在装载数据后, 无论点击Column还是Cell都会报如下错误: 查bing之后发现StackOverFlow都指向DataSource的问题. ...
- [Xcode 实际操作]二、视图与手势-(3)UIView视图的基本操作
目录:[Swift]Xcode实际操作 本文将实现视图的添加与删除,以及切换视图在父视图中的层次. import UIKit class ViewController: UIViewControlle ...
- 自定义socket 模拟B/S服务端
目录 通过什么实现连接? B/S 客户端与服务端交互过程 socket server端 python代码 (静态html反馈) socket server端 python代码 (动态html反馈) 小 ...