[gimp] app: s/GimpPrecision/GimpComponentType/ in gimp_projection_estimate_memsize()



commit 02c9dacc8fb0ee72003b94b368a8c1066d1ed138
Author: Michael Natterer <mitch gimp org>
Date:   Sat Jun 14 23:20:52 2014 +0200

    app: s/GimpPrecision/GimpComponentType/ in gimp_projection_estimate_memsize()

 app/core/gimpgrouplayer.c  |    4 +---
 app/core/gimpimage-scale.c |    4 ++--
 app/core/gimpprojection.c  |   14 ++++++++------
 app/core/gimpprojection.h  |    2 +-
 app/core/gimptemplate.c    |    2 +-
 5 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/app/core/gimpgrouplayer.c b/app/core/gimpgrouplayer.c
index 98d88dd..a6fa5e8 100644
--- a/app/core/gimpgrouplayer.c
+++ b/app/core/gimpgrouplayer.c
@@ -839,9 +839,7 @@ gimp_group_layer_estimate_memsize (const GimpDrawable *drawable,
 
   base_type = gimp_drawable_get_base_type (drawable);
 
-  memsize += gimp_projection_estimate_memsize (base_type,
-                                               gimp_babl_precision (component_type,
-                                                                    FALSE),
+  memsize += gimp_projection_estimate_memsize (base_type, component_type,
                                                width, height);
 
   return memsize +
diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c
index 99da591..981ce3d 100644
--- a/app/core/gimpimage-scale.c
+++ b/app/core/gimpimage-scale.c
@@ -316,13 +316,13 @@ gimp_image_scale_check (const GimpImage *image,
 
   scalable_size +=
     gimp_projection_estimate_memsize (gimp_image_get_base_type (image),
-                                      gimp_image_get_precision (image),
+                                      gimp_image_get_component_type (image),
                                       gimp_image_get_width (image),
                                       gimp_image_get_height (image));
 
   scaled_size +=
     gimp_projection_estimate_memsize (gimp_image_get_base_type (image),
-                                      gimp_image_get_precision (image),
+                                      gimp_image_get_component_type (image),
                                       new_width, new_height);
 
   GIMP_LOG (IMAGE_SCALE,
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index eb649c6..72a7e26 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -304,10 +304,10 @@ gimp_projection_get_memsize (GimpObject *object,
 
 /**
  * gimp_projection_estimate_memsize:
- * @type:      the projectable's base type
- * @precision: the projectable's precision
- * @width:     projection width
- * @height:    projection height
+ * @type:           the projectable's base type
+ * @component_type: the projectable's component type
+ * @width:          projection width
+ * @height:         projection height
  *
  * Calculates a rough estimate of the memory that is required for the
  * projection of an image with the given @width and @height.
@@ -316,7 +316,7 @@ gimp_projection_get_memsize (GimpObject *object,
  **/
 gint64
 gimp_projection_estimate_memsize (GimpImageBaseType type,
-                                  GimpPrecision     precision,
+                                  GimpComponentType component_type,
                                   gint              width,
                                   gint              height)
 {
@@ -326,7 +326,9 @@ gimp_projection_estimate_memsize (GimpImageBaseType type,
   if (type == GIMP_INDEXED)
     type = GIMP_RGB;
 
-  format = gimp_babl_format (type, precision, TRUE);
+  format = gimp_babl_format (type,
+                             gimp_babl_precision (component_type, FALSE),
+                             TRUE);
   bytes  = babl_format_get_bytes_per_pixel (format);
 
   /* The pyramid levels constitute a geometric sum with a ratio of 1/4. */
diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h
index 341d03b..9a7e484 100644
--- a/app/core/gimpprojection.h
+++ b/app/core/gimpprojection.h
@@ -68,7 +68,7 @@ void             gimp_projection_flush_now         (GimpProjection    *proj);
 void             gimp_projection_finish_draw       (GimpProjection    *proj);
 
 gint64           gimp_projection_estimate_memsize  (GimpImageBaseType  type,
-                                                    GimpPrecision      precision,
+                                                    GimpComponentType  component_type,
                                                     gint               width,
                                                     gint               height);
 
diff --git a/app/core/gimptemplate.c b/app/core/gimptemplate.c
index ab3a1ec..2f32b77 100644
--- a/app/core/gimptemplate.c
+++ b/app/core/gimptemplate.c
@@ -343,7 +343,7 @@ gimp_template_notify (GObject    *object,
 
   private->initial_size +=
     gimp_projection_estimate_memsize (private->base_type,
-                                      private->precision,
+                                      gimp_babl_component_type (private->precision),
                                       private->width, private->height);
 
   if (! strcmp (pspec->name, "icon-name"))


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