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. 计算机网络自顶向下方法第3章-传输层 (Transport Layer).1

    3.1 概述和运输层服务 运输层协议为运行在不同主机上的应用进程之间提供了逻辑通信(logic communication)功能. 3.1.1 运输层和网络层的关系 网络层提供了主机之间的逻辑通信,而 ...

  2. MySQL--表操作1

    这是对自己学习燕十八老师mysql教程的总结,非常感谢燕十八老师. 依赖软件:mysql 系统环境:win 注:本次所有命令都是在命令行上执行 数据库的四大天王操作:增删改查 增删改查都是在对表进行操 ...

  3. git 创建分支并关联远程分支

    从master分支,重新拉取出一个新的分支,名字为dev,具体命令如下: 1. 切换到被copy的分支(master),从服务器拉取最新版本 $git checkout master $git pul ...

  4. vs 对网站和项目使用IIS Express 的64位版

  5. $.each(obj,function(index,value)遍历的学习

    JQuery遍历对象 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...

  6. LINK fatal error LNK1123 转换到COFF期间失败

    1>LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 全部重新生成: 0 已成功, 1 已失败, 0 已跳过 ==========解决方法如下 ...

  7. AKOJ-1265-输出二叉树

    链接:https://oj.ahstu.cc/JudgeOnline/problem.php?id=1265 题意: 我们知道二叉树的先序序列和中序序列或者是中序和后序能够唯一确定一颗二叉树.现在给一 ...

  8. 洛谷1005(dp)

    1.不要贪,缩小区间去dp就好. 2.预处理指数. 3.__int128可还行. #include <cstdio> #include <cctype> #include &l ...

  9. Codeforces Round #396 (Div. 2) E

    Mahmoud and Ehab live in a country with n cities numbered from 1 to n and connected by n - 1 undirec ...

  10. js操作表格

    js 操作table: insertRow(),deleteRow(),insertCell(),deleteCell()方法 表格有几行: var trCnt = table.rows.length ...