<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-Quartz-Surfaces">
<refmeta>
<refentrytitle role="top_of_page">Quartz Surfaces</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Quartz Surfaces</refname>
<refpurpose>Rendering to Quartz surfaces</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>

<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>



#define             <link linkend="CAIRO-HAS-QUARTZ-SURFACE:CAPS">CAIRO_HAS_QUARTZ_SURFACE</link>
<link linkend="cairo-surface-t">cairo_surface_t</link>*    <link linkend="cairo-quartz-surface-create">cairo_quartz_surface_create</link>         (<link linkend="cairo-format-t">cairo_format_t</link> format,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);
<link linkend="cairo-surface-t">cairo_surface_t</link>*    <link linkend="cairo-quartz-surface-create-for-cg-context">cairo_quartz_surface_create_for_cg_context</link>
                                                        (<link linkend="CGContextRef">CGContextRef</link> cgContext,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);
<link linkend="CGContextRef">CGContextRef</link>        <link linkend="cairo-quartz-surface-get-cg-context">cairo_quartz_surface_get_cg_context</link> (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
</synopsis>
</refsynopsisdiv>









<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
The Quartz surface is used to render cairo graphics targeting the
Apple OS X Quartz rendering system.
</para>
</refsect1>

<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="CAIRO-HAS-QUARTZ-SURFACE:CAPS" role="macro"/>CAIRO_HAS_QUARTZ_SURFACE</title>
<indexterm><primary>CAIRO_HAS_QUARTZ_SURFACE</primary></indexterm><programlisting>#define CAIRO_HAS_QUARTZ_SURFACE 1
</programlisting>
<para>

</para></refsect2>
<refsect2>
<title><anchor id="cairo-quartz-surface-create" role="function" condition="since:1.4"/>cairo_quartz_surface_create ()</title>
<indexterm role="1.4"><primary>cairo_quartz_surface_create</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link>*    cairo_quartz_surface_create         (<link linkend="cairo-format-t">cairo_format_t</link> format,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);</programlisting>
<para>
Creates a Quartz surface backed by a CGBitmap.  The surface is
created using the Device RGB (or Device Gray, for A8) color space.
All Cairo operations, including those that require software
rendering, will succeed on this surface.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>format</parameter>&nbsp;:</term>
<listitem><simpara> format of pixels in the surface to create
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> width of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> height of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly created surface.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.4
</para></refsect2>
<refsect2>
<title><anchor id="cairo-quartz-surface-create-for-cg-context" role="function" condition="since:1.4"/>cairo_quartz_surface_create_for_cg_context ()</title>
<indexterm role="1.4"><primary>cairo_quartz_surface_create_for_cg_context</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link>*    cairo_quartz_surface_create_for_cg_context
                                                        (<link linkend="CGContextRef">CGContextRef</link> cgContext,
                                                         unsigned <link linkend="int">int</link> width,
                                                         unsigned <link linkend="int">int</link> height);</programlisting>
<para>
Creates a Quartz surface that wraps the given CGContext.  The
CGContext is assumed to be in the standard Cairo coordinate space
(that is, with the origin at the upper left and the Y axis
increasing downward).  If the CGContext is in the Quartz coordinate
space (with the origin at the bottom left), then it should be
flipped before this function is called.  The flip can be accomplished
using a translate and a scale; for example:
</para>
<para>
<informalexample><programlisting>
CGContextTranslateCTM (cgContext, 0.0, height);
CGContextScaleCTM (cgContext, 1.0, -1.0);
</programlisting></informalexample>
</para>
<para>
All Cairo operations are implemented in terms of Quartz operations,
as long as Quartz-compatible elements are used (such as Quartz fonts).</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>cgContext</parameter>&nbsp;:</term>
<listitem><simpara> the existing CGContext for which to create the surface
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&nbsp;:</term>
<listitem><simpara> width of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&nbsp;:</term>
<listitem><simpara> height of the surface, in pixels
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the newly created Cairo surface.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.4
</para></refsect2>
<refsect2>
<title><anchor id="cairo-quartz-surface-get-cg-context" role="function" condition="since:1.4"/>cairo_quartz_surface_get_cg_context ()</title>
<indexterm role="1.4"><primary>cairo_quartz_surface_get_cg_context</primary></indexterm><programlisting><link linkend="CGContextRef">CGContextRef</link>        cairo_quartz_surface_get_cg_context (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Returns the CGContextRef that the given Quartz surface is backed
by.</para>
<para>

</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter>&nbsp;:</term>
<listitem><simpara> the Cairo Quartz surface
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the CGContextRef for the given surface.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since  1.4
</para></refsect2>

</refsect1>



<refsect1>
<title>See Also</title>
<para>
<itemizedlist>
<listitem><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></listitem>
</itemizedlist>
</para>
</refsect1>


<refsect1><refsect2 /><refsect2 /></refsect1>
</refentry>
