ImageEditor.st
changeset 2870 0f130285be97
parent 2866 10f8ee0f23fe
child 2871 23c3bb9d51be
equal deleted inserted replaced
2869:aa4cdac32055 2870:0f130285be97
  3592     self colorMapMode setValue:colorMapModeKey.
  3592     self colorMapMode setValue:colorMapModeKey.
  3593 
  3593 
  3594 
  3594 
  3595     image depth > 12 ifTrue:[
  3595     image depth > 12 ifTrue:[
  3596         newListOfColors := OrderedCollection new.
  3596         newListOfColors := OrderedCollection new.
  3597         image colorMap isEmptyOrNil ifTrue:[
  3597         (image depth > 16 or:[image colorMap isEmptyOrNil]) ifTrue:[
  3598             someOrAllUsedColors := image usedColorsMax:10000.
  3598             someOrAllUsedColors := image usedColorsMax:10000.
  3599             someOrAllUsedColors notNil ifTrue:[
  3599             someOrAllUsedColors notNil ifTrue:[
  3600                 someOrAllUsedColors := someOrAllUsedColors asArray.
  3600                 someOrAllUsedColors := someOrAllUsedColors asArray.
  3601                 someOrAllUsedColors sort:self sortBlockForColors.
  3601                 someOrAllUsedColors sort:self sortBlockForColors.
  3602                 newListOfColors addAll:someOrAllUsedColors.
  3602                 newListOfColors addAll:someOrAllUsedColors.
  3630 "/            value: (listOfColors indexOf: imageEditView selectedColor).
  3630 "/            value: (listOfColors indexOf: imageEditView selectedColor).
  3631     ].
  3631     ].
  3632     self listOfColors asOrderedCollection ~= newListOfColors ifTrue:[
  3632     self listOfColors asOrderedCollection ~= newListOfColors ifTrue:[
  3633         self listOfColors contents:newListOfColors.
  3633         self listOfColors contents:newListOfColors.
  3634     ].
  3634     ].
  3635     "Modified: / 07-07-2006 / 12:27:43 / cg"
  3635 
       
  3636     "Modified: / 18-01-2012 / 13:58:38 / cg"
  3636 !
  3637 !
  3637 
  3638 
  3638 update:something with:aParameter from:changedObject
  3639 update:something with:aParameter from:changedObject
  3639     |clrIndex img imagePreView clr changedColor|
  3640     |clrIndex img imagePreView clr changedColor|
  3640 
  3641 
  3764 !
  3765 !
  3765 
  3766 
  3766 updateColorsFromImage:image
  3767 updateColorsFromImage:image
  3767     |colors|
  3768     |colors|
  3768 
  3769 
       
  3770     image depth > 16 ifTrue:[
       
  3771         self listOfColors contents:#().
       
  3772         ^ self.
       
  3773     ].
       
  3774 
  3769     colors := image colorMap.
  3775     colors := image colorMap.
  3770     colors isNil ifTrue:[
  3776     colors isNil ifTrue:[
  3771         Error handle:[:ex |
  3777         Error handle:[:ex |
  3772             colors := OrderedCollection new.
  3778             colors := OrderedCollection new.
  3773         ] do:[
  3779         ] do:[
  3774             colors := image usedColors asSet.
  3780             colors := image usedColors asSet.
  3775         ]
  3781         ].
  3776     ].
  3782     ].
  3777     self listOfColors contents:(colors asOrderedCollection).
  3783     self listOfColors contents:(colors asOrderedCollection).
       
  3784 
       
  3785     "Modified: / 18-01-2012 / 13:57:43 / cg"
  3778 !
  3786 !
  3779 
  3787 
  3780 updateForNoImage
  3788 updateForNoImage
  3781     "updates channels and view, if image is loaded"
  3789     "updates channels and view, if image is loaded"
  3782 
  3790