ImageEditor.st
changeset 1962 9166ba3ce7c3
parent 1961 d9082e597adb
child 1965 1d2b7893ae89
equal deleted inserted replaced
1961:d9082e597adb 1962:9166ba3ce7c3
  3457 
  3457 
  3458 pointFromString:aString
  3458 pointFromString:aString
  3459     |p s x y|
  3459     |p s x y|
  3460 
  3460 
  3461     p := Object readFromString:aString onError:nil.
  3461     p := Object readFromString:aString onError:nil.
  3462     p notNil ifTrue:[^ p].
  3462     p isPoint ifTrue:[^ p].
  3463 
  3463 
  3464     s := aString readStream.
  3464     s := aString readStream.
  3465     x := Number readFrom:s onError:nil.
  3465     x := Number readFrom:s onError:nil.
  3466     x notNil ifTrue:[
  3466     x notNil ifTrue:[
  3467         s skipSeparators.
  3467         s skipSeparators.
  3468         [s atEnd not and:[s peek isDigit]] whileFalse:[s next].
  3468         [s atEnd not and:[s peek isDigit not]] whileTrue:[s next].
  3469         y := Number readFrom:s onError:nil.
  3469         y := Number readFrom:s onError:nil.
  3470         ^ x @ (y ? x)
  3470         ^ x @ (y ? x)
  3471     ].
  3471     ].
       
  3472     ^ nil
  3472 !
  3473 !
  3473 
  3474 
  3474 sortBlockForColors
  3475 sortBlockForColors
  3475     ^ [:a :b |
  3476     ^ [:a :b |
  3476             a redByte == b redByte ifTrue:[
  3477             a redByte == b redByte ifTrue:[
  4986 
  4987 
  4987     (self openDialogInterface:#dialogSpecForNewImage withBindings:aspects)
  4988     (self openDialogInterface:#dialogSpecForNewImage withBindings:aspects)
  4988     ifTrue:[
  4989     ifTrue:[
  4989         szString := (aspects at:#selectionOfSize) value.
  4990         szString := (aspects at:#selectionOfSize) value.
  4990         ext := self pointFromString:szString.
  4991         ext := self pointFromString:szString.
  4991         width := ext x.
  4992         ext isNil ifTrue:[
  4992         height := ext y.
  4993             width := height := 32
  4993 
  4994         ] ifFalse:[
       
  4995             width := ext x.
       
  4996             height := ext y.
       
  4997         ].
  4994 "/        width  := "128 min: "(Integer readFromString: (szString upTo: $x) onError:[32]).
  4998 "/        width  := "128 min: "(Integer readFromString: (szString upTo: $x) onError:[32]).
  4995 "/        height := "128 min: " (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[32]).
  4999 "/        height := "128 min: " (Integer readFromString: (szString copy reverse upTo: $x) reverse onError:[32]).
  4996 
  5000 
  4997         cMapString := (aspects at:#selectionOfColorMap) value.
  5001         cMapString := (aspects at:#selectionOfColorMap) value.
  4998         cMapMode   := self class namesOfColorMaps keyAtEqualValue:cMapString.
  5002         cMapMode   := self class namesOfColorMaps keyAtEqualValue:cMapString.