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 ...
随机推荐
- MR 图像分割 相关论文摘要整理
<多分辨率水平集算法的乳腺MR图像分割> 针对乳腺 MR 图像信息量大.灰度不均匀.边界模糊.难分割的特点, 提出一种多分辨率水平集乳腺 MR图像分割算法. 算法的核心是首先利用小波多尺度 ...
- Java的多线程创建方法
1. 直接使用Thread来创建 package com.test.tt; public class ThreadEx extends Thread{ private int j; public vo ...
- RXSwift01
//创建 Observable 序列 func createObservable(){ /* let observable = Observable<Int>.just(5) let ob ...
- 632. Smallest Range(priority_queue)
You have k lists of sorted integers in ascending order. Find the smallest range that includes at lea ...
- HDU4801【DFS】
参考:大牛博客 题意: 给你一个2阶魔方,给你24个数代表颜色,然后让你求在<=n次操作里面最多能搞出几面是一样的. 思路: 就是一个DFS嘛,就是怎么转搞出来: 上面: 22 23 4 0 ...
- Codevs 1282 约瑟夫问题
1282 约瑟夫问题 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 大师 Master 题解 题目描述 Description 有编号从1到N的N个小朋友在玩一种 ...
- [Xcode 实际操作]三、视图控制器-(3)使用UINavigationController视图控制器
目录:[Swift]Xcode实际操作 本文将演示导航视图控制器的使用. 选择项目导航区的资源文件夹.需要导入两张图片,作为选项卡控制器的图标. [+]->[Import]->选择图片-& ...
- JPA_day01
- SpringBoot | 查看默认版本配置
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot ...
- Linux | C代码的编写、运行和调试
1. 建立.c文件 在终端下输入:vi mytest.c [使用编辑器 vim] 键入键盘i键,使vi编辑器进入编辑模式 接下来在vi编译器中编写代码,如: #include <stdio.h ...