diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-18 17:44:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-18 17:44:48 +0400 |
commit | c0e004bd61c45811f99a886d8818a7764109c5ec (patch) | |
tree | b0239ed640623a401945ba7e98937dafb3c2223e /source/blender/blenkernel | |
parent | 73a778a4d020cdafc9855a41a2c9bff421aed0d7 (diff) |
add difference blending mode, also fix error in last commit
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/mask_rasterize.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index f0fc1e9fbd2..8a5f225bed6 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -1235,6 +1235,9 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x case MASK_BLEND_REPLACE: value = (value * (1.0f - layer->alpha)) + (value_layer * layer->alpha); break; + case MASK_BLEND_DIFFERENCE: + value = fabsf(value - value_layer); + break; default: /* same as add */ BLI_assert(0); value += value_layer; @@ -1243,7 +1246,7 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x /* clamp after applying each layer so we don't get * issues subtracting after accumulating over 1.0f */ - return CLAMPIS(value, 0.0f, 1.0f); + CLAMP(value, 0.0f, 1.0f); } return value; |