Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
Cairo (graphics)

Cairo (graphics)

Overview
Cairo is a software library used to provide a vector graphics
Vector graphics
Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon, which are all based on mathematical equations, to represent images in computer graphics....

-based, device-independent API
Application programming interface
An application programming interface is an interface in computer science that defines the ways by which an application program may request services from libraries and/or operating systems. An API determines the vocabulary and calling conventions the programmer should employ to use the services...

 for software developer
Software developer
A software developer is a person or organization concerned with facets of the software development process wider than design and coding, a somewhat broader scope of computer programming or a specialty of project managing including some aspects of software product management...

s. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration
Hardware acceleration
In computing, hardware acceleration is the use of hardware to perform some function faster than is possible in software running on the general purpose CPU...

 when available.

Although written in C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, there are bindings
Language binding
In computing, a binding from a language to a library or OS service is an API providing that service in the language.Many software libraries are written in systems programming languages such as C or C++...

 for using the cairo graphics library from many other programming languages, including Factor, Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry.- History :...

, Lua, Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall, a linguist working as a systems administrator for NASA, in 1987, as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone...

, Python
Python (programming language)
Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

, Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto...

, Scheme, Smalltalk
Smalltalk
Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." It was designed and created in part for educational use, more so for constructionist...

 and several others.
Discussion
Ask a question about 'Cairo (graphics)'
Start a new discussion about 'Cairo (graphics)'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
Cairo is a software library used to provide a vector graphics
Vector graphics
Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon, which are all based on mathematical equations, to represent images in computer graphics....

-based, device-independent API
Application programming interface
An application programming interface is an interface in computer science that defines the ways by which an application program may request services from libraries and/or operating systems. An API determines the vocabulary and calling conventions the programmer should employ to use the services...

 for software developer
Software developer
A software developer is a person or organization concerned with facets of the software development process wider than design and coding, a somewhat broader scope of computer programming or a specialty of project managing including some aspects of software product management...

s. It is designed to provide primitives for 2-dimensional drawing across a number of different backends. Cairo is designed to use hardware acceleration
Hardware acceleration
In computing, hardware acceleration is the use of hardware to perform some function faster than is possible in software running on the general purpose CPU...

 when available.

Although written in C
C (programming language)
C is a general-purpose computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, there are bindings
Language binding
In computing, a binding from a language to a library or OS service is an API providing that service in the language.Many software libraries are written in systems programming languages such as C or C++...

 for using the cairo graphics library from many other programming languages, including Factor, Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry.- History :...

, Lua, Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall, a linguist working as a systems administrator for NASA, in 1987, as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone...

, Python
Python (programming language)
Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

, Ruby
Ruby (programming language)
Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was initially developed and designed by Yukihiro "Matz" Matsumoto...

, Scheme, Smalltalk
Smalltalk
Smalltalk is an object-oriented, dynamically typed, reflective programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human–computer symbiosis." It was designed and created in part for educational use, more so for constructionist...

 and several others. Dual license
Dual license
Multi-licensing is the practice of distributing software under two different sets of terms and conditions. This may mean two different licenses, or two different sets of licenses...

d under the GNU Lesser General Public License
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT License...

 and the Mozilla Public License
Mozilla Public License
The Mozilla Public License is a free and open source software license. Version 1.0 was developed by Mitchell Baker when she worked as a lawyer at Netscape Communications Corporation and version 1.1 at the Mozilla Foundation...

, cairo is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also...

.

History


The cairo project was founded by Keith Packard
Keith Packard
Keith Packard is a software developer, best known for his work on the X Window System.Packard is responsible for many X extensions and technical papers on X...

 and Carl Worth for use in the X Window System
X Window System
The X Window System is a computer software system and network protocol that provides a graphical user interface for networked computers, and was initially developed as part of Project Athena...

. 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. The name cairo was derived from the original name Xr, similar to the Greek letters chi
Chi (letter)
Chi is the 22nd letter of the Greek alphabet, pronounced as [kai] in English. Its value in Ancient Greek was an aspirated velar stop ....

 and rho
Rho (letter)
Rho is the 17th letter of the Greek alphabet. In the system of Greek numerals it has a value of 100. It is derived from Semitic Rêš "head" . Its uppercase form is not to be confused with the Roman letter P, however both are typeset using the same glyph.The letter Rho has religious significance...

.

Backends


Cairo supports output to a number of different backends. Backend support includes output to the X Window System
X Window System
The X Window System is a computer software system and network protocol that provides a graphical user interface for networked computers, and was initially developed as part of Project Athena...

, Win32 GDI
Graphics Device Interface
The Graphics Device Interface is a Microsoft Windows application programming interface and core operating system component responsible for representing graphical objects and transmitting them to output devices such as monitors and printers....

, Mac OS X Quartz
Quartz (graphics layer)
Quartz specifically refers to a pair of Mac OS X technologies, each part of the Core Graphics framework: Quartz 2D and Quartz Compositor. It includes both a 2D renderer in Core Graphics and the composition engine that sends instructions to the graphics card...

, the BeOS
BeOS
BeOS was an operating system for personal computers which began development by Be Inc. in 1991. It was first written to run on BeBox hardware. BeOS was optimized for digital media work and was written to take advantage of modern hardware facilities such as symmetric multiprocessing by utilizing...

 API, OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

, OpenGL
OpenGL
OpenGL is a standard specification defining a cross-language, cross-platform API for writing applications that produce 2D and 3D computer graphics. The interface consists of over 250 different function calls which can be used to draw complex three-dimensional scenes from simple primitives. OpenGL...

 contexts (via glitz
Glitz (software)
Glitz is a software library for 2D graphics which provides hardware acceleration using OpenGL, an API for 3D graphics. Glitz is open-source software, licensed under the MIT License...

), local image buffers, PNG files, PDF
Portable Document Format
Portable Document Format is a file format created by Adobe Systems in 1993 for document exchange. PDF is used for representing two-dimensional documents in a manner independent of the application software, hardware, and operating system....

, PostScript
PostScript
PostScript is a dynamically typed concatenative programming language created by John Warnock and Charles Geschke in 1982. PostScript is best known for its use as a page description language in the electronic and desktop publishing areas....

, DirectFB
DirectFB
DirectFB stands for Direct Frame Buffer. It is a software library for the GNU/Linux operating system that provides "hardware graphics acceleration, input device handling and abstraction, integrated windowing system with support for translucent windows and multiple display layers on top of the Linux...

 and SVG
Scalable Vector Graphics
Scalable Vector Graphics is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both static and dynamic Scalable Vector Graphics (SVG) is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both...

 files.

Similar technologies


Cairo has been compared to similar technologies like WPF
Windows Presentation Foundation
The Windows Presentation Foundation is a graphical subsystem for rendering user interfaces in Windows-based applications. WPF was initially released as part of .NET Framework 3.0...

 and GDI+
Graphics Device Interface
The Graphics Device Interface is a Microsoft Windows application programming interface and core operating system component responsible for representing graphical objects and transmitting them to output devices such as monitors and printers....

 from Microsoft
Microsoft
Microsoft Corporation is a multinational computer technology corporation that develops, manufactures, licenses, and supports a wide range of software products for computing devices...

, Quartz 2D
Quartz 2D
Quartz 2D is the primary two-dimensional graphics rendering API for Mac OS X, part of the Core Graphics framework.-Overview:Quartz 2D is available to all Mac OS X application environments, and provides resolution-independent and device-independent rendering of bitmap graphics, text, and vectors...

 from Apple Inc, and Anti-Grain Geometry
Anti-Grain Geometry
Anti-Grain Geometry is a high-quality 2D rendering library written in C++. It features anti-aliasing and sub-pixel resolution.The library is operating system independent and renders to an abstract memory object. It comes with examples interfaced to the X Window System, Microsoft Windows, Mac OS X,...

 (AGG).

Notable usage


Cairo is popular in the open source community for providing cross-platform support for advanced 2D drawing.
  • GTK+
    GTK+
    GTK+ is a cross-platform widget toolkit for creating graphical user interfaces. It is one of the most popular toolkits for the X Window System, along with Qt....

    , starting in 2005 with version 2.8, uses cairo to render the majority of its widget
    Widget (computing)
    In computer programming, a widget is an element of a graphical user interface that displays an information arrangement changeable by the user, such as a window or a text box. The defining characteristic of a widget is to provide a single interaction point for the direct manipulation of a given...

    s.
  • The Mono Project
    Mono (software)
    Mono is a free and open source project led by Novell to create an Ecma standard compliant, .NET-compatible set of tools, including among others a C# compiler and a Common Language Runtime...

    , including Moonlight
    Moonlight (runtime)
    Moonlight is a free and open source implementation of the Silverlight web application framework. Silverlight was originally developed by Microsoft. Moonlight is being developed by the Mono Project...

    , has been using cairo since very early in conception, to power its backends of its GDI+ (libgdiplus) and System.Drawing namespaces
    Namespace (computer science)
    A namespace is an abstract container or environment created to hold a logical grouping of unique identifiers or symbols . An identifier defined in a namespace is associated with that namespace. The same identifier can be independently defined in multiple namespaces...

    .
  • The Mozilla
    Mozilla
    Mozilla is a term used in a number of ways in relation to the now-defunct Netscape Communications Corporation and its related application software, including the Mozilla.org group and its successor the Mozilla Foundation....

     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
    SeaMonkey
    SeaMonkey is a free and open source cross-platform Internet suite. It is the continuation of the former Mozilla Application Suite, based on the same source code...

     1.0, used cairo to render SVG and
    Canvas (HTML element)
    The canvas element is part of HTML 5 and allows for dynamic scriptable rendering of bitmap images.It was initially introduced by Apple for use inside their own Mac OS X WebKit component, powering applications like Dashboard widgets and the Safari browser...

     content. Gecko 1.9, 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
    User interface
    The user interface is the aggregate of means by which people—the users—interact with the system—a particular machine, device, computer program or other complex tool...

     (or "chrome
    XUL
    In computer programming, XUL , the XML User Interface Language, is an XML user interface markup language which operates in Mozilla cross-platform applications such as Firefox and Flock...

    ").
  • The WebKit
    WebKit
    WebKit is a layout engine designed to allow web browsers to render web pages. The WebKit engine provides a set of classes to display web content in windows, and implements browser features such as following links when clicked by the user, managing a back-forward list, and managing a history of...

     framework uses cairo for all rendering in the GTK+
    GTK+
    GTK+ is a cross-platform widget toolkit for creating graphical user interfaces. It is one of the most popular toolkits for the X Window System, along with Qt....

     port. Support has also been added for SVG and content using cairo.
  • The Poppler
    Poppler (software)
    In computing, Poppler, a software library, renders PDF documents. freedesktop.org makes Poppler available under version 2.0 of the GNU General Public License as free software...

     library uses cairo to render PDF documents. Cairo enables the drawing of antialiased vector graphics and transparent objects.
  • The Shoes windowing toolkit for Ruby uses cairo for 2D drawing.
  • The ShoeBot Python-based drawing robot uses cairo for 2D drawing.
  • The latest version of the vector graphics application Inkscape
    Inkscape
    Inkscape is a vector graphics editor application. It is distributed under a free software license, the GNU GPL. Its stated goal is to become a powerful graphics tool while being fully compliant with the XML, SVG, and CSS standards....

     (version 0.46), uses the cairo library for its outline mode display, as well as for PDF
    Portable Document Format
    Portable Document Format is a file format created by Adobe Systems in 1993 for document exchange. PDF is used for representing two-dimensional documents in a manner independent of the application software, hardware, and operating system....

     and PostScript
    PostScript
    PostScript is a dynamically typed concatenative programming language created by John Warnock and Charles Geschke in 1982. PostScript is best known for its use as a page description language in the electronic and desktop publishing areas....

     export.
  • AmigaOS
    AmigaOS
    AmigaOS is the default native operating system of the Amiga personal computer. It was developed first by Commodore International, and initially introduced in 1985 with the Amiga 1000...

     4.1 developers based the new Workbench
    Workbench (AmigaOS)
    -Overview:With the Amiga computer, the name Workbench refers to the native graphical interface file manager and application launcher of the Amiga Operating System typically presented to users upon booting the Amiga...

     GUI upon cairo libraries. This means that this operating system has actually a complete vector based GUI, and due to its internal implements 3D hardware accelerated Porter-Duff composition engine
    Alpha compositing
    In computer graphics, alpha compositing is the process of combining an image with a background to create the appearance of partial transparency. It is often useful to render image elements in separate passes, and then combine the resulting multiple 2D images into a single, final image in a process...

     can perform effects like instant zooming of entire GUI screen.
  • FontForge
    FontForge
    FontForge is a typeface editor program developed by George Williams. Fontforge is free software and is distributed under the BSD license...

    switched to cairo for all rendering since the middle of October 2008.