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.

bmp2c utility in Starterware

Other Parts Discussed in Thread: OMAPL138

Hi,

I am using LCDK c6748, getting idea from the earlier post, I have converted 512x512 bmp image into a header file, but the converted file is too big and puts the CCSv6 to unresponding mode. So, I resize the image to 64x64, but the converted header file when used in raster display example from starterware does not display the image on LCD.

So, I jump to another utility bmp2c, but the converted format is not compatible with the code, it shows error as....

 IMAGE_FMT_16BPP_UNCOMP is undefined

I wanted to know what this identifier is and where it has to be defined, so that I can use the converted raw data with raster example.Also, the pixel values are not in 16 bit format, they are in 8 bit format. 

The raster example as provided in starterware has an array of raw data which displays starterware image on the LCD, how can I display any bmp image using raster example?

Regards

Rohit

  • Hi Rohit,
    Have you tried "bmpToRaster" tool for raster example code ?
    Please refer to the following readme doc for bmp2c tool.
    C:\ti\OMAPL138_StarterWare_1_10_04_01\tools\bmp2c\README.txt

    Which mode are you using (8bit or 16bit) for bmp2c tool ?
    Could you try 16bit mode if not used.
  • Hi Shankari,


    Have you tried "bmpToRaster" tool for raster example code ?

    Yes, I have used bmp2raster tool, the problem is that the converted array(header file) is very big(I used 512x512 bmp image), hence CCS takes a very long time, and goes to unresponding mode. If I convert the pixel size to 64x64using MSPaint for the same bmp image, then I get a smaller array but it does not display image on the LCD, the screen rather flickers.

    Please refer to the following readme doc for bmp2c tool.
    C:\ti\OMAPL138_StarterWare_1_10_04_01\tools\bmp2c\README.txt 

    Which mode are you using (8bit or 16bit) for bmp2c tool ?
    Could you try 16bit mode if not used.

    Yes, I have tried bmp2C tool, it generates an array in C, and I use 16 bit mode because read me file tells that 16 bit mode is used for raster example. Now the generated array contains an identifier...IMAGE_FMT_16BPP_UNCOMP,

    For Example

    const unsigned char image[] =
    {
    IMAGE_FMT_16BPP_UNCOMP,
    64, 0,
    64, 0,
    0x14,0xa5,0xf3,0x9c,0xd3,0x9c,0xd3,0x9c,0xf3,0x9c,0x75,0xad,0x75,0xad,0x30,0x84,

    ......................................................................

    .......................................................................

    };

    This identifier is not defined elsewhere and generates an error on compilation, I need to know what should be the definition for this identifier.?

    My another question is "which tool was used to generate raw data array for the raster example in starterware???"

  • Hi Rohit,

    You will find the definition of "IMAGE_FMT_16BPP_UNCOMP" in grlib.h located at "~\ti\C6748_StarterWare_1_20_04_01\grlib\include"

    //*****************************************************************************
    //
    //! Indicates that the image data is compressed and represents each pixel with
    //! eight bits.
    //
    //*****************************************************************************
    #define IMAGE_FMT_8BPP_COMP     0x88
    
    #define IMAGE_FMT_16BPP_UNCOMP   0x10
    #define IMAGE_FMT_16BPP_COMP     0x90
    
    #define IMAGE_FMT_24BPP_UNCOMP   0x20
    #define IMAGE_FMT_24BPP_COMP     0xA0
    

    Try including this grlib.h in your project

  • Hi

    The error has gone and I can now build the raster example with the new image array, but still it does not does not display anything on the VGA SCREEN.The raster example by default has an image array, which displays Starterware Logo on the VGA SCreen.

    The image which I want to display is 128x128 24-bit bmp. I cannot go for more pixels because the converted array gets too big and sends CCS into unresponding.
    I have tried both the bmp2c and bmp2raster utilities, but the converted image array does not display anything on VGA screen. What else should I take care of?
  • Hi Rohit,

    I have used 640x480 image to display it on VGA display using raster example.

    I'm able to convert the bmp image to C array using "bmp2c" tool and able to display that image using raster example.

    I've attached the bmp image and C array file used.

    image.h

    Command used:

    mono bmp2c.exe -16 E2E.bmp image.h

  • Hi Shankari

    Thanks for sharing....why have you used "mono" in the command, also do I specifically need to use 640x480 images?
  • Hi Rohit,

    I have ran this tool in Linux so, I used mono, if you are using that tool in windows, you can remove "mono".

    >bmp2c.exe -16 E2E.bmp image.h

    Yes, we need to create an image of size ( 640x480 ) for converting since LCDK board has video output through VGA (640x480) display.

    Also, you can check the following code in raster example which mentions 640x480 resolution.

    /* configuring horizontal timing parameter */
    RasterHparamConfig(SOC_LCDC_0_REGS, 640, 64, 48, 48);

    /* configuring vertical timing parameters */
    RasterVparamConfig(SOC_LCDC_0_REGS, 480, 2, 11, 31);

    FYI: I have used the following online photo editor to create a 640x480 custom image.

    http://www.toolpic.com

  • Hi Shankari,

    Thanks for the detailed post, finally it worked..
  • Hi Rohit,

    Good. Glad to hear.