'From Squeak3.1alpha of 4 February 2001 [latest update: #3807] on 7 March 2001 at 1:31:20 am'! "Change Set: JPEGTweaks4 Date: 7 March 2001 Author: Andreas Raab Forgot to include this method in the last CS."! !JPEGReadWriter methodsFor: 'public access' stamp: 'ar 3/7/2001 01:27'! nextImageDitheredToDepth: depth | form xStep yStep x y bb | ditherMask _ DitherMasks at: depth ifAbsent: [self error: 'can only dither to display depths']. residuals _ WordArray new: 3. sosSeen _ false. self parseFirstMarker. [sosSeen] whileFalse: [self parseNextMarker]. form _ Form extent: (width @ height) depth: 32. bb _ BitBlt current toForm: form. bb sourceForm: mcuImageBuffer. bb sourceRect: mcuImageBuffer boundingBox. bb combinationRule: Form over. xStep _ mcuWidth * DCTSize. yStep _ mcuHeight * DCTSize. y _ 0. 1 to: mcuRowsInScan do: [:row | x _ 0. 1 to: mcusPerRow do: [:col | self decodeMCU. self idctMCU. self colorConvertMCU. bb destX: x; destY: y; copyBits. x _ x + xStep]. y _ y + yStep]. ^ form! !