cairo (graphics)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
cairo
The cairo graphics library logo.
Developer(s) Carl Worth, Behdad Esfahbod
Stable release 1.10.2  (25 Dec 2010) [±]
Preview release [±]
Written in C
Operating system Cross-platform
Type Graphics library
License GNU Lesser General Public License version 2.1 (only) or Mozilla Public License 1.1
Website http://cairographics.org/

cairo is a software library used to provide a vector graphics-based, device-independent API for software developers. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration[1] when available.

Although written in C, there are bindings for using the cairo graphics library from many other programming languages, including C++, PHP, Factor, Haskell, Lua, Perl, Python, Ruby, Scheme, Smalltalk and several others.[2]

Cairo is free software. The majority of it is Dual licensed under the GNU Lesser General Public License and the Mozilla Public License, though some parts of it are licensed only under the GNU General Public License.

Contents

[edit] History

The cairo project was founded by Keith Packard and Carl Worth for use in the X Window System.[3] It was originally called Xr or Xr/Xc. The name was changed to emphasize the idea that it was a cross-platform library and not tied to the X server.[4] The name cairo was derived from the original name Xr, similar to the Greek letters chi and rho.[5]

[edit] Backends

Cairo supports output to a number of different backends, known as "surfaces" in its code. Backend support includes output to the X Window System, Win32 GDI, Mac OS X Quartz, the BeOS API, OS/2, OpenGL contexts (directly[6] and via glitz), local image buffers, PNG files, PDF, PostScript, DirectFB and SVG files. There are other backends in development targeting the graphics APIs OpenVG,[7] Qt,[8] Skia,[9] and Windows' Direct2D.[10]

[edit] Similar technologies

Cairo has been compared to similar technologies like WPF and GDI+ from Microsoft, Quartz 2D from Apple Inc, and Anti-Grain Geometry (AGG).[citation needed]

[edit] Notable usage

Cairo is popular in the open source community for providing cross-platform support for advanced 2D drawing.

  • GTK+, starting in 2005 with version 2.8, uses cairo to render the majority of its widgets.[11]
  • The Mono Project,[12] including Moonlight,[13] has been using cairo since very early in conception to power the backends of its GDI+ (libgdiplus) and System.Drawing namespaces.
  • The Mozilla project has made use of cairo in recent versions of its Gecko layout engine, used for rendering the graphical output of Mozilla products. Gecko 1.8, the layout engine for Mozilla Firefox 2.0 and SeaMonkey 1.0, used cairo to render SVG and <canvas> content. Gecko 1.9,[14] the release of Gecko that serves as the basis of Firefox 3, uses cairo as the graphics backend for rendering both web page content and the user interface (or "chrome").
  • The WebKit framework uses cairo for all rendering in the GTK+ port. Support has also been added for SVG and <canvas> content using cairo.
  • The Poppler library uses cairo to render PDF documents. Cairo enables the drawing of antialiased vector graphics and transparent objects.
  • The vector graphics application Inkscape uses the cairo library for its outline mode display, as well as for PDF and PostScript export since release 0.46.[15]
  • MorphOS 2.5 features a shared library implementation of cairo, which was available as stand-alone release for earlier MorphOS versions.
  • AmigaOS 4.1 supports a shared object library of cairo (libcairo.so) in its default installation.
  • FontForge switched to cairo for all rendering in mid-October 2008.
  • R can output plots in PDF, PostScript and SVG formats using cairo if available.
  • Gnuplot 4.4 now uses cairo for rendering PDF and PNG output.[16]
  • Internet Browser for PlayStation 3 uses cairo since system software update 4.10.

[edit] See also

[edit] References

  1. ^ "Cairo homepage". http://cairographics.org/. Retrieved 2010-10-30. 
  2. ^ Language bindings
  3. ^ "Xr: Cross-device Rendering for Vector Graphics". http://cworth.org/~cworth/papers/xr_ols2003/html/. Retrieved 2009-06-08. 
  4. ^ "Mailing list thread about the cairo name change". http://lists.cairographics.org/archives/cairo/2003-July/000192.html. Retrieved 2009-06-08. 
  5. ^ "Mailing list thread about the cairo name change". http://lists.freedesktop.org/archives/cairo/2003-July/000184.html. Retrieved 2006-12-02. 
  6. ^ Chris Wilson (2009-07-22). "New OpenGL backend merged". http://lists.cairographics.org/archives/cairo/2009-July/017713.html. Retrieved 2010-02-12. 
  7. ^ Øyvind Kolås (2008-01-24). "Announcing OpenVG backend". http://lists.freedesktop.org/archives/cairo/2008-January/012833.html. Retrieved 2010-02-12. 
  8. ^ Vladimir Vukićević (2008-05-06). "Well Isn’t That Qt". http://blog.vlad1.com/2008/05/06/well-isnt-that-qt/. Retrieved 2010-02-12. 
  9. ^ Chris Wilson (2009-08-31). "Cool Stuff". http://lists.cairographics.org/archives/cairo/2009-August/018052.html. Retrieved 2010-02-12. 
  10. ^ Bas Schouten (2009-11-22). "Direct2D: Hardware Rendering a Browser". http://www.basschouten.com/blog1.php/2009/11/22/direct2d-hardware-rendering-a-browser. Retrieved 2010-02-12. 
  11. ^ "GTK+ to Use Cairo Vector Engine". http://developers.slashdot.org/article.pl?sid=05/02/04/2021236. Retrieved 2009-12-27. 
  12. ^ "Mono - Drawing". http://www.mono-project.com/Drawing. Retrieved 2009-12-27. 
  13. ^ "Moonlight Notes". http://www.mono-project.com/MoonlightNotes#Rendering. Retrieved 2009-12-27. 
  14. ^ "Gecko 1.9 Roadmap". https://wiki.mozilla.org/Gecko_1.9_Roadmap#cairo_Graphics_Substrate. Retrieved 2009-12-27. 
  15. ^ "ReleaseNotes046". Inkscape Wiki. http://wiki.inkscape.org/wiki/index.php/ReleaseNotes046. Retrieved 2008-03-31. 
  16. ^ "Gnuplot version 4.4.0 announcement". Gnuplot homepage. http://www.gnuplot.info/announce.4.4.0. Retrieved 2011-02-22. 

[edit] External links


Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages