ImageEditor.st
changeset 1927 c5068006116d
parent 1926 b3d2dab90f9b
child 1928 06c3681a79b3
equal deleted inserted replaced
1926:b3d2dab90f9b 1927:c5068006116d
  2898 !ImageEditor methodsFor:'change & update'!
  2898 !ImageEditor methodsFor:'change & update'!
  2899 
  2899 
  2900 findColorMapMode
  2900 findColorMapMode
  2901     "finds the colorMapMode for a new image"
  2901     "finds the colorMapMode for a new image"
  2902 
  2902 
  2903     |image listOfColors colorMapModeKey drawColor1 drawColor2|
  2903     |image listOfColors colorMapModeKey drawColor1 drawColor2 someOrAllUsedColors|
  2904 
  2904 
  2905     image := self image.
  2905     image := self image.
  2906 
  2906 
  2907     image mask notNil ifTrue: [             
  2907     image mask notNil ifTrue: [             
  2908         colorMapModeKey := 'masked'.
  2908         colorMapModeKey := 'masked'.
  2914 
  2914 
  2915     listOfColors := self listOfColors.
  2915     listOfColors := self listOfColors.
  2916     image depth > 12 ifTrue:[
  2916     image depth > 12 ifTrue:[
  2917         listOfColors removeAll.
  2917         listOfColors removeAll.
  2918         image colorMap isEmptyOrNil ifTrue:[
  2918         image colorMap isEmptyOrNil ifTrue:[
  2919             listOfColors add:Color black; add:Color white.
  2919             someOrAllUsedColors := image usedColorsMax:10000.
       
  2920             listOfColors addAll:someOrAllUsedColors.
       
  2921             "/ listOfColors add:Color black; add:Color white.
  2920         ] ifFalse:[
  2922         ] ifFalse:[
  2921             listOfColors addAll:(image colorMap).
  2923             listOfColors addAll:(image colorMap).
  2922         ].
  2924         ].
  2923     ] ifFalse:[
  2925     ] ifFalse:[
  2924         listOfColors isEmpty ifTrue:[   
  2926         listOfColors isEmpty ifTrue:[