XPMReader.st
changeset 1858 3770543620e2
parent 1848 864ca2cd4e71
child 1882 34b809b880a9
equal deleted inserted replaced
1857:23ce428b6130 1858:3770543620e2
   539             (i.e. very simple images)"
   539             (i.e. very simple images)"
   540 
   540 
   541     |usedColors nColorsUsed nColors nChars map maskColorIndex
   541     |usedColors nColorsUsed nColors nChars map maskColorIndex
   542      isMasked imageMask|
   542      isMasked imageMask|
   543 
   543 
   544     usedColors := image usedColors asArray.
   544     usedColors := image usedColorsMax:4096.
       
   545     usedColors isNil ifTrue:[
       
   546         ^ Image cannotRepresentImageSignal 
       
   547             raiseWith:image
       
   548             errorString:('XPMReader cannot represent this image (too many colors)').
       
   549     ].
       
   550 
       
   551     usedColors := usedColors asArray.
   545     nColors := nColorsUsed := usedColors size.
   552     nColors := nColorsUsed := usedColors size.
   546     (imageMask := image mask) notNil ifTrue:[
   553     (imageMask := image mask) notNil ifTrue:[
   547         nColors := nColors + 1.
   554         nColors := nColors + 1.
   548         maskColorIndex := nColors.
   555         maskColorIndex := nColors.
   549     ].
   556     ].
   622 ! !
   629 ! !
   623 
   630 
   624 !XPMReader class methodsFor:'documentation'!
   631 !XPMReader class methodsFor:'documentation'!
   625 
   632 
   626 version
   633 version
   627     ^ '$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.58 2003-11-19 15:38:24 cg Exp $'
   634     ^ '$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.59 2003-11-26 15:33:54 cg Exp $'
   628 ! !
   635 ! !
   629 
   636 
   630 XPMReader initialize!
   637 XPMReader initialize!