For faster navigation, this Iframe is preloading the Wikiwand page for Cairo.

Cairo

cairo
原作者基思·帕卡德、卡尔·沃思[1]
开发者卡尔·沃思、贝赫达德·埃斯法赫博德
当前版本
  • 1.18.0 (2023年9月23日;稳定版本)[2]
编辑维基数据链接
原始码库 编辑维基数据链接
编程语言C语言
操作系统跨平台
类型图形库
许可协议GNU宽通用公共许可证版本2.1或是Mozilla公共许可证版本1.1
网站www.cairographics.org/ 编辑维基数据

Cairo是一个用于提供矢量图形绘图的自由函式库,Cairo提供在多个背景下做二维空间的绘图,高级的更可以使用硬件加速功能[3]。虽然Cairo是使用C语言撰写的,但是当使用cairo时,可以用许多其他种语言来使用,包括有C++C#JavaPythonPerlRubySchemeSmalltalk以及许多种语言[4],cairo在GNU宽通用公共许可证Mozilla公共许可证两种许可协议下发行。

后端

Cairo支持很多不同后端的输出,在实现中被称作“surface”。支持的后端包括X Window系统、Win32 GDIQuartz CompositorOS/2OpenGL环境(直接或间接地通过glitz英语glitz)、内存缓冲区、PNGPDFPostScriptDirectFBSVG文件。

还有一些开发中的后端如:OpenVGQtSkia和Windows Direct2D[5]

知名应用

因为能够提供高级的跨平台2D绘图的支持,cairo在开源社区十分流行。

  • GTK+从2005年的2.8版开始,使用cairo去渲染它的大多数控件,从GTK+ 3开始,所有的渲染任务由cairo完成。
  • Mono项目,包括Moonlight,在很早便设想用cairo作为后端驱动GDI+(libgdiplus)和 System.Drawing命名空间。
  • Mozilla项目在最近版本的Gecko排版引擎中使用cairo,用来渲染生成的图形输出。
    • Gecko 1.8,Firefox 2.0和SeaMonkey 1.0的排版引擎,使用cairo渲染SVG和<canvas>内容。
    • Gecko 1.9,作为Firefox 3底层使用cairo对网页内容和用户界面进行渲染。
  • Poppler库使用cairo渲染PDF文档. cairo使得对反锯齿矢量图形和透明物件的绘制成为可能。
  • 矢量绘图应用程式Inkscape使用cairo图形库显示其概要模式,以及自从0.46正式版使用它输出PDF和PostScript文档。
  • FontForge在2008年10月中旬启用cairo为默其认渲染图形库。
  • R语言经cairo用PDF,PostScript和SVG格式输出图像。
  • Gnuplot 4.4现在使用cairo来渲染PDF和PNG输出。

历史

基思·帕卡德和卡尔·沃思为在X Window系统使用创立了cairo项目[6]。它原本(直到2003年)被称做Xr或Xr/Xc。为了加强跨平台而非被局限在X Window平台绘图的印象,项目更换了名称。Xr经被解释为希腊字母chirho派生出新名称cairo。

相似的技术

Cairo大抵相似于微软WPFGDI+苹果公司Quartz 2DAnti-Grain Geometry英语Anti-Grain Geometry(AGG)。

相关条目

参考资料

  1. ^ Carl's boring web pages. cworth.org. 2013 [11 July 2014]. (原始内容存档于2014-05-17). 
  2. ^ cairo-1.18.0. 2023年9月23日 [2023年9月24日]. 
  3. ^ Cairo homepage. [2010-10-30]. (原始内容存档于2011-02-23). 
  4. ^ Cairo Language Bindings. [2014-04-16]. (原始内容存档于2011-05-17). 
  5. ^ Bas Schouten. Direct2D: Hardware Rendering a Browser. 2009-11-22 [2010-02-12]. (原始内容存档于2010-02-10). 
  6. ^ Xr: Cross-device Rendering for Vector Graphics. [2009-06-08]. (原始内容存档于2009-06-14). 

外部链接

{{bottomLinkPreText}} {{bottomLinkText}}
Cairo
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?