Raw Image data | developer.brewmp.com Raw Image data | developer.brewmp.com

Developer

Raw Image data

Forums:

Hi Guys,

I have some raw image data in RGB565 format and width and height of the image.

I have to display it on Bitmap widget. Currently, I have written a function to convert it to a BMP file of RGB888 store it on file system and then I use ISHELL_LoadResBitmap to load the same into bitmap for displaying.

Since I use this method it is very slow, because it involves file operation read and write. Can you people suggest me a method to convert raw data directly to IBitmap format.

no there is no other way to convert 24 bit bitmap to 16bit bitmap.

no there is no other way to convert 24 bit bitmap to 16bit bitmap.

Actually the thing is like, I want to avoid writing it to the file using fetching it using ISHELL_LoadResBitmap(), because the file operation is time consuming and slowing down my animation.
Can I directly fill the IBitmap structure directly with the data like width, height, bpp, pointer to the actual data etc.

Actually the thing is like, I want to avoid writing it to the file using fetching it using ISHELL_LoadResBitmap(), because the file operation is time consuming and slowing down my animation.
Can I directly fill the IBitmap structure directly with the data like width, height, bpp, pointer to the actual data etc.

IBitmap * m_Bitmap;
write_bmp_header(iWidth,iHeight);
write_bmp_content(pRawData, iDataLen);
pBitmap = ISHELL_LoadResBitmap(pShell,OUTPUT_FILE,0);
I have the raw data. I want to write it directly fill the IBitmap structure with height, width, bpp and the data without directly writing it onto OUTPUT_FILE and then reading it with ISHELL_LoadResBitmap()

IBitmap * m_Bitmap;
write_bmp_header(iWidth,iHeight);
write_bmp_content(pRawData, iDataLen);
pBitmap = ISHELL_LoadResBitmap(pShell,OUTPUT_FILE,0);
I have the raw data. I want to write it directly fill the IBitmap structure with height, width, bpp and the data without directly writing it onto OUTPUT_FILE and then reading it with ISHELL_LoadResBitmap()

You can use the raw data as is using either IBitmap or IDIB structure. But you should be knowing how to fill them.

You can use the raw data as is using either IBitmap or IDIB structure. But you should be knowing how to fill them.

Either use IDIB or create a bmp file in memory and pass it to CONVERTBMP. If you don't really need IBitmap, you could probably copy your pixels directly to the screen on most handsets.

Either use IDIB or create a bmp file in memory and pass it to CONVERTBMP. If you don't really need IBitmap, you could probably copy your pixels directly to the screen on most handsets.

CONVERTBMP shouldn't be used, it is no better than DDB.
You can read the image file in a buffer, then use IImageDecoder API to decode image and get the IBitmap object. From IBitmap object you can get DIB pointer and do all the manipulation.

CONVERTBMP shouldn't be used, it is no better than DDB.
You can read the image file in a buffer, then use IImageDecoder API to decode image and get the IBitmap object. From IBitmap object you can get DIB pointer and do all the manipulation.

ruben wrote:CONVERTBMP shouldn't be used, it is no better than DDB.
Huh? It takes your image data, in memory, and creates a DDB with an IBitmap interface. (See the comments in the docs for IDISPLAY_BitBlt: "Starting with BREW 1.2, [...] CONVERTBMP() returns an IBitmap interface pointer.") It's possible that IDIB may be better in this case, but this is exactly what Nandan is asking for...

ruben wrote:CONVERTBMP shouldn't be used, it is no better than DDB.
Huh? It takes your image data, in memory, and creates a DDB with an IBitmap interface. (See the comments in the docs for IDISPLAY_BitBlt: "Starting with BREW 1.2, [...] CONVERTBMP() returns an IBitmap interface pointer.") It's possible that IDIB may be better in this case, but this is exactly what Nandan is asking for...

Quote:ruben says
You can read the image file in a buffer, then use IImageDecoder API to decode image and get the IBitmap object. From IBitmap object you can get DIB pointer and do all the manipulation.
Hi ruben I followed the steps as you mention... now I have I have DIB pointer now what I want to do is to redraw the image on the screen with new resolution(say:: I decoded 100* 100 JPEG and now want to disply it in 20*20 resolution ) ... As IGRAPHICS_StretchBlt is not working properly bcoz I have 24 bit data, What should I do to redraw image to screen???????? :confused: please explain me through tips or codes snipplets if possible..... I have already search the whole forum for this but haven't get any clue about it....
Actually what I want to achieve is generate the thumbnails from the images and I have to show those thumbnails to screen as well as save it.
Please do reply me as its very urgent
Regards
Abbay

Quote:ruben says
You can read the image file in a buffer, then use IImageDecoder API to decode image and get the IBitmap object. From IBitmap object you can get DIB pointer and do all the manipulation.
Hi ruben I followed the steps as you mention... now I have I have DIB pointer now what I want to do is to redraw the image on the screen with new resolution(say:: I decoded 100* 100 JPEG and now want to disply it in 20*20 resolution ) ... As IGRAPHICS_StretchBlt is not working properly bcoz I have 24 bit data, What should I do to redraw image to screen???????? :confused: please explain me through tips or codes snipplets if possible..... I have already search the whole forum for this but haven't get any clue about it....
Actually what I want to achieve is generate the thumbnails from the images and I have to show those thumbnails to screen as well as save it.
Please do reply me as its very urgent
Regards
Abbay

Is the IImageDecoder API available only for 3.x? I could not find it for 2.1.3.
Thanks...
ruben wrote:CONVERTBMP shouldn't be used, it is no better than DDB.
You can read the image file in a buffer, then use IImageDecoder API to decode image and get the IBitmap object. From IBitmap object you can get DIB pointer and do all the manipulation.

Is the IImageDecoder API available only for 3.x? I could not find it for 2.1.3.
Thanks...
ruben wrote:CONVERTBMP shouldn't be used, it is no better than DDB.
You can read the image file in a buffer, then use IImageDecoder API to decode image and get the IBitmap object. From IBitmap object you can get DIB pointer and do all the manipulation.

Yeah, only from 3.1.2, but is it widely available on all devices?
Thanks...
brewisv wrote:Is the IImageDecoder API available only for 3.x? I could not find it for 2.1.3.
Thanks...

Yeah, only from 3.1.2, but is it widely available on all devices?
Thanks...
brewisv wrote:Is the IImageDecoder API available only for 3.x? I could not find it for 2.1.3.
Thanks...