[gnome-photos/wip/rishi/buffer-decoder: 13/16] codec



commit 0a02e5280c1007c6c61f96802dd2265031148e3a
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Sep 7 07:58:22 2018 +0200

    codec

 src/photos-gegl-buffer-codec.c | 28 ++++++++++++++--------------
 src/photos-gegl-buffer-codec.h | 10 ++++++----
 2 files changed, 20 insertions(+), 18 deletions(-)
---
diff --git a/src/photos-gegl-buffer-codec.c b/src/photos-gegl-buffer-codec.c
index c15e9a03..cc00a6f3 100644
--- a/src/photos-gegl-buffer-codec.c
+++ b/src/photos-gegl-buffer-codec.c
@@ -31,8 +31,8 @@ struct _PhotosGeglBufferCodecPrivate
 {
   gboolean decoding;
   gboolean used;
-  guint height;
-  guint width;
+  gdouble height;
+  gdouble width;
 };
 
 enum
@@ -67,11 +67,11 @@ photos_gegl_buffer_codec_get_property (GObject *object, guint prop_id, GValue *v
   switch (prop_id)
     {
     case PROP_HEIGHT:
-      g_value_set_uint (value, priv->height);
+      g_value_set_double (value, priv->height);
       break;
 
     case PROP_WIDTH:
-      g_value_set_uint (value, priv->width);
+      g_value_set_double (value, priv->width);
       break;
 
     default:
@@ -90,18 +90,18 @@ photos_gegl_buffer_codec_set_property (GObject *object, guint prop_id, const GVa
     {
     case PROP_HEIGHT:
       {
-        guint height;
+        gdouble height;
 
-        height = g_value_get_uint (value);
+        height = g_value_get_double (value);
         photos_gegl_buffer_codec_set_height (self, height);
         break;
       }
 
     case PROP_WIDTH:
       {
-        guint width;
+        gdouble width;
 
-        width = g_value_get_uint (value);
+        width = g_value_get_double (value);
         photos_gegl_buffer_codec_set_width (self, width);
         break;
       }
@@ -204,24 +204,24 @@ photos_gegl_buffer_codec_get_can_set_size (PhotosGeglBufferCodec *self)
 }
 
 
-guint
+gdouble
 photos_gegl_buffer_codec_get_height (PhotosGeglBufferCodec *self)
 {
   PhotosGeglBufferCodecPrivate *priv;
 
-  g_return_val_if_fail (PHOTOS_IS_GEGL_BUFFER_CODEC (self), 0);
+  g_return_val_if_fail (PHOTOS_IS_GEGL_BUFFER_CODEC (self), 0.0);
   priv = photos_gegl_buffer_codec_get_instance_private (self);
 
   return priv->height;
 }
 
 
-guint
+gdouble
 photos_gegl_buffer_codec_get_width (PhotosGeglBufferCodec *self)
 {
   PhotosGeglBufferCodecPrivate *priv;
 
-  g_return_val_if_fail (PHOTOS_IS_GEGL_BUFFER_CODEC (self), 0);
+  g_return_val_if_fail (PHOTOS_IS_GEGL_BUFFER_CODEC (self), 0.0);
   priv = photos_gegl_buffer_codec_get_instance_private (self);
 
   return priv->width;
@@ -295,7 +295,7 @@ photos_gegl_buffer_codec_load_stop (PhotosGeglBufferCodec *self, GError **error)
 
 
 void
-photos_gegl_buffer_codec_set_height (PhotosGeglBufferCodec *self, guint height)
+photos_gegl_buffer_codec_set_height (PhotosGeglBufferCodec *self, gdouble height)
 {
   PhotosGeglBufferCodecPrivate *priv;
 
@@ -313,7 +313,7 @@ photos_gegl_buffer_codec_set_height (PhotosGeglBufferCodec *self, guint height)
 
 
 void
-photos_gegl_buffer_codec_set_width (PhotosGeglBufferCodec *self, guint width)
+photos_gegl_buffer_codec_set_width (PhotosGeglBufferCodec *self, gdouble width)
 {
   PhotosGeglBufferCodecPrivate *priv;
 
diff --git a/src/photos-gegl-buffer-codec.h b/src/photos-gegl-buffer-codec.h
index e5341994..72aa708e 100644
--- a/src/photos-gegl-buffer-codec.h
+++ b/src/photos-gegl-buffer-codec.h
@@ -57,9 +57,9 @@ GeglBuffer         *photos_gegl_buffer_codec_get_buffer                (PhotosGe
 
 gboolean            photos_gegl_buffer_codec_get_can_set_size          (PhotosGeglBufferCodec *self);
 
-guint               photos_gegl_buffer_codec_get_height                (PhotosGeglBufferCodec *self);
+gdouble             photos_gegl_buffer_codec_get_height                (PhotosGeglBufferCodec *self);
 
-guint               photos_gegl_buffer_codec_get_width                 (PhotosGeglBufferCodec *self);
+gdouble             photos_gegl_buffer_codec_get_width                 (PhotosGeglBufferCodec *self);
 
 gboolean            photos_gegl_buffer_codec_load_begin                (PhotosGeglBufferCodec *self,
                                                                         GError **error);
@@ -72,9 +72,11 @@ gboolean            photos_gegl_buffer_codec_load_increment            (PhotosGe
 gboolean            photos_gegl_buffer_codec_load_stop                 (PhotosGeglBufferCodec *self,
                                                                         GError **error);
 
-void                photos_gegl_buffer_codec_set_height                (PhotosGeglBufferCodec *self, guint 
height);
+void                photos_gegl_buffer_codec_set_height                (PhotosGeglBufferCodec *self,
+                                                                        gdouble height);
 
-void                photos_gegl_buffer_codec_set_width                 (PhotosGeglBufferCodec *self, guint 
width);
+void                photos_gegl_buffer_codec_set_width                 (PhotosGeglBufferCodec *self,
+                                                                        gdouble width);
 
 G_END_DECLS
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]