gtkmm: Gdk::Image Class Reference

gtkmm 2.24.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::Image Class Reference

This represents an area for drawing graphics. More...

Inheritance diagram for Gdk::Image:
[legend]
Collaboration diagram for Gdk::Image:
[legend]

## Public Member Functions
virtual | ~Image ()
GdkImage* | gobj ()
| Provides access to the underlying C GObject. More...
const GdkImage* | gobj () const
| Provides access to the underlying C GObject. More...
GdkImage* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
void | put_pixel (int x, int y, guint32 pixel)
guint32 | get_pixel (int x, int y) const
void | set_colormap (const Glib::RefPtr< Colormap >& colormap)
| Sets the colormap for the image to the given colormap. More...
Glib::RefPtr< Colormap > | get_colormap ()
| Retrieves the colormap for a given image, if it exists. More...
Glib::RefPtr< const Colormap > | get_colormap () const
| Retrieves the colormap for a given image, if it exists. More...
ImageType | get_image_type () const
| Determines the type of a given image. More...
Glib::RefPtr< Visual > | get_visual ()
| Determines the visual that was used to create the image. More...
Glib::RefPtr< const Visual > | get_visual () const
| Determines the visual that was used to create the image. More...
ByteOrder | get_byte_order () const
| Determines the byte order of the image. More...
int | get_width () const
| Determines the width of the image. More...
int | get_height () const
| Determines the height of the image. More...
guint16 | get_depth () const
| Determines the depth of the image. More...
guint16 | get_bpp () const
| Determines the number of bytes per pixel of the image. More...
guint16 | get_bytes_per_pixel () const
| Determines the number of bytes per pixel of the image. More...
guint16 | get_bpl () const
| Determines the number of bytes per line of the image. More...
guint16 | get_bytes_per_line () const
| Determines the number of bytes per line of the image. More...
guint16 | get_bits_per_pixel () const
| Determines the number of bits per pixel of the image. More...
void* | get_pixels ()
| Returns a pointer to the pixel data of the image. More...
const void* | get_pixels () const
| Returns a pointer to the pixel data of the image. More...
void* | get_mem ()
const void* | get_mem () const
void* | get_windowing_data () const
Public Member Functions inherited from Glib::Object
void * | get_data (const QueryQuark &key)
void | set_data (const Quark &key, void *data)
void | set_data (const Quark &key, void *data, DestroyNotify notify)
void | remove_data (const QueryQuark &quark)
void * | steal_data (const QueryQuark &quark)
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false)
Public Member Functions inherited from Glib::ObjectBase
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | freeze_notify ()
void | thaw_notify ()
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable (const trackable &src)
trackable & | operator= (const trackable &src)
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | remove_destroy_notify_callback (void *data) const
void | notify_callbacks ()

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...
static Glib::RefPtr< Image > | create (ImageType type, const Glib::RefPtr< Visual >& visual, int width, int height)

## Protected Member Functions
| Image (ImageType type, const Glib::RefPtr< Visual >& visual, int width, int height)
| Instantiate a new Gdk::Image. More...
Protected Member Functions inherited from Glib::Object
| Object ()
| Object (const Glib::ConstructParams &construct_params)
| Object (GObject *castitem)
virtual | ~Object ()
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
virtual | ~ObjectBase ()=0
void | initialize (GObject *castitem)
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
void | initialize (GObject *castitem)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gdk::Image > | wrap (GdkImage* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Public Types inherited from Glib::Object
typedef void(* | DestroyNotify )(gpointer data)

## Detailed Description

This represents an area for drawing graphics.

It has now been superceded to a large extent by the much more flexible Gdk::Drawable RGB functions. To create an image from part of a Gdk::Window use Gdk::Drawable::get_image().

The 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 a Gdk::Image in a Gdk::Window or Gdk::Pixmap use Gdk::Drawable::draw_image().

## Constructor & Destructor Documentation

virtual Gdk::Image::~Image | ( |  | ) |
| virtual

Gdk::Image::Image | ( | ImageType | type,
|  | const Glib::RefPtr< Visual >& | visual,
|  | int | width,
|  | int | height
| ) |  |
| protected

Instantiate a new Gdk::Image.

Parameters

  type | The type of the Gdk::Image. Gdk::IMAGE_FASTEST is probably the best choice, since it will try to create a Gdk::IMAGE_SHARED image first and if that fails it will then use Gdk::IMAGE_NORMAL.
  visual | The Gdk::Visual to use for the image.
  width | The width of the image in pixels.
  height | The height of the image in pixels.

## Member Function Documentation

static Glib::RefPtr<Image> Gdk::Image::create | ( | ImageType | type,
|  | const Glib::RefPtr< Visual >& | visual,
|  | int | width,
|  | int | height
| ) |  |
| static

guint16 Gdk::Image::get_bits_per_pixel | ( |  | ) | const

Determines the number of bits per pixel of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The bits per pixel.

guint16 Gdk::Image::get_bpl | ( |  | ) | const

Determines the number of bytes per line of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Deprecated:
  Use get_bytes_per_line()

Returns
  The bytes per line.

guint16 Gdk::Image::get_bpp | ( |  | ) | const

Determines the number of bytes per pixel of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Deprecated:
  Use get_bytes_per_pixel()

Returns
  The bytes per pixel.

ByteOrder Gdk::Image::get_byte_order | ( |  | ) | const

Determines the byte order of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  A Gdk::Visual.

guint16 Gdk::Image::get_bytes_per_line | ( |  | ) | const

Determines the number of bytes per line of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The bytes per line.

guint16 Gdk::Image::get_bytes_per_pixel | ( |  | ) | const

Determines the number of bytes per pixel of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The bytes per pixel.

Glib::RefPtr<Colormap> Gdk::Image::get_colormap | ( |  | ) |

Retrieves 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 explicitely with set_colormap().

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  Colormap for the image.

Glib::RefPtr<const Colormap> Gdk::Image::get_colormap | ( |  | ) | const

Retrieves 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 explicitely with set_colormap().

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  Colormap for the image.

guint16 Gdk::Image::get_depth | ( |  | ) | const

Determines the depth of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The depth.

int Gdk::Image::get_height | ( |  | ) | const

Determines the height of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The height.

ImageType Gdk::Image::get_image_type | ( |  | ) | const

Determines the type of a given image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The Gdk::ImageType of the image.

void* Gdk::Image::get_mem | ( |  | ) |

Deprecated:
  Use get_pixels().

const void* Gdk::Image::get_mem | ( |  | ) | const

guint32 Gdk::Image::get_pixel | ( | int | x,
|  | int | y
| ) |  | const

void* Gdk::Image::get_pixels | ( |  | ) |

Returns a pointer to the pixel data of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The pixel data of the image.

const void* Gdk::Image::get_pixels | ( |  | ) | const

Returns a pointer to the pixel data of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The pixel data of the image.

static GType Gdk::Image::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

Glib::RefPtr<Visual> Gdk::Image::get_visual | ( |  | ) |

Determines the visual that was used to create the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  A Gdk::Visual.

Glib::RefPtr<const Visual> Gdk::Image::get_visual | ( |  | ) | const

Determines the visual that was used to create the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  A Gdk::Visual.

int Gdk::Image::get_width | ( |  | ) | const

Determines the width of the image.

Since gtkmm 2.22:

Deprecated: 2.22: Gdk::Image should not be used anymore.

Returns
  The width.

void* Gdk::Image::get_windowing_data | ( |  | ) | const

GdkImage* Gdk::Image::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

const GdkImage* Gdk::Image::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

GdkImage* Gdk::Image::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

void Gdk::Image::put_pixel | ( | int | x,
|  | int | y,
|  | guint32 | pixel
| ) |  |

void Gdk::Image::set_colormap | ( | const Glib::RefPtr< Colormap >& | colormap | ) |

Sets the colormap for the image to the given colormap.

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

Deprecated: 2.22: Gdk::Image should not be used anymore.

Parameters

  colormap | A Gdk::Colormap.

## Friends And Related Function Documentation

Glib::RefPtr< Gdk::Image > wrap | ( | GdkImage * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gdkmm/image.h