This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

simplest code to display an image on dm355 dvevm

Please can anyone provide me a simple code to display a black-and-white image on the analod output of the board?

the image is stored in memory as a matrix of chars.

I tried to understant how to do this whit the v4l2-loop example without success. I also read the spruel3, but i can't make a working code with it.

  • On DM355, dideo data passed the the OSD hardware for display purposes is normally in YCbCr 422 16-bit format (default); the Y component is the back and white portion of the image while the other components (chroma-red for Cr and crhoma-blue for Cb) provide the color information.  Therefore, if all you are interested in is black and white, you will need to do away with the color information present in the Cb and Cr components.  So, how do you do this?

    Well, each 16-bit YCbCr 422 pixel in DM355 is represented by 8-bits of Y and 8-bits of either Cb or Cr (e.g. bytes arranged as Y-Cb-Y-Cr-Y-Cb-Y-Cr... in memory); what we really want to do to achieve a black and white image is to set Cb and Cr bytes to have a constant value of 128 (color black for these components), while keeping Y component (luminance) which provides the shade value (0 for black to 255 for white).  Therefore, if you have a color image to start from, keep Y component as-is, and replace all Cr and Cr bytes to have a value of 128 (may be able to use resizer to help do this in hardware)

    FYI, if you were doing this via digital outputs, it may be as simple as tying the Cr and Cr signals high or low to produce 128 value; however, since you are interested in analog, the only way I see of doing this is to overwrite the Cb and Cr values in memory before transferring data for display.

  • You may want to take a look at the DMAI video display example which shows how to display color bars. I suspect it won't be difficult to modify for your purposes.

    dmai_x_xx/packages/ti/sdo/dmai/apps/video_display/

  • additionally, if you just want to display the black and white image and do not really care about having a program to do so, you may want to see the following App Note which shows you how to display a image created in GIMP (a drawing tool similar to windows paint) by typing a few linux commands.

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraad7