diff -r a708779d798c -r 454362f799f5 GIFReader.st --- a/GIFReader.st Tue Jun 06 06:04:53 1995 +0200 +++ b/GIFReader.st Tue Jun 06 06:07:55 1995 +0200 @@ -23,7 +23,7 @@ COPYRIGHT (c) 1991 by Claus Gittinger All Rights Reserved -$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.14 1995-05-03 00:02:53 claus Exp $ +$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.15 1995-06-06 04:06:59 claus Exp $ '! !GIFReader class methodsFor:'documentation'! @@ -44,7 +44,7 @@ version " -$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.14 1995-05-03 00:02:53 claus Exp $ +$Header: /cvs/stx/stx/libview2/GIFReader.st,v 1.15 1995-06-06 04:06:59 claus Exp $ " ! @@ -165,11 +165,11 @@ I hope later versions work too ..." (id ~= 'GIF87a') ifTrue:[ - (id startsWith:'GIF') ifFalse:[ - 'GIFReader: not a gif file' errorPrintNL. - ^ nil - ]. - 'GIFReader: not a GIF87a file - hope that works' errorPrintNL. + (id startsWith:'GIF') ifFalse:[ + 'GIFReader: not a gif file' errorPrintNL. + ^ nil + ]. + 'GIFReader: not a GIF87a file - hope that works' errorPrintNL. ]. "get screen dimensions (not used)" @@ -193,14 +193,14 @@ "get colorMap" hasColorMap ifTrue:[ - self readColorMap:colorMapSize + self readColorMap:colorMapSize ]. "image separator" byte := aStream nextByte. (byte ~~ 16r2C) ifTrue:[ - 'GIFReader: corrupted gif file (no imgSep)' errorPrintNL. - ^ nil + 'GIFReader: corrupted gif file (no imgSep)' errorPrintNL. + ^ nil ]. "get image data" @@ -223,12 +223,12 @@ "if image has a local colormap, this one is used" hasLocalColorMap ifTrue:[ - "local descr. overwrites" - bitsPerPixel := (flag bitAnd:2r00000111) + 1. - colorMapSize := 1 bitShift:bitsPerPixel. + "local descr. overwrites" + bitsPerPixel := (flag bitAnd:2r00000111) + 1. + colorMapSize := 1 bitShift:bitsPerPixel. " 'local colormap' printNewline. " - "overwrite colormap" - self readColorMap:colorMapSize + "overwrite colormap" + self readColorMap:colorMapSize ]. "get codelen for decompression" @@ -240,65 +240,65 @@ index := 1. count := aStream nextByte. [count notNil and:[count ~~ 0]] whileTrue:[ - aStream nextBytes:count into:compressedData startingAt:index. - index := index + count. - count := aStream nextByte + aStream nextBytes:count into:compressedData startingAt:index. + index := index + count. + count := aStream nextByte ]. compressedSize := index - 1. h := height. data := ByteArray new:((width + 1) * (h + 1)). - 'GIFReader: decompressing ...' errorPrintNL. + 'GIFReader: decompressing ...' infoPrintNL. self class decompressGIFFrom:compressedData - count:compressedSize - into:data - startingAt:1 - codeLen:(codeLen + 1). + count:compressedSize + into:data + startingAt:1 + codeLen:(codeLen + 1). interlaced ifTrue:[ - Transcript showCr:'deinterlacing'. - tmp := ByteArray new:(data size). + Transcript showCr:'deinterlacing'. + tmp := ByteArray new:(data size). - "phase 1: 0, 8, 16, 24, ..." + "phase 1: 0, 8, 16, 24, ..." - srcOffset := 1. - 0 to:(h - 1) by:8 do:[:dstRow | - dstOffset := dstRow * width + 1. - tmp replaceFrom:dstOffset to:(dstOffset + width - 1) - with:data startingAt:srcOffset. - srcOffset := srcOffset + width. - ]. + srcOffset := 1. + 0 to:(h - 1) by:8 do:[:dstRow | + dstOffset := dstRow * width + 1. + tmp replaceFrom:dstOffset to:(dstOffset + width - 1) + with:data startingAt:srcOffset. + srcOffset := srcOffset + width. + ]. - "phase 2: 4, 12, 20, 28, ..." + "phase 2: 4, 12, 20, 28, ..." - 4 to:(h - 1) by:8 do:[:dstRow | - dstOffset := dstRow * width + 1. - tmp replaceFrom:dstOffset to:(dstOffset + width - 1) - with:data startingAt:srcOffset. - srcOffset := srcOffset + width. - ]. + 4 to:(h - 1) by:8 do:[:dstRow | + dstOffset := dstRow * width + 1. + tmp replaceFrom:dstOffset to:(dstOffset + width - 1) + with:data startingAt:srcOffset. + srcOffset := srcOffset + width. + ]. - "phase 3: 2, 6, 10, 14, ..." + "phase 3: 2, 6, 10, 14, ..." - 2 to:(h - 1) by:4 do:[:dstRow | - dstOffset := dstRow * width + 1. - tmp replaceFrom:dstOffset to:(dstOffset + width - 1) - with:data startingAt:srcOffset. - srcOffset := srcOffset + width. - ]. + 2 to:(h - 1) by:4 do:[:dstRow | + dstOffset := dstRow * width + 1. + tmp replaceFrom:dstOffset to:(dstOffset + width - 1) + with:data startingAt:srcOffset. + srcOffset := srcOffset + width. + ]. - "phase 4: 1, 3, 5, 7, ..." + "phase 4: 1, 3, 5, 7, ..." - 1 to:(h - 1) by:2 do:[:dstRow | - dstOffset := dstRow * width + 1. - tmp replaceFrom:dstOffset to:(dstOffset + width - 1) - with:data startingAt:srcOffset. - srcOffset := srcOffset + width. - ]. + 1 to:(h - 1) by:2 do:[:dstRow | + dstOffset := dstRow * width + 1. + tmp replaceFrom:dstOffset to:(dstOffset + width - 1) + with:data startingAt:srcOffset. + srcOffset := srcOffset + width. + ]. - data := tmp. - tmp := nil + data := tmp. + tmp := nil ]. photometric := #palette. @@ -309,7 +309,7 @@ could make it a greyscale image if so (currently not done)" self checkGreyscaleColormap ifTrue:[ - self makeGreyscale + self makeGreyscale ]. colorMap := Colormap redVector:redMap greenVector:greenMap blueVector:blueMap.