[squeak-dev] The Trunk: Graphics-kfr.527.mcz
karl ramberg
karlramberg at gmail.com
Sat Jul 2 09:45:03 UTC 2022
Thanks,
Add http://source.squeak.org/inbox/Morphic-kfr.2015.mcz as well. Then we
have restored all functionality :-D
Best, Karl
On Sat, Jul 2, 2022 at 9:45 AM <commits at source.squeak.org> wrote:
> Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-kfr.527.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-kfr.527
> Author: kfr
> Time: 1 July 2022, 7:15:00.033758 pm
> UUID: 45123247-99ec-da41-b9a2-a3680dfe2f66
> Ancestors: Graphics-kfr.526
>
> We can't reduce color of 32 bit depth directly.
> Convert to 16 bits first to get around problem.
>
> =============== Diff against Graphics-kfr.526 ===============
>
> Item was changed:
> ----- Method: Form>>copyWithColorsReducedTo: (in category 'converting')
> -----
> copyWithColorsReducedTo: nColors
> "Note: this has not been engineered.
> There are better solutions in the literature."
> | palette colorMap |
> + self depth > 16 ifTrue:[^(self asFormOfDepth: 16)
> copyWithColorsReducedTo: nColors]. "First reduce to 16 bit depth"
> - self depth > 16 ifTrue:[^self]."bail out. will cause problems on
> 32 bit depth forms"
> palette := self reducedPaletteOfSize: nColors.
> colorMap := (1 to: (1 bitShift: depth)) collect:
> [:i | | pc closest |
> pc := Color colorFromPixelValue: i-1 depth: depth.
> closest := palette detectMin: [:c | c diff: pc].
> closest pixelValueForDepth: depth].
> ^ self deepCopy copyBits: self boundingBox from: self at: 0 at 0
> colorMap: (colorMap as: Bitmap)
> !
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220702/3a1f78e9/attachment.html>
More information about the Squeak-dev
mailing list
|