ImageEditor.st
changeset 920 bde5b9369ef8
parent 919 4e50c3164625
child 921 a5aca21ea803
equal deleted inserted replaced
919:4e50c3164625 920:bde5b9369ef8
  1480                 0 to:numColors-1 do:[:pixel |
  1480                 0 to:numColors-1 do:[:pixel |
  1481                     newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel)
  1481                     newColorMap at:(pixel+1) put:(oldImage colorFromValue:pixel)
  1482                 ].
  1482                 ].
  1483             ] ifFalse:[
  1483             ] ifFalse:[
  1484                 "/ see if all used color fit the new colormap
  1484                 "/ see if all used color fit the new colormap
  1485                 usedColors := oldImage usedColors.
  1485                 usedColors := oldImage usedColors asArray.
  1486                 usedColors := usedColors asArray.
       
  1487                 usedColors size <= (1 bitShift:depth) ifTrue:[
  1486                 usedColors size <= (1 bitShift:depth) ifTrue:[
  1488                     "/ yea - just install them
  1487                     "/ yea - just install them
  1489                     usedColors keysAndValuesDo:[:idx :clr |
  1488                     usedColors keysAndValuesDo:[:idx :clr |
  1490                         newColorMap at:idx put:clr
  1489                         newColorMap at:idx put:clr
  1491                     ]
  1490                     ]
  1607             self findColorMapMode.
  1606             self findColorMapMode.
  1608             self updateLabelsAndHistory.
  1607             self updateLabelsAndHistory.
  1609         ]
  1608         ]
  1610     ]
  1609     ]
  1611 
  1610 
  1612     "Modified: / 28.7.1998 / 21:42:14 / cg"
  1611     "Modified: / 28.7.1998 / 21:51:24 / cg"
  1613 !
  1612 !
  1614 
  1613 
  1615 compressColorMap
  1614 compressColorMap
  1616     "calculates a new color map for the image, using only used colors"
  1615     "calculates a new color map for the image, using only used colors"
  1617 
  1616