WindowsIconReader.st
changeset 3568 a8900d28752b
parent 3404 703c3b400e7d
child 3571 a830f0388ef6
equal deleted inserted replaced
3565:76899d7114cd 3568:a8900d28752b
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libview2' }"
    12 "{ Package: 'stx:libview2' }"
       
    13 
       
    14 "{ NameSpace: Smalltalk }"
    13 
    15 
    14 ImageReader subclass:#WindowsIconReader
    16 ImageReader subclass:#WindowsIconReader
    15 	instanceVariableNames:'compression inDepth'
    17 	instanceVariableNames:'compression inDepth'
    16 	classVariableNames:''
    18 	classVariableNames:''
    17 	poolDictionaries:''
    19 	poolDictionaries:''
  1044         tmp replaceFrom:dstIndex to:(dstIndex + bytesPerRow - 1)
  1046         tmp replaceFrom:dstIndex to:(dstIndex + bytesPerRow - 1)
  1045                    with:rawData startingAt:srcIndex.
  1047                    with:rawData startingAt:srcIndex.
  1046         srcIndex := srcIndex + bytesPerRow.
  1048         srcIndex := srcIndex + bytesPerRow.
  1047         dstIndex := dstIndex - bytesPerRow.
  1049         dstIndex := dstIndex - bytesPerRow.
  1048     ].
  1050     ].
       
  1051 
       
  1052     inDepth == 32 ifTrue:[
       
  1053         srcIndex := 1.
       
  1054         1 to:height do:[:row |
       
  1055             1 to:width do:[:row |
       
  1056                 |b1 b2 b3 b4|
       
  1057                 b1 := tmp at:srcIndex.
       
  1058                 b2 := tmp at:srcIndex+1.
       
  1059                 b3 := tmp at:srcIndex+2.
       
  1060                 b4 := tmp at:srcIndex+3.
       
  1061                 tmp at:srcIndex put:b3.
       
  1062                 tmp at:srcIndex+2 put:b1.
       
  1063                 
       
  1064                 srcIndex := srcIndex + 4.
       
  1065             ].
       
  1066         ].
       
  1067     ].
       
  1068 
  1049     rawData := tmp.
  1069     rawData := tmp.
  1050 
  1070 
  1051     nColor > 0 ifTrue:[
  1071     nColor > 0 ifTrue:[
  1052         photometric := #palette.
  1072         photometric := #palette.
  1053         samplesPerPixel := 1.
  1073         samplesPerPixel := 1.
  1316 ! !
  1336 ! !
  1317 
  1337 
  1318 !WindowsIconReader class methodsFor:'documentation'!
  1338 !WindowsIconReader class methodsFor:'documentation'!
  1319 
  1339 
  1320 version
  1340 version
  1321     ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.68 2014-11-26 12:45:44 cg Exp $'
  1341     ^ '$Header$'
  1322 !
  1342 !
  1323 
  1343 
  1324 version_CVS
  1344 version_CVS
  1325     ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.68 2014-11-26 12:45:44 cg Exp $'
  1345     ^ '$Header$'
  1326 ! !
  1346 ! !
  1327 
  1347 
  1328 
  1348 
  1329 WindowsIconReader initialize!
  1349 WindowsIconReader initialize!