The comment in Form>>copyWithColorsReducedTo: Note: this has not been engineered. There are better solutions in the literature.
I bet we could do it with less than 4GB of memory!
Read in a 54x60 GIF file as a SketchMorph. Choose painting.../reduce color palette/2 (same with 3). My desktop is in 32-bit depth. The corner pixels of the image are transparent.
The SketchMorph's instVars look like:
bounds: 426@462 corner: 480@522 owner: a PasteUpMorph(1622) [world] submorphs: #() fullBounds: 426@462 corner: 480@522 color: Color blue extension: a MorphExtension (372) [other: (rotationCenter -> 0.5@0.5) (forwardDirection -> 0.0) (rememberedColor -> (Color r: 0.972 g: 0.815 b: 0.976)) (baseGraphic -> Form(54x60x32))] originalForm: Form(54x60x32) rotationStyle: #normal scalePoint: 1.0@1.0 framesToDwell: 1 rotatedForm: Form(54x60x32)
31 March 2002 3:59:35 pm
VM: unix - Squeak3.2gamma of 15 January 2002 [latest update: #4743] Image: Squeak3.2gamma [latest update: #4811]
SystemDictionary>>signalLowSpace Receiver: a SystemDictionary(lots of globals) Arguments and temporary variables:
Receiver's instance variables: tally: 2048 array: #(nil #MIDISynth nil #CArrayAccessor #BalloonEngineSimulation #ScorePlay...etc... cachedClassNames: a SortedCollection(#ADPCMCodec #ADPCMCodecPlugin #AEDesc #AGe...etc...
Array class(Behavior)>>basicNew: Receiver: Array Arguments and temporary variables: sizeRequested: 4294967296 Receiver's instance variables: superclass: ArrayedCollection methodDict: a MethodDictionary(#asArray->a CompiledMethod (141) #atWrap:->a Com...etc... format: 6402 instanceVariables: nil organization: ('comparing' hashMappedBy:) ('converting' asArray elementsExchang...etc... subclasses: #(WeakArray FlippyArray2 DependentsArray ActionSequence) name: #Array classPool: a Dictionary() sharedPools: nil environment: nil category: nil
Array class(Behavior)>>new: Receiver: Array Arguments and temporary variables: sizeRequested: 4294967296 Receiver's instance variables: superclass: ArrayedCollection methodDict: a MethodDictionary(#asArray->a CompiledMethod (141) #atWrap:->a Com...etc... format: 6402 instanceVariables: nil organization: ('comparing' hashMappedBy:) ('converting' asArray elementsExchang...etc... subclasses: #(WeakArray FlippyArray2 DependentsArray ActionSequence) name: #Array classPool: a Dictionary() sharedPools: nil environment: nil category: nil
Interval>>collect: Receiver: (1 to: 4294967296) Arguments and temporary variables: aBlock: [] in Form>>copyWithColorsReducedTo: nextValue: nil result: nil i: nil iLimiT: nil Receiver's instance variables: start: 1 stop: 4294967296 step: 1
--- The rest of the stack --- Form>>copyWithColorsReducedTo: SketchMorph>>reduceColorPalette: [] in MenuItemMorph>>invokeWithEvent: BlockContext>>ensure: CursorWithMask(Cursor)>>showWhile: MenuItemMorph>>invokeWithEvent: MenuItemMorph>>mouseUp: MenuItemMorph>>handleMouseUp: MouseButtonEvent>>sentTo: MenuItemMorph(Morph)>>handleEvent: MorphicEventDispatcher>>dispatchDefault:with: MorphicEventDispatcher>>dispatchEvent:with: MenuItemMorph(Morph)>>processEvent:using: MorphicEventDispatcher>>dispatchDefault:with: MorphicEventDispatcher>>dispatchEvent:with: MenuMorph(Morph)>>processEvent:using: MenuMorph(Morph)>>processEvent: MenuMorph>>handleFocusEvent: [] in HandMorph>>sendFocusEvent:to:clear: PasteUpMorph>>becomeActiveDuring: HandMorph>>sendFocusEvent:to:clear: HandMorph>>sendEvent:focus:clear: HandMorph>>sendMouseEvent: HandMorph>>handleEvent: HandMorph>>processEvents [] in WorldState>>doOneCycleNowFor: Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: PasteUpMorph>>doOneCycle [] in Project class>>spawnNewProcess [] in BlockContext>>newProcess
squeak-dev@lists.squeakfoundation.org