Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Gdk::Image Class Reference

A GdkImage C++ wrapper class. More...

#include <inti/gdk/image.h>

Inheritance diagram for Inti::Gdk::Image:

Inti::G::Object Inti::G::TypeInstance Inti::MemoryHandler Inti::ReferencedBase List of all members.

Public Member Functions

Constructors
Accessors
Methods

Static Public Member Functions

Protected Member Functions

Constructors

Detailed Description

A GdkImage C++ wrapper class.

The Image object represents an area for drawing graphics. It has now been superceded to a large extent by the much more flexible Gdk::Drawable RGB drawing methods.

An Image can be manipulated with get_pixel() and put_pixel(), or alternatively by changing the actual pixel data. Though manipulating the pixel data requires complicated code to cope with the different formats that may be used. To draw an Image in a Gdk::Window or Gdk::Pixmap use Gdk::Drawable::draw_image().


Constructor & Destructor Documentation

Inti::Gdk::Image::Image GdkImage *  image,
bool  reference = true
[explicit, protected]
 

Construct a new Image from an existing GdkImage.

Parameters:
image A pointer to a GdkImage.
reference Set false if the initial reference count is floating, set true if it's not.

The image can be a newly created GdkImage or an existing GdkImage. (see G::Object::Object).


Member Function Documentation

Pointer<Image> Inti::Gdk::Image::create ImageType  type,
const Visual visual,
int  width,
int  height
[static]
 

Creates a new image.

Parameters:
type The type of the image, one of IMAGE_NORMAL, IMAGE_SHARED and IMAGE_FASTEST.
visual The Visual to use for the image.
width The width of the image in pixels.
height The height of the image in pixels.
Returns:
A smart pointer to the new Image, or null if the image could not be created.

IMAGE_FASTEST is probably the best choice, since it will try creating an IMAGE_SHARED image first and if that fails it will then use IMAGE_NORMAL.

Colormap* Inti::Gdk::Image::get_colormap  )  const
 

Retrieves the colormap for a given image, if it exists.

Returns:
The colormap for the image.

An image will have a colormap if the drawable from which it was created has a colormap, or if a colormap was set explicitely with set_colormap().

unsigned int Inti::Gdk::Image::get_pixel int  x,
int  y
const
 

Gets a pixel value at a specified position in the image.

Parameters:
x The X coordinate of the pixel to get.
y The Y coordinate of the pixel to get.
Returns:
The pixel value at the given position.

void Inti::Gdk::Image::put_pixel int  x,
int  y,
unsigned int  pixel
 

Sets a pixel in the image to a given pixel value.

Parameters:
x The X coordinate of the pixel to set.
y The Y coordinate of the pixel to set.
pixel The pixel value to set.

void Inti::Gdk::Image::set_colormap Colormap colormap  ) 
 

Sets the colormap for the image to the given colormap.

Parameters:
colormap A Colormap.

Normally there's no need to use this method, 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.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:11 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002