PDA

View Full Version : Display bitmap on VGA monitor



PropNewbie
05-08-2008, 05:49 AM
Hi All

Newbie to·Prop programming - what I need to do is display a 160x255 bitmap on a VGA monitor. This bitmap contains RGB values in three bytes using 0-255 for each colour. This·is the output of a CMUCam2 and I would like to see the cmu cam output for diagnostic purposes. Obviously the 32Kb of the Propeller is not going to hold·it all·so I will have to trim the 8 bits per colour back a bit.

So assuming that I have the bitmap in memory - what would be the best of the existing·code to use for this purpose. I have seen the various·vga·driver·samples·and have got the demo versions of them working (except for the graphics one). I am new to vga·handling (as well as props) and the code seems to be designed for a variety of purposes. I would very much appreciate advice on which one would be best to use as a start point. All I want to do is take the colour reduced bitmap in the form of an array and call something which will tip it out to·a vga monitor.

All advice and·tips would be much appreciated.

Many thanks in advance

Rayman
05-08-2008, 07:21 AM
I've got a couple bitmap apps here:

http://www.rayslogic.com/propeller/Programming/Programming.htm

Paul Baker
05-08-2008, 07:55 AM
The native color scheme for the Propeller VGA scheme is 2 bits per color, so if you hack off the last 6 bits of each color value you should get a mapping into the Propeller's color space.

As you noted there isnt enough memory to hold the entire image, even in the reduced color space.·If you can somhow sync with the CMUcam so that you display it as it comes, you may be able to get around this. But I have a feeling it will be more trouble than it's worth. If you can output to a TV, you would have enough memory to hold the entire image (and double buffered), but you would have to create a color translation model to get it from the RGB to YIQ color space that NTSC is. This sounds more difficult than it is, the most straight forward method is to have a 64 entry table lookup that using the RGB color as an index into the table, you can fetch the corresponding YIQ color value.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

Post Edited (Paul Baker (Parallax)) : 5/8/2008 12:03:50 AM GMT