ImageEditor.st
changeset 3317 88b892a4012d
parent 3281 15b8e734190a
child 3331 7b33bd507e1c
equal deleted inserted replaced
3316:db4749aa5c60 3317:88b892a4012d
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1997-1998 by eXept Software AG
     4  COPYRIGHT (c) 1997-1998 by eXept Software AG
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
  4012             someOrAllUsedColors notNil ifTrue:[
  4014             someOrAllUsedColors notNil ifTrue:[
  4013                 someOrAllUsedColors := someOrAllUsedColors asArray.
  4015                 someOrAllUsedColors := someOrAllUsedColors asArray.
  4014                 someOrAllUsedColors sort:self sortBlockForColors.
  4016                 someOrAllUsedColors sort:self sortBlockForColors.
  4015                 newListOfColors addAll:someOrAllUsedColors.
  4017                 newListOfColors addAll:someOrAllUsedColors.
  4016                 "/ listOfColors add:Color black; add:Color white.
  4018                 "/ listOfColors add:Color black; add:Color white.
  4017             ]
  4019             ].
       
  4020             image mask notNil ifTrue:[
       
  4021                 newListOfColors := (Array with:(Color noColor)),newListOfColors.
       
  4022             ].
  4018         ] ifFalse:[
  4023         ] ifFalse:[
  4019             newListOfColors addAll:(image colorMap).
  4024             newListOfColors addAll:(image colorMap).
  4020         ].
  4025         ].
  4021     ] ifFalse:[
  4026     ] ifFalse:[
  4022         newListOfColors := OrderedCollection withAll:(self listOfColors).
  4027         newListOfColors := OrderedCollection withAll:(self listOfColors).
  4023         newListOfColors isEmpty ifTrue:[   
  4028         newListOfColors isEmpty ifTrue:[   
  4024             self colorMapMode: colorMapMode value.
  4029             self colorMapMode: colorMapMode value.
  4025             image := self image.
  4030             image := self image.
  4026         ].                               
  4031         ].                               
       
  4032         "/ image mask notNil ifTrue:[
       
  4033         "/     newListOfColors := (Array with:(Color noColor)),newListOfColors.
       
  4034         "/ ].
  4027     ].  
  4035     ].  
  4028     newListOfColors notEmptyOrNil ifTrue:[
  4036     newListOfColors notEmptyOrNil ifTrue:[
  4029         drawColor1 := newListOfColors at:1.
  4037         drawColor1 := newListOfColors at:1.
  4030         drawColor2 := newListOfColors at:2 ifAbsent:drawColor1.
  4038         drawColor2 := newListOfColors at:2 ifAbsent:drawColor1.
  4031 
  4039 
  5468                 ].
  5476                 ].
  5469                 image mask:maskImage.
  5477                 image mask:maskImage.
  5470             ].
  5478             ].
  5471         ] ifFalse:[ 
  5479         ] ifFalse:[ 
  5472             image mask: nil.
  5480             image mask: nil.
       
  5481             oldImage mask notNil ifTrue:[
       
  5482                 newImage depth == 32 ifTrue:[
       
  5483                     newImage computeAlphaValuesFromMask:oldImage mask
       
  5484                 ].
       
  5485             ].
  5473         ]. 
  5486         ]. 
  5474 
  5487 
  5475         (newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[
  5488         (newColorMap isOrderedCollection or:[newColorMap isFixedPalette not]) ifTrue:[
  5476             realColorMap := OrderedCollection new.
  5489             realColorMap := OrderedCollection new.
  5477             image realColorMap do:[:clr|
  5490             image realColorMap do:[:clr|