16 instanceVariableNames:'pass xpos ypos rowByteSize remainBitCount bufByte bufStream |
16 instanceVariableNames:'pass xpos ypos rowByteSize remainBitCount bufByte bufStream |
17 prefixTable suffixTable clearCode eoiCode freeCode codeSize |
17 prefixTable suffixTable clearCode eoiCode freeCode codeSize |
18 maxCode interlace frameDelay iterationCount leftOffs topOffs' |
18 maxCode interlace frameDelay iterationCount leftOffs topOffs' |
19 classVariableNames:'ImageSeparator Extension Terminator' |
19 classVariableNames:'ImageSeparator Extension Terminator' |
20 poolDictionaries:'' |
20 poolDictionaries:'' |
21 category:'Graphics-Images-Support' |
21 category:'Graphics-Images-Readers' |
22 ! |
22 ! |
23 |
23 |
24 !GIFReader class methodsFor:'documentation'! |
24 !GIFReader class methodsFor:'documentation'! |
25 |
25 |
26 copyright |
26 copyright |
455 makeGreyscale |
455 makeGreyscale |
456 "not yet implemented/needed" |
456 "not yet implemented/needed" |
457 ! |
457 ! |
458 |
458 |
459 readColorMap:colorMapSize |
459 readColorMap:colorMapSize |
460 "get gif colormap consisting of colorMapSize entries" |
460 "get a gif colormap consisting of colorMapSize entries" |
461 |
461 |
462 |sz "{ Class: SmallInteger }" |
462 |rgbVector| |
463 redMap greenMap blueMap| |
463 |
464 |
464 rgbVector := inStream nextBytes:colorMapSize*3. |
465 redMap := ByteArray uninitializedNew:colorMapSize. |
465 ^ Colormap rgbVector:rgbVector |
466 greenMap := ByteArray uninitializedNew:colorMapSize. |
466 |
467 blueMap := ByteArray uninitializedNew:colorMapSize. |
467 "/ |sz "{ Class: SmallInteger }" |
468 |
468 "/ redMap greenMap blueMap| |
469 sz := colorMapSize. |
469 "/ |
470 1 to:sz do:[:i | |
470 "/ redMap := ByteArray uninitializedNew:colorMapSize. |
471 redMap at:i put:(inStream nextByte). |
471 "/ greenMap := ByteArray uninitializedNew:colorMapSize. |
472 greenMap at:i put:(inStream nextByte). |
472 "/ blueMap := ByteArray uninitializedNew:colorMapSize. |
473 blueMap at:i put:(inStream nextByte) |
473 "/ |
474 ]. |
474 "/ sz := colorMapSize. |
475 |
475 "/ 1 to:sz do:[:i | |
476 ^ Colormap |
476 "/ redMap at:i put:(inStream nextByte). |
477 redVector:redMap |
477 "/ greenMap at:i put:(inStream nextByte). |
478 greenVector:greenMap |
478 "/ blueMap at:i put:(inStream nextByte) |
479 blueVector:blueMap. |
479 "/ ]. |
480 |
480 "/ |
|
481 "/ ^ Colormap |
|
482 "/ redVector:redMap |
|
483 "/ greenVector:greenMap |
|
484 "/ blueVector:blueMap. |
481 "Modified: 21.6.1996 / 12:32:43 / cg" |
485 "Modified: 21.6.1996 / 12:32:43 / cg" |
482 ! |
486 ! |
483 |
487 |
484 readExtension:aStream |
488 readExtension:aStream |
485 "get gif89 extension" |
489 "get gif89 extension" |