[squeak-dev] Bug in Form>>#asFormOfDepth:?
Thiede, Christoph
Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Sep 9 11:25:33 UTC 2019
Hi all,
consider the following example (print it):
"Example 1"
f := Form extent: 1 asPoint depth: 1.
f colorAt: 0 @ 0 put: Color red.
g := f asFormOfDepth: 2.
g colorAt: 0 @ 0
Expected output: Color red.
Actual output: Color black!
Other examples:
"Example 2"
f := Form extent: 1 asPoint depth: 1.
f colorAt: 0 @ 0 put: Color red.
g := f asFormOfDepth: 32.
g colorAt: 0 @ 0 "--> (Color r: 0.0 g: 0.0 b: 0.004)"
"Example 3"
f := Form extent: 1 asPoint depth: 16.
f colorAt: 0 @ 0 put: Color red.
g := f asFormOfDepth: 32.
g colorAt: 0 @ 0 "--> (Color r: 0.973 g: 0.0 b: 0.0)"
I am not familiar with color depths, but afaik Color red could be stored exactly using only 1 bit? Do I misunderstand the concept or is this really a bad output?
(I came across to this when performing #collectColors: on an 8 bit ColorForm loaded from disk, which did not work as expected.)
Best,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190909/65d67ad8/attachment.html>
More information about the Squeak-dev
mailing list
|