<br><font size=2 face="sans-serif">Hi Rob, Bert, Jack:</font>
<br>
<br><font size=2 face="sans-serif">Form asGrayScale actually does extract the green component from 32 bit forms, or converts a lower depth Form to a 32 bit form and then extracts the green component. &nbsp;It is NOT however, a single BitBlt call. &nbsp;It does a copyBits for each column, and some fancy form/bitmap substituion to treat the 32 bit form as if it were an 8 bit form four times as wide. &nbsp;How would you accomplish this with only a &quot;single BitBlt call&quot;?</font>
<br>
<br><font size=2 face="sans-serif">Also, I timed my Form&gt;&gt;yComponent example against Form&gt;&gt;asGrayScale. &nbsp;Not surprisingly, Form&gt;&gt;asGrayScale is about 133 times faster. &nbsp;I may try optimizing mine using Form&gt;&gt;asGrayScale's trick of making a 32 bit form out of any form and then just extracting the RGB bits from the 32 bit pixelValues. &nbsp;That would eliminate all the Color object allocations (2 per pixel), which should speed it up a bit, but I don't know if I can get 133x from that. &nbsp;Ok... I tried it. &nbsp;It's only good for about a 5x speedup. &nbsp;Maybe I'll dabble with it more later, but it will probably need to be a primitive to get anywhere close to fast enough for video.</font>
<br>
<br><font size=2 face="sans-serif">Rob, just a caveat using Form&gt;&gt;asGrayScale - It is an approximation. &nbsp;I tried it using a workspace as the test bitmap, and the selected text didn't come out as selected because with default colors, selected text is black on a bright green and the background is bright white. &nbsp;This leads to what looks like no selected text in the grayscale version, where the &quot;properly&quot; calculated Form&gt;&gt;yComponent method does show the selected text as black on medium gray.</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Dean</font>
<br>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Bert Freudenberg &lt;bert@impara.de&gt;</b></font>
<br><font size=1 face="sans-serif">Sent by: squeak-dev-bounces@lists.squeakfoundation.org</font>
<p><font size=1 face="sans-serif">07/21/04 06:02 AM</font>
<br><font size=1 face="sans-serif">Please respond to The general-purpose Squeak developers list</font>
<br>
<td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;The general-purpose Squeak developers list &lt;squeak-dev@lists.squeakfoundation.org&gt;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Re: Using video input in Squeak</font></table>
<br>
<br>
<br><font size=2 face="Courier New"><br>
Am 20.07.2004 um 20:53 schrieb Jack Johnson:<br>
<br>
&gt; I can't help you with the implementation details, but I can tell you<br>
&gt; that in order to generate B&amp;W, most people will average the RGB to get<br>
&gt; an 8-bit grayscale value. &nbsp;The overhead of this for a live video feed<br>
&gt; can be noticeable, and you'll find that for most video systems if you<br>
&gt; just take the values for green and compose a B&amp;W image from it, the<br>
&gt; contrast will be more what you would want or expect from B&amp;W video.<br>
<br>
Yep, this can be very efficiently done in a single BitBlt call (mapping <br>
green component directly into black or white). See ColorMap&gt;&gt;mapPixel:, <br>
which is what the bitblt primitive does for each pixel when you set an <br>
instance of ColorMap as the bitblt's colorMap.<br>
<br>
- Bert -<br>
<br>
<br>
</font>
<br>
<br>