<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>
        &nbsp;&nbsp;&nbsp; | target cmap1 inputData cmap2 nextPV cmap3 inputDataBits
        targetBits results t forceAlpha preAlloc |<br>
        &nbsp;&nbsp;&nbsp; <br>
        &nbsp;&nbsp;&nbsp; inputData _ Form extent: 800@800 depth: 32.<br>
        &nbsp;&nbsp;&nbsp; nextPV _ 1.<br>
        &nbsp;&nbsp;&nbsp; 0 to: 799 do: [ :x |<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 0 to: 799 do: [ :y |<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; inputData pixelValueAt: x@y put: ((nextPV _ nextPV +
        1) \\ 30000 bitAnd: 16rffffff).<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].<br>
        &nbsp;&nbsp;&nbsp; ].<br>
        &nbsp;&nbsp;&nbsp; forceAlpha _ 16rff000000.<br>
        &nbsp;&nbsp;&nbsp; cmap1 _&nbsp; Bitmap new: 256*256*256.<br>
        &nbsp;&nbsp;&nbsp; 1 to: cmap1 size do: [:i | cmap1 at: i put:( i&nbsp; \\ 65536 *
        256 + 1 bitOr: forceAlpha)].<br>
        &nbsp;&nbsp;&nbsp; cmap2 _&nbsp; Bitmap new: 256*256*256.<br>
        &nbsp;&nbsp;&nbsp; 1 to: cmap2 size do: [:i | cmap2 at: i put: (i - 1 \\ 256 +
        1 bitOr: forceAlpha)].<br>
        &nbsp;&nbsp;&nbsp; cmap3 _&nbsp; Bitmap new: 256*256*256.<br>
        &nbsp;&nbsp;&nbsp; 1 to: cmap3 size do: [:i | cmap3 at: i put: (i - 1 bitOr:
        forceAlpha)].<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
        &nbsp;&nbsp;&nbsp; preAlloc _ {cmap1. cmap2. cmap3} collect: [ :map |<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {map. Form extent: inputData extent depth: inputData
        depth}<br>
        &nbsp;&nbsp;&nbsp; ].<br>
        &nbsp;&nbsp;&nbsp; t _ [<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; results _ preAlloc collect: [ :pair |<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; target _ pair second.<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; targetBits _ target bits.<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; inputDataBits _ inputData bits.<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 1 to: targetBits size do: [ :i |<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; targetBits at: i put: (pair first at:
        (inputDataBits at: i) +1) <br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; target<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].<br>
        &nbsp;&nbsp;&nbsp; ] timeToRun.<br>
        &nbsp;&nbsp;&nbsp; results do: [ :each |<br>
        &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; each&nbsp; asMorph openInWorld.<br>
        &nbsp;&nbsp;&nbsp; ].<br>
        &nbsp;&nbsp;&nbsp; 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&amp;feature=view_all">https://www.youtube.com/playlist?list=PL6601A198DF14788D&amp;feature=view_all</a>
    </blockquote>
  </body>
</html>