WindowsIconReader.st
changeset 898 cdf6cc132b53
parent 819 e358c08e45ea
child 899 a2676b9f61ba
equal deleted inserted replaced
897:feac294893a5 898:cdf6cc132b53
   493             srcIndex := srcIndex + 1.
   493             srcIndex := srcIndex + 1.
   494             fourBytesPerColorInfo ifTrue:[
   494             fourBytesPerColorInfo ifTrue:[
   495                 srcIndex := srcIndex + 1.
   495                 srcIndex := srcIndex + 1.
   496             ]
   496             ]
   497         ].
   497         ].
       
   498         numColor > (1 bitShift:inDepth) ifTrue:[
       
   499             'funny number of colors in image' infoPrintCR.
       
   500             numColor := 1 bitShift:inDepth.
       
   501             rMap := rMap copyTo:numColor.
       
   502             gMap := gMap copyTo:numColor.
       
   503             bMap := bMap copyTo:numColor.
       
   504         ].
   498     ].
   505     ].
   499 
   506 
   500     "/ check for valid compression
   507     "/ check for valid compression
   501 
   508 
   502     compression ~~ 0 ifTrue:[
   509     compression ~~ 0 ifTrue:[
   540         photometric := #rgb.
   547         photometric := #rgb.
   541         samplesPerPixel := 3.
   548         samplesPerPixel := 3.
   542         bitsPerSample := #(8 8 8).
   549         bitsPerSample := #(8 8 8).
   543         ^ self
   550         ^ self
   544     ].
   551     ].
       
   552     inDepth == 1 ifTrue:[
       
   553         photometric := #blackIs0.
       
   554         samplesPerPixel := 1.
       
   555         bitsPerSample := #(1).
       
   556         ^ self
       
   557     ].
       
   558     inDepth ~~ 8 ifTrue:[
       
   559         self halt:'unsupported depth'.
       
   560     ].
   545 
   561 
   546     photometric := #palette.
   562     photometric := #palette.
   547     samplesPerPixel := 1.
   563     samplesPerPixel := 1.
   548     bitsPerSample := #(8).
   564     bitsPerSample := #(8).
   549     colorMap := Colormap redVector:rMap greenVector:gMap blueVector:bMap.
   565     colorMap := Colormap redVector:rMap greenVector:gMap blueVector:bMap.
   550 
   566 
   551     "Modified: / 17.9.1995 / 18:48:46 / claus"
   567     "Modified: / 17.9.1995 / 18:48:46 / claus"
   552     "Modified: / 3.2.1998 / 20:19:41 / cg"
   568     "Modified: / 10.4.1998 / 00:28:55 / cg"
   553 !
   569 !
   554 
   570 
   555 fromWindowsICOFile:aFilename 
   571 fromWindowsICOFile:aFilename 
   556     "read an image from a windows ICO file"
   572     "read an image from a windows ICO file"
   557 
   573 
   788 ! !
   804 ! !
   789 
   805 
   790 !WindowsIconReader class methodsFor:'documentation'!
   806 !WindowsIconReader class methodsFor:'documentation'!
   791 
   807 
   792 version
   808 version
   793     ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.38 1998-02-03 19:22:21 cg Exp $'
   809     ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.39 1998-04-10 10:15:25 cg Exp $'
   794 ! !
   810 ! !
   795 WindowsIconReader initialize!
   811 WindowsIconReader initialize!