<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Thanks, that works.<br>
<br>
Though I think the usecase of the ability to swiftly switch
palettes is of value, even in 32 bit forms.<br>
<br>
form>>mapColor:to: and mapColors:to should be able to use a
full 32 bit color. The bitblt docs say that only 5 bits of the
Color object's RGB values are used no matter the depth of the
destination form. This is a serious limitation for anyone hoping
to prototype/implement a modern image-oriented application.<br>
<br>
Cairo no doubt changes this, but Cairo also violates the port
anywhere paradigm that Squeak is based on, I think.<br>
<br>
L<br>
<br>
<br>
<br>
<br>
On 8/4/12 8:34 AM, Bob Arning wrote:<br>
</div>
<blockquote cite="mid:501D411B.10008@comcast.net" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<font face="Georgia">You could try something like this:<br>
<br>
test1<br>
"<br>
BobsColorTest new test1<br>
"<br>
| target cmap1 inputData cmap2 nextPV cmap3 |<br>
<br>
inputData _ Form extent: 800@800 depth: 16.<br>
nextPV _ 1.<br>
0 to: 799 do: [ :x |<br>
0 to: 799 do: [ :y |<br>
inputData pixelValueAt: x@y put: (nextPV _ nextPV +
1) \\ 30000.<br>
].<br>
].<br>
cmap1 _ Bitmap new: 32768.<br>
1 to: cmap1 size do: [:i | cmap1 at: i put: i \\ 1023 * 32
+ 1].<br>
cmap2 _ Bitmap new: 32768.<br>
1 to: cmap2 size do: [:i | cmap2 at: i put: i - 1 \\ 32 +
1].<br>
cmap3 _ Bitmap new: 32768.<br>
1 to: cmap3 size do: [:i | cmap3 at: i put: i - 1].<br>
<br>
{cmap1. cmap2. cmap3} do: [ :map |<br>
target _ Form extent: inputData extent depth: inputData
depth.<br>
(BitBlt current toForm: target)<br>
sourceForm: inputData;<br>
sourceOrigin: 0@0;<br>
combinationRule: Form paint;<br>
destX: 0 destY: 0 width: inputData width height:
inputData height;<br>
colorMap: map;<br>
copyBits.<br>
target asMorph openInWorld.<br>
].<br>
<br>
Cheers,<br>
Bob<br>
<br>
</font>
<div class="moz-cite-prefix">On 8/3/12 7:30 PM, Lawson English
wrote:<br>
</div>
<blockquote cite="mid:501C5F23.202@cox.net" type="cite">OK, I'm
such a noob here, that I'm not quite sure how to ask my
question... <br>
<br>
<br>
I have a "dwell file" -an array of values generated by a
Mandelbrot Set application, one per pixel, with arbitrary values
between 1 and xxxxxxxxxxx (currently less than 2 billion, and
right now far less than 1,000,000)- and I would like to use
them, suitably tweaked, as indices into a ColorMap. The ColorMap
need not have 1,000,000 entries. No-one can see that many color
differences in a Mandelbrot set anyway. <br>
<br>
I can generate an array of Color (ColorArray?) but I'm not sure
how to use them to create the ColorMap, and I'm not sure how to
use the ColorMap to speedily change what is drawn in the first
place. <br>
<br>
Right now, I'm creating a color dictionary and drawing via: <br>
<br>
<br>
1 to: 800 do: [:y| <br>
1 to: 800 do: [:x| |i| <br>
i := x+ ((y-1) *800). aForm colorAt: x@y put:(
myDictColors at: (myArray at: i )).] <br>
]. <br>
<br>
<br>
where myDictColors is a dictionary whose keys are the dwells
listed in the dwell array file and whose values are Color
objects from my array of colors. <br>
<br>
Drawing the above takes about 1.5 seconds, which is a bit slow.
I'd like realtime-ish updating as I play with colors in the
palette. Can this be done, at least up to the 4096 color limit
that BitBlt has for ColorMaps? <br>
<br>
If so, how? I've been trying to figure out the various classes
and I'm stumped. <br>
<br>
<br>
Thanks <br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Squeak from the very start (introduction to Squeak and Pharo Smalltalk for the (almost) complete and compleate beginner).
<a class="moz-txt-link-freetext" href="https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all">https://www.youtube.com/playlist?list=PL6601A198DF14788D&feature=view_all</a> </pre>
</body>
</html>