<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gdkimage">
  <refnamediv>
    <refname>gtk.gdk.Image</refname>
    <refpurpose>an area for bit-mapped graphics stored on the X Windows
client.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.gdk.Image</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gdkimage">gtk.gdk.Image</link></methodname>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">visual</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkimage--put-pixel">put_pixel</link></methodname>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">pixel</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkimage--get-pixel">get_pixel</link></methodname>
	<methodparam><parameter role="keyword">x</parameter></methodparam>
	<methodparam><parameter role="keyword">y</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkimage--set-colormap">set_colormap</link></methodname>
	<methodparam><parameter
		       role="keyword">colormap</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkimage--get-colormap">get_colormap</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gdkimage">gtk.gdk.Image</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>The <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link> type
represents an area for drawing graphics. It has now been superseded to a
large extent by the much more flexible RGB methods (see <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>).</para>

  </refsect1>

  <refsect1 id="constructor-gdkimage">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.gdk.Image</methodname>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">visual</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">type</parameter>&nbsp;:</term>
	<listitem><simpara>a <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
type</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">visual</parameter>&nbsp;:</term>
	<listitem><simpara>a <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link></simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">width</parameter>&nbsp;:</term>
	<listitem><simpara>the width in pixels of the
image</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">height</parameter>&nbsp;:</term>
	<listitem><simpara>the height in pixels of the
image</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a new <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
object</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link> object
of the specified <parameter>type</parameter>, <parameter>width</parameter>
and <parameter>height</parameter> and using the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
specified by <parameter>visual</parameter>. The value of
<parameter>type</parameter> must be one of:</para>

    <variablelist>
      <varlistentry>
	<term><literal>gtk.gdk.IMAGE_NORMAL</literal></term>
	<listitem>
	  <simpara>The original X image type, which is quite slow since the
image has to be transferred from the client to the server to display
it.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.IMAGE_SHARED</literal></term>
	<listitem>
	  <simpara>A faster image type, which uses shared memory to transfer
the image data between client and server. However this will only be
available if client and server are on the same machine and the shared memory
extension is supported by the server.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.IMAGE_FASTEST</literal></term>
	<listitem>
	  <simpara>Specifies that gtk.gdk.IMAGE_SHARED should be tried
first, and if that fails then gtk.gdk.IMAGE_NORMAL will be used.</simpara>
	</listitem>
      </varlistentry>
    </variablelist>

    <para>Usually using <literal>gtk.gdk.IMAGE_FASTEST</literal> is the best
choice.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gdkimage--put-pixel">
      <title>gtk.gdk.Image.put_pixel</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>put_pixel</methodname>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">pixel</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the x coordinate of the pixel to
set.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the y coordinate of the pixel to
set.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">pixel</parameter>&nbsp;:</term>
	  <listitem><simpara>the pixel value to set.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>put_pixel</methodname>() method sets the value
of the pixel in the image at the location specified by
<parameter>x</parameter> and <parameter>y</parameter> to the value specified
by <parameter>pixel</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkimage--get-pixel">
      <title>gtk.gdk.Image.get_pixel</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_pixel</methodname>
	  <methodparam><parameter role="keyword">x</parameter></methodparam>
	  <methodparam><parameter role="keyword">y</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">x</parameter>&nbsp;:</term>
	  <listitem><simpara>the x coordinate of the pixel to
get.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y</parameter>&nbsp;:</term>
	  <listitem><simpara>the y coordinate of the pixel to
get.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the pixel value at the image
location</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_pixel</methodname>() method returns the
value of the pixel at the image location specified by
<parameter>x</parameter> and <parameter>y</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkimage--set-colormap">
      <title>gtk.gdk.Image.set_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>set_colormap</methodname>
	  <methodparam><parameter
			 role="keyword">colormap</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">colormap</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>set_colormap</methodname>() method sets the
colormap for the image to the specified <parameter>colormap</parameter>.
Normally there's no need to use this method since images are created with
the correct colormap if you get the image from a drawable. If you create the
image from scratch, use the colormap of the drawable you intend to render
the image to.</para>

    </refsect2>

    <refsect2 id="method-gdkimage--get-colormap">
      <title>gtk.gdk.Image.get_colormap</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_colormap</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the colormap for the image</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_colormap</methodname>() method returns the
colormap for a given image, if it exists. An image will have a colormap if
the drawable from which it was created has a colormap, or if a colormap was
set explicitly with the <link
linkend="method-gdkimage--set-colormap"><methodname>set_colormap</methodname>()</link> 
method.</para>

    </refsect2>

  </refsect1>

</refentry>
