[gtk+] Add an accessor for GdkImage->mem
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add an accessor for GdkImage->mem
- Date: Sat, 26 Jun 2010 20:49:43 +0000 (UTC)
commit 53796b7f1fe0d85fcac8fde8f24eef7290706afd
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 26 16:48:06 2010 -0400
Add an accessor for GdkImage->mem
See bug # 522756
docs/reference/gdk/gdk3-sections.txt | 1 +
gdk/gdk.symbols | 1 +
gdk/gdkimage.c | 18 ++++++++++++++++++
gdk/gdkimage.h | 1 +
4 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index e63d92d..e09e887 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -295,6 +295,7 @@ gdk_image_get_height
gdk_image_get_image_type
gdk_image_get_visual
gdk_image_get_width
+gdk_image_get_pixels
<SUBSECTION>
gdk_image_put_pixel
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 5dc6928..15e328a 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -851,6 +851,7 @@ gdk_image_get_height
gdk_image_get_image_type
gdk_image_get_visual
gdk_image_get_width
+gdk_image_get_pixels
gdk_image_set_colormap
gdk_image_new
#endif
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c
index 7b04925..1ef49c9 100644
--- a/gdk/gdkimage.c
+++ b/gdk/gdkimage.c
@@ -243,6 +243,24 @@ gdk_image_get_bits_per_pixel (GdkImage *image)
return image->bits_per_pixel;
}
+/**
+ * gdk_image_get_pixels:
+ * @image: a #GdkImage
+ *
+ * Returns a pointer to the pixel data of the image.
+ *
+ * Returns: the pixel data of the image
+ *
+ * Since: 2.22
+ */
+gpointer
+gdk_image_get_pixels (GdkImage *image)
+{
+ g_return_val_if_fail (GDK_IS_IMAGE (image), NULL);
+
+ return image->mem;
+}
+
/* We have N_REGION GDK_SCRATCH_IMAGE_WIDTH x GDK_SCRATCH_IMAGE_HEIGHT regions divided
* up between n_images different images. possible_n_images gives
* various divisors of N_REGIONS. The reason for allowing this
diff --git a/gdk/gdkimage.h b/gdk/gdkimage.h
index 8106f0b..5200801 100644
--- a/gdk/gdkimage.h
+++ b/gdk/gdkimage.h
@@ -118,6 +118,7 @@ guint16 gdk_image_get_depth (GdkImage *image);
guint16 gdk_image_get_bytes_per_pixel(GdkImage *image);
guint16 gdk_image_get_bytes_per_line (GdkImage *image);
guint16 gdk_image_get_bits_per_pixel (GdkImage *image);
+gpointer gdk_image_get_pixels (GdkImage *image);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]