[retro-gtk/wip/aplazas/gl-display: 4/12] pixdata: Add size getters
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/gl-display: 4/12] pixdata: Add size getters
- Date: Sat, 18 Nov 2017 09:40:30 +0000 (UTC)
commit abf7f80d4e1bf58e121c79bf88f05e449c75fe05
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Nov 18 08:01:05 2017 +0100
pixdata: Add size getters
These will be used in a next commit to get the size of the data.
retro-gtk/retro-pixdata.c | 32 ++++++++++++++++++++++++++++++++
retro-gtk/retro-pixdata.h | 2 ++
2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/retro-gtk/retro-pixdata.c b/retro-gtk/retro-pixdata.c
index c8cab86..fa38c31 100644
--- a/retro-gtk/retro-pixdata.c
+++ b/retro-gtk/retro-pixdata.c
@@ -255,6 +255,38 @@ retro_pixdata_free (RetroPixdata *self)
}
/**
+ * retro_pixdata_get_width:
+ * @self: a #RetroCore
+ *
+ * Gets the width of @self.
+ *
+ * Returns: the width
+ */
+gint
+retro_pixdata_get_width (RetroPixdata *self)
+{
+ g_return_val_if_fail (self != NULL, 0);
+
+ return self->width;
+}
+
+/**
+ * retro_pixdata_get_height:
+ * @self: a #RetroCore
+ *
+ * Gets the height of @self.
+ *
+ * Returns: the height
+ */
+gint
+retro_pixdata_get_height (RetroPixdata *self)
+{
+ g_return_val_if_fail (self != NULL, 0);
+
+ return self->height;
+}
+
+/**
* retro_pixdata_get_aspect_ratio:
* @self: a #RetroCore
*
diff --git a/retro-gtk/retro-pixdata.h b/retro-gtk/retro-pixdata.h
index 3c23057..8c4d13e 100644
--- a/retro-gtk/retro-pixdata.h
+++ b/retro-gtk/retro-pixdata.h
@@ -20,6 +20,8 @@ typedef struct _RetroPixdata RetroPixdata;
RetroPixdata *retro_pixdata_copy (RetroPixdata *self);
void retro_pixdata_free (RetroPixdata *self);
+gint retro_pixdata_get_width (RetroPixdata *self);
+gint retro_pixdata_get_height (RetroPixdata *self);
gfloat retro_pixdata_get_aspect_ratio (RetroPixdata *self);
GdkPixbuf *retro_pixdata_to_pixbuf (RetroPixdata *self);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]