3187 colorMapModeKey := 'depth'. |
3187 colorMapModeKey := 'depth'. |
3188 ]. |
3188 ]. |
3189 colorMapModeKey := colorMapModeKey , image depth printString. |
3189 colorMapModeKey := colorMapModeKey , image depth printString. |
3190 self colorMapMode setValue:colorMapModeKey. |
3190 self colorMapMode setValue:colorMapModeKey. |
3191 |
3191 |
3192 listOfColors := self listOfColors. |
3192 newListOfColors := OrderedCollection withAll:(self listOfColors). |
3193 |
3193 |
3194 image depth > 12 ifTrue:[ |
3194 image depth > 12 ifTrue:[ |
3195 listOfColors removeAll. |
3195 newListOfColors removeAll. |
3196 image colorMap isEmptyOrNil ifTrue:[ |
3196 image colorMap isEmptyOrNil ifTrue:[ |
3197 someOrAllUsedColors := image usedColorsMax:10000. |
3197 someOrAllUsedColors := image usedColorsMax:10000. |
3198 someOrAllUsedColors notNil ifTrue:[ |
3198 someOrAllUsedColors notNil ifTrue:[ |
3199 someOrAllUsedColors := someOrAllUsedColors asArray. |
3199 someOrAllUsedColors := someOrAllUsedColors asArray. |
3200 someOrAllUsedColors sort:self sortBlockForColors. |
3200 someOrAllUsedColors sort:self sortBlockForColors. |
3201 listOfColors addAll:someOrAllUsedColors. |
3201 newListOfColors addAll:someOrAllUsedColors. |
3202 "/ listOfColors add:Color black; add:Color white. |
3202 "/ listOfColors add:Color black; add:Color white. |
3203 ] |
3203 ] |
3204 ] ifFalse:[ |
3204 ] ifFalse:[ |
3205 listOfColors addAll:(image colorMap). |
3205 newListOfColors addAll:(image colorMap). |
3206 ]. |
3206 ]. |
3207 ] ifFalse:[ |
3207 ] ifFalse:[ |
3208 listOfColors isEmpty ifTrue:[ |
3208 newListOfColors isEmpty ifTrue:[ |
3209 self colorMapMode: colorMapMode value. |
3209 self colorMapMode: colorMapMode value. |
3210 image := self image. |
3210 image := self image. |
3211 ]. |
3211 ]. |
3212 ]. |
3212 ]. |
3213 listOfColors notEmptyOrNil ifTrue:[ |
3213 newListOfColors notEmptyOrNil ifTrue:[ |
3214 drawColor1 := listOfColors at:1. |
3214 drawColor1 := newListOfColors at:1. |
3215 drawColor2 := listOfColors at:2 ifAbsent:drawColor1. |
3215 drawColor2 := newListOfColors at:2 ifAbsent:drawColor1. |
3216 |
3216 |
3217 self hasMask ifTrue: [ |
3217 self hasMask ifTrue: [ |
3218 (listOfColors contains: [:clr| clr = (Color colorId:0)]) |
3218 (newListOfColors contains: [:clr| clr = (Color colorId:0)]) |
3219 ifFalse:[ |
3219 ifFalse:[ |
3220 listOfColors addFirst:(Color colorId:0). |
3220 newListOfColors addFirst:(Color colorId:0). |
3221 drawColor1 := listOfColors at:2. |
3221 drawColor1 := newListOfColors at:2. |
3222 drawColor2 := listOfColors at:3 ifAbsent:drawColor1. |
3222 drawColor2 := newListOfColors at:3 ifAbsent:drawColor1. |
3223 ] |
3223 ] |
3224 ]. |
3224 ]. |
3225 |
3225 "/ imageEditView drawingColors:(Array with: drawColor1 with: drawColor2). |
3226 imageEditView drawingColors:(Array with: drawColor1 with: drawColor2). |
3226 "/ self selectionOfColor |
3227 |
3227 "/ setValue: 0; |
3228 self selectionOfColor |
3228 "/ value: (listOfColors indexOf: imageEditView selectedColor). |
3229 setValue: 0; |
3229 ]. |
3230 value: (listOfColors indexOf: imageEditView selectedColor). |
3230 self listOfColors contents:newListOfColors. |
3231 ]. |
|
3232 |
3231 |
3233 "Modified: / 07-07-2006 / 12:27:43 / cg" |
3232 "Modified: / 07-07-2006 / 12:27:43 / cg" |
3234 ! |
3233 ! |
3235 |
3234 |
3236 update:something with:aParameter from:changedObject |
3235 update:something with:aParameter from:changedObject |
3385 self addHistoryEntryForFile:image fileName. |
3384 self addHistoryEntryForFile:image fileName. |
3386 ]. |
3385 ]. |
3387 ! |
3386 ! |
3388 |
3387 |
3389 updateListOfColorsAndColormapMode |
3388 updateListOfColorsAndColormapMode |
3390 |colorMap image| |
3389 |selectedColor colorMap image| |
|
3390 |
|
3391 selectedColor := self selectedColorOrNil. |
3391 |
3392 |
3392 image := self image. |
3393 image := self image. |
3393 image isNil ifTrue:[ |
3394 image isNil ifTrue:[ |
3394 self listOfColors removeAll. |
3395 self listOfColors removeAll. |
3395 ] ifFalse:[ |
3396 ] ifFalse:[ |
3396 colorMap := image colorMap. |
3397 colorMap := image colorMap. |
3397 colorMap size <= 4096 ifTrue:[ |
3398 colorMap size <= 4096 ifTrue:[ |
|
3399 image mask notNil ifTrue:[ |
|
3400 colorMap := (Array with:(Color noColor)),colorMap. |
|
3401 ]. |
3398 self listOfColors contents:colorMap. |
3402 self listOfColors contents:colorMap. |
3399 ] ifFalse:[ |
3403 ] ifFalse:[ |
3400 self listOfColors removeAll. |
3404 self listOfColors removeAll. |
3401 colorMap isFixedPalette ifTrue:[ |
3405 colorMap isFixedPalette ifTrue:[ |
3402 image colorMap:nil. |
3406 image colorMap:nil. |