app: add gimp_layer_mode_is_trivial()

Add a TRIVIAL layer-mode flag, and corresponding
gimp_layer_mode_is_trivial() function, which indicates if the blend
function of a given layer mode is trivial, i.e., either never
modifies the source pixels (for non-subtractive modes), or always
clears the destination pixels (for subtractive modes).

(cherry picked from commit 8adec5fb3a)
This commit is contained in:
Ell
2018-12-02 02:55:05 -05:00
parent c4e51b9a45
commit 2dda622a20
3 changed files with 27 additions and 8 deletions

View File

@ -182,7 +182,8 @@ typedef enum /*< pdb-skip, skip >*/
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE = 1 << 2,
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE = 1 << 3,
GIMP_LAYER_MODE_FLAG_SUBTRACTIVE = 1 << 4,
GIMP_LAYER_MODE_FLAG_ALPHA_ONLY = 1 << 5
GIMP_LAYER_MODE_FLAG_ALPHA_ONLY = 1 << 5,
GIMP_LAYER_MODE_FLAG_TRIVIAL = 1 << 6
} GimpLayerModeFlags;