maisonsmd / qnx-better-screenshot

A replacement for QNX's screenshot
2 stars 1 forks source link

I have requirement to save the image to RGBA8888 format #2

Open shashidharmk opened 1 month ago

shashidharmk commented 1 month ago

I have tried changing the screen format from SCREEN_FORMAT_RGB888 to SCREEN_FORMAT_RGBA8888. I am able to get the image on to buffer but unable to write it to .bmp file using existing bmp encoder.

maisonsmd commented 1 month ago

Hi @shashidharmk The current BMP encoder hardcoded 24 bits bitmap.

If you need 32 bits BMP, there are some modifications needed:

I will go back to this when I have free time, but will not be able to test it because I no longer have access to any QNX device.

maisonsmd commented 1 month ago

@shashidharmk AFAIK, BMP not officially support alpha channel (32 bits). May I ask you why you need that requirements? Is SCREEN_FORMAT_RGB888 not working?

Or you can capture in SCREEN_FORMAT_RGBA8888, but still store BMP in 24 bits format.

shashidharmk commented 1 month ago

BMP in 24 bits format

I did try capturing in SCREEN_FORMAT_RGBA8888 and stored in BMP, the image had white vertical lines. SCREEN_FORMAT_RGB888 works, but I have quality to meet, have lot of existing reference images captured which are of SCREEN_FORMAT_RGBA8888. Currently using these ref images as baseline,

I am looking for a way to capture an image from QNX given the XYWH with SCREEN_FORMAT_RGBA8888.

The screen capture with XYWH do not exist in QNX ss as far as i know.

maisonsmd commented 1 month ago

Okay I just made a encodeBmp32 which seems to work but not on my MacOs machine, I will make a new branch so you can test it yourself.

maisonsmd commented 1 month ago

@shashidharmk

I published new branch Please try compiling it and run with type=bmp32

I did not compile it since I don't have access to the QNX toolchain right now.

shashidharmk commented 1 month ago

@shashidharmk

I published new branch Please try compiling it and run with type=bmp32

I did not compile it since I don't have access to the QNX toolchain right now.

Thank you, will check on it...

maisonsmd commented 2 weeks ago

Hi @shashidharmk, Did the update work for you?

shashidharmk commented 1 week ago

Hi @shashidharmk, Did the update work for you?

Hi, The update did not work. It reported errors during runtime. I made a change in file write to get raw data for RGBA and process it further. Its working now. Thanks for the support!!