summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-06-26 17:00:39 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-06-26 17:00:39 -0400
commitcbf303d8c6428eb6eb87b72af700ee8dfa921689 (patch)
treed4629858f455a0605bffc606ae21cb3e5d80ab25
parent1adba9e908daf124770107fe2d1b0cb66363dc0b (diff)
downloadgtk+-cbf303d8c6428eb6eb87b72af700ee8dfa921689.tar.gz
Add an accessor for GdkImage->mem
See bug # 522756 (cherry picked from commit 53796b7f1fe0d85fcac8fde8f24eef7290706afd)
-rw-r--r--docs/reference/gdk/gdk-sections.txt10
-rw-r--r--gdk/gdk.symbols1
-rw-r--r--gdk/gdkimage.c18
-rw-r--r--gdk/gdkimage.h1
4 files changed, 30 insertions, 0 deletions
diff --git a/docs/reference/gdk/gdk-sections.txt b/docs/reference/gdk/gdk-sections.txt
index 4ec9135794..1aa7bb6b42 100644
--- a/docs/reference/gdk/gdk-sections.txt
+++ b/docs/reference/gdk/gdk-sections.txt
@@ -292,6 +292,16 @@ gdk_image_unref
gdk_image_destroy
gdk_image_get_colormap
gdk_image_set_colormap
+gdk_image_get_bits_per_pixel
+gdk_image_get_bytes_per_pixel
+gdk_image_get_bytes_per_line
+gdk_image_get_byte_order
+gdk_image_get_depth
+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 b900b5f226..fe0a1567db 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -839,6 +839,7 @@ gdk_image_ref
gdk_image_unref
gdk_image_get
#endif
+gdk_image_get_pixels
gdk_image_set_colormap
gdk_image_get_colormap
gdk_image_new
diff --git a/gdk/gdkimage.c b/gdk/gdkimage.c
index c5e7c0fcf9..d21ed91cff 100644
--- a/gdk/gdkimage.c
+++ b/gdk/gdkimage.c
@@ -308,6 +308,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 d34148e28d..548294f3d6 100644
--- a/gdk/gdkimage.h
+++ b/gdk/gdkimage.h
@@ -129,6 +129,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);
#ifdef GDK_ENABLE_BROKEN
GdkImage* gdk_image_new_bitmap (GdkVisual *visual,