Shop OBEX P1 Docs P2 Docs Learn Events
Display bitmap on VGA monitor — Parallax Forums

Display bitmap on VGA monitor

PropNewbiePropNewbie Posts: 10
edited 2008-05-07 23:55 in Propeller 1
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

Comments

  • RaymanRayman Posts: 14,355
    edited 2008-05-07 23:21
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-05-07 23:55
    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
    Propeller Applications Engineer

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 5/8/2008 12:03:50 AM GMT
Sign In or Register to comment.