[gimp] app: treat half precision float the same as single and double



commit 30a8edeab568f95dde360dcff5b805be38a28bab
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu Nov 10 15:20:16 2016 +0100

    app: treat half precision float the same as single and double
    
    .. which is to say encourage use of linear gamma, by making it one fewer step
    to end up in linear than gamma corrected.

 app/dialogs/convert-precision-dialog.c |    6 ++++--
 app/widgets/gimptemplateeditor.c       |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/app/dialogs/convert-precision-dialog.c b/app/dialogs/convert-precision-dialog.c
index 3351d21..5029d13 100644
--- a/app/dialogs/convert-precision-dialog.c
+++ b/app/dialogs/convert-precision-dialog.c
@@ -127,16 +127,18 @@ convert_precision_dialog_new (GimpImage                    *image,
       linear = FALSE;
       break;
 
+      /* leave gamma alone by default when converting to 16/32 bit float */
     case GIMP_COMPONENT_TYPE_U16:
     case GIMP_COMPONENT_TYPE_U32:
-    case GIMP_COMPONENT_TYPE_HALF:
     default:
       linear = gimp_babl_format_get_linear (old_format);
       break;
 
     case GIMP_COMPONENT_TYPE_FLOAT:
+    case GIMP_COMPONENT_TYPE_HALF:
     case GIMP_COMPONENT_TYPE_DOUBLE:
-      /* default to linear when converting to float or double */
+      /* default to linear when converting to half, single or double precision
+       * floating point */
       linear = TRUE;
       break;
     }
diff --git a/app/widgets/gimptemplateeditor.c b/app/widgets/gimptemplateeditor.c
index 8df21a9..85ed57a 100644
--- a/app/widgets/gimptemplateeditor.c
+++ b/app/widgets/gimptemplateeditor.c
@@ -659,12 +659,12 @@ gimp_template_editor_precision_changed (GtkWidget          *widget,
 
     case GIMP_COMPONENT_TYPE_U16:
     case GIMP_COMPONENT_TYPE_U32:
-    case GIMP_COMPONENT_TYPE_HALF:
     default:
       /* leave 'linear' alone */
       break;
 
     case GIMP_COMPONENT_TYPE_FLOAT:
+    case GIMP_COMPONENT_TYPE_HALF:
     case GIMP_COMPONENT_TYPE_DOUBLE:
       /* default to linear when converting to float or double */
       g_object_set (private->template,


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