Blob Blame History Raw
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Chapter 4. Textures</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="The Clutter Cookbook"><link rel="up" href="index.html" title="The Clutter Cookbook"><link rel="prev" href="events-buttons.html" title="5. Making an actor respond to button events"><link rel="next" href="textures-drawing-with-cairo.html" title="2. Drawing 2D graphics onto a texture"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Textures</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="events-buttons.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="textures-drawing-with-cairo.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="textures"></a>Chapter 4. Textures</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="textures.html#textures-introduction">1. Introduction</a></span></dt><dt><span class="section"><a href="textures-drawing-with-cairo.html">2. Drawing 2D graphics onto a texture</a></span></dt><dd><dl><dt><span class="section"><a href="textures-drawing-with-cairo.html#idm140200511719056">2.1. Problem</a></span></dt><dt><span class="section"><a href="textures-drawing-with-cairo.html#idm140200513630672">2.2. Solution</a></span></dt><dt><span class="section"><a href="textures-drawing-with-cairo.html#idm140200510420608">2.3. Discussion</a></span></dt></dl></dd><dt><span class="section"><a href="textures-aspect-ratio.html">3. Maintaining the aspect ratio when loading an
    image into a texture</a></span></dt><dd><dl><dt><span class="section"><a href="textures-aspect-ratio.html#idm140200511534096">3.1. Problem</a></span></dt><dt><span class="section"><a href="textures-aspect-ratio.html#idm140200511532656">3.2. Solution</a></span></dt><dt><span class="section"><a href="textures-aspect-ratio.html#idm140200511528336">3.3. Discussion</a></span></dt></dl></dd><dt><span class="section"><a href="textures-image-loading.html">4. Loading image data into a texture</a></span></dt><dd><dl><dt><span class="section"><a href="textures-image-loading.html#idm140200512132272">4.1. Problem</a></span></dt><dt><span class="section"><a href="textures-image-loading.html#idm140200512130960">4.2. Solution</a></span></dt><dt><span class="section"><a href="textures-image-loading.html#idm140200508163424">4.3. Discussion</a></span></dt></dl></dd><dt><span class="section"><a href="textures-sub-textures.html">5. Creating sub-textures from an existing texture</a></span></dt><dd><dl><dt><span class="section"><a href="textures-sub-textures.html#idm140200508139056">5.1. Problem</a></span></dt><dt><span class="section"><a href="textures-sub-textures.html#idm140200508137280">5.2. Solution</a></span></dt><dt><span class="section"><a href="textures-sub-textures.html#idm140200508128432">5.3. Discussion</a></span></dt><dt><span class="section"><a href="textures-sub-textures.html#idm140200508122256">5.4. Full example</a></span></dt><dt><span class="section"><a href="textures-sub-textures.html#idm140200508116304">5.5. Going further</a></span></dt></dl></dd><dt><span class="section"><a href="textures-reflection.html">6. Creating a reflection of a texture</a></span></dt><dd><dl><dt><span class="section"><a href="textures-reflection.html#idm140200508101264">6.1. Problem</a></span></dt><dt><span class="section"><a href="textures-reflection.html#idm140200508099360">6.2. Solution</a></span></dt><dt><span class="section"><a href="textures-reflection.html#idm140200508091392">6.3. Discussion</a></span></dt><dt><span class="section"><a href="textures-reflection.html#idm140200508076160">6.4. Full example</a></span></dt></dl></dd><dt><span class="section"><a href="textures-crossfade.html">7. Cross-fading between two images</a></span></dt><dd><dl><dt><span class="section"><a href="textures-crossfade.html#idm140200508067360">7.1. Problem</a></span></dt><dt><span class="section"><a href="textures-crossfade.html#idm140200508065344">7.2. Solutions</a></span></dt><dt><span class="section"><a href="textures-crossfade.html#textures-crossfade-discussion">7.3. Discussion</a></span></dt><dt><span class="section"><a href="textures-crossfade.html#idm140200507973056">7.4. Full examples</a></span></dt></dl></dd></dl></div><div class="epigraph"><p>A rock pile ceases to be a rock pile the moment a single man
    contemplates it, bearing within him the image of a cathedral.</p><div class="attribution"><span>—<span class="attribution">Antoine de Saint-Exupery</span></span></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="textures-introduction"></a>1. Introduction</h2></div></div></div><p>Textures are one of the most important actors in Clutter. Whether
    they are employed as the background for a user interface control, or
    to show the picture of a kitten, a big part of any Clutter-based
    application is going to involve textures.</p><p>A ClutterTexture is an actor that can hold any raw image data and
    paint it. ClutterTexture can also load image data from a file on disk and
    convert it.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The actual formats supported by ClutterTexture depend on the
    platform on which Clutter is being used.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="events-buttons.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="textures-drawing-with-cairo.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5. Making an actor respond to button events </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 2. Drawing 2D graphics onto a texture</td></tr></table></div></body></html>