#FEATURE by cg
class: ImageEditor
changed:
#colorMapMode:
#findColorMapMode
converting masked image to an alpha image
--- a/ImageEditor.st Wed Aug 03 14:32:31 2016 +0200
+++ b/ImageEditor.st Mon Aug 08 14:06:59 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1997-1998 by eXept Software AG
All Rights Reserved
@@ -4014,7 +4016,10 @@
someOrAllUsedColors sort:self sortBlockForColors.
newListOfColors addAll:someOrAllUsedColors.
"/ listOfColors add:Color black; add:Color white.
- ]
+ ].
+ image mask notNil ifTrue:[
+ newListOfColors := (Array with:(Color noColor)),newListOfColors.
+ ].
] ifFalse:[
newListOfColors addAll:(image colorMap).
].
@@ -4024,6 +4029,9 @@
self colorMapMode: colorMapMode value.
image := self image.
].
+ "/ image mask notNil ifTrue:[
+ "/ newListOfColors := (Array with:(Color noColor)),newListOfColors.
+ "/ ].
].
newListOfColors notEmptyOrNil ifTrue:[
drawColor1 := newListOfColors at:1.
@@ -5470,6 +5478,11 @@
].
] ifFalse:[
image mask: nil.
+ oldImage mask notNil ifTrue:[
+ newImage depth == 32 ifTrue:[
+ newImage computeAlphaValuesFromMask:oldImage mask
+ ].
+ ].
].
(newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[