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.

TDA2EG: draw2d Issue

Part Number: TDA2EG

Hi

     I am studying how to draw some custom image to the display device.

     And i found the related sources are at "vision_sdk\apps\src\rtos\draw2d". For example, if a Jeep image is needed in the surround view, the Draw2D_getBmpProperty14 function of draw2d_jeep_Image_228x432.c will be called.

     So if i want to draw something custom, i can write the draw2d***.c just like draw2d_jeep_Image_228x432.c. Here i have some question about draw2d_jeep_Image_228x432.c:

     Q1: I think the key of draw2d is to set the "gDraw2D_Bmp" array. So what does the members of "gDraw2D_Bmp" array stands for? the RGB value of per pixel?  

     Q2: If i have a image file, what the value of its "gDraw2D_Bmp" array should be? how to get these value?

Thanks

xuanbo

  • 13-mar: Assign to Shiju. Regards, Yordan
  • Hi

    <1>
    yes, its the RGB value of per pixel
    please note that VSDK we support only 2 RGB format for graphic planes
    SYSTEM_DF_BGR16_565 or SYSTEM_DF_BGRA16_4444

    <2>
    You can convert any .png or .bmp images to this format by using certain tools (convert, image_convert & bin2c)
    steps as below

    Sample example to convert .png file to C array.

    convert image.png image.rgb
    image_convert -i image.rgb rgb888i 220 75 220 -o image.rgb565 rgb565 220
    bin2c image.rgb565 > image_white.h

    "220" is the image width in pixels
    "75" is the height in pixels
    The third parameter is the line offset, which is usually but not always the same like the width.
    Parameters "220 75 220" of image_convert have to be adjusted to the geometry of the image.

    copy from .h files to gDraw2D_Bmp of .c file
    static const unsigned char gDraw2D_Bmp[] =
    {
    ::::::::::::::::::::::
    }

    These tools will be included in next VSDK 3.3 release (Mid-April 2018)


    regards, Shiju
  • Hi

    <1>
    yes, its the RGB value of per pixel
    please note that VSDK we support only 2 RGB format for graphic planes
    SYSTEM_DF_BGR16_565 or SYSTEM_DF_BGRA16_4444

    <2>
    You can convert any .png or .bmp images to this format by using certain tools (convert, image_convert & bin2c)
    steps as below

    Sample example to convert .png file to C array.

    convert image.png image.rgb
    image_convert -i image.rgb rgb888i 220 75 220 -o image.rgb565 rgb565 220
    bin2c image.rgb565 > image_white.h

    "220" is the image width in pixels
    "75" is the height in pixels
    The third parameter is the line offset, which is usually but not always the same like the width.
    Parameters "220 75 220" of image_convert have to be adjusted to the geometry of the image.

    copy from .h files to gDraw2D_Bmp of .c file
    static const unsigned char gDraw2D_Bmp[] =
    {
    ::::::::::::::::::::::
    }

    These tools will be included in next VSDK 3.3 release (Mid-April 2018)


    regards, Shiju
  • Hi Shiju

    Thank you for your explaination.
    I will wait for the release of VSDK 3.3.

    Thanks
    xuanbo