[gimp/gimp-2-10] plug-ins: add most likely blend modes for certain psp blend modes.



commit 987101df362c546b1b8a04c2fb7ca2aa1303ed91
Author: Jacob Boerema <jgboerema gmail com>
Date:   Thu Aug 27 13:31:17 2020 -0400

    plug-ins: add most likely blend modes for certain psp blend modes.
    
    This adds a blend mode for all known psp blend modes that were not
    converted yet except for adjust.
    I couldn't find any information about adjust and it's value of
    255 suggests that it is not a normal blend mode.
    
    (cherry picked from commit 19b261f3c6025ba17852d542da331935b73ffaa2)

 plug-ins/common/file-psp.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/common/file-psp.c b/plug-ins/common/file-psp.c
index 1e2eb36c1d..2d0e9c9242 100644
--- a/plug-ins/common/file-psp.c
+++ b/plug-ins/common/file-psp.c
@@ -1047,21 +1047,21 @@ gimp_layer_mode_from_psp_blend_mode (PSPBlendModes mode)
       return GIMP_LAYER_MODE_BURN_LEGACY;
 
     case PSP_BLEND_EXCLUSION:
-      return -1;                /* ??? */
-
-    case PSP_BLEND_ADJUST:
-      return -1;                /* ??? */
+      return GIMP_LAYER_MODE_EXCLUSION;
 
     case PSP_BLEND_TRUE_HUE:
-      return -1;                /* ??? */
+      return GIMP_LAYER_MODE_HSV_HUE;
 
     case PSP_BLEND_TRUE_SATURATION:
-      return -1;                /* ??? */
+      return GIMP_LAYER_MODE_HSV_SATURATION;
 
     case PSP_BLEND_TRUE_COLOR:
-      return -1;                /* ??? */
+      return GIMP_LAYER_MODE_HSL_COLOR;
 
     case PSP_BLEND_TRUE_LIGHTNESS:
+      return GIMP_LAYER_MODE_HSV_VALUE;
+
+    case PSP_BLEND_ADJUST:
       return -1;                /* ??? */
     }
   return -1;
@@ -1088,13 +1088,20 @@ blend_mode_name (PSPBlendModes mode)
     "DIFFERENCE",
     "DODGE",
     "BURN",
-    "EXCLUSION"
+    "EXCLUSION",
+    "TRUE HUE",
+    "TRUE SATURATION",
+    "TRUE COLOR",
+    "TRUE LIGHTNESS",
+    /* ADJUST should always be the last one. */
+    "ADJUST"
   };
   static gchar *err_name = NULL;
 
-  /* TODO: what about PSP_BLEND_ADJUST? */
-  if (mode >= 0 && mode <= PSP_BLEND_EXCLUSION)
+  if (mode >= 0 && mode <= PSP_BLEND_TRUE_LIGHTNESS)
     return blend_mode_names[mode];
+  else if (mode == PSP_BLEND_ADJUST)
+    return blend_mode_names[PSP_BLEND_TRUE_LIGHTNESS+1];
 
   g_free (err_name);
   err_name = g_strdup_printf ("unknown layer blend mode %d", mode);


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