<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"><br>
<br>
<br>
On 8/5/12 4:30 AM, Bob Arning wrote:<br>
</div>
<blockquote cite="mid:501E5942.1030706@comcast.net" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<font face="Georgia">Maybe the VM folks will see the value in
adding this or maybe you could write a plugin. </font></blockquote>
Actually, I've been looking at the BitBltPlugin.c source (it
apparently isn't written in slang?) but...<br>
<br>
<br>
you've saved me a lot of time (and saved me from my ADHD
distraction) with this.<br>
<br>
Thanks!<br>
<br>
L<br>
<br>
<blockquote cite="mid:501E5942.1030706@comcast.net" type="cite"><font
face="Georgia">Barring that, this speeds things up quite a bit
over the naive implementation:<br>
<br>
test2<br>
"<br>
BobsColorTest new test2<br>
"<br>
| target cmap1 inputData cmap2 nextPV cmap3 inputDataBits
targetBits results t forceAlpha preAlloc |<br>
<br>
inputData _ Form extent: 800@800 depth: 32.<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 bitAnd: 16rffffff).<br>
].<br>
].<br>
forceAlpha _ 16rff000000.<br>
cmap1 _ Bitmap new: 256*256*256.<br>
1 to: cmap1 size do: [:i | cmap1 at: i put:( i \\ 65536 *
256 + 1 bitOr: forceAlpha)].<br>
cmap2 _ Bitmap new: 256*256*256.<br>
1 to: cmap2 size do: [:i | cmap2 at: i put: (i - 1 \\ 256 +
1 bitOr: forceAlpha)].<br>
cmap3 _ Bitmap new: 256*256*256.<br>
1 to: cmap3 size do: [:i | cmap3 at: i put: (i - 1 bitOr:
forceAlpha)].<br>
<br>
preAlloc _ {cmap1. cmap2. cmap3} collect: [ :map |<br>
{map. Form extent: inputData extent depth: inputData
depth}<br>
].<br>
t _ [<br>
results _ preAlloc collect: [ :pair |<br>
target _ pair second.<br>
targetBits _ target bits.<br>
inputDataBits _ inputData bits.<br>
1 to: targetBits size do: [ :i |<br>
targetBits at: i put: (pair first at:
(inputDataBits at: i) +1) <br>
].<br>
target<br>
].<br>
] timeToRun.<br>
results do: [ :each |<br>
each asMorph openInWorld.<br>
].<br>
self inform: t asString,'ms to map ',results size asString,'
times'.<br>
<br>
Cheers,<br>
Bob</font></blockquote>
<br>
<br>
<br>
<blockquote cite="mid:501E5942.1030706@comcast.net" type="cite">--
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>
</blockquote>
</body>
</html>