Efficiently Displaying a Large 32-bit Raw Image in Qt Graphics View

  Kiến thức lập trình

I have a Qt application written in C++ where I need to render a very large raw image in a 32-bit format within a QGraphicsView. The challenge is that QGraphicsView can only handle 8-bit images, so I need to convert each pixel value to 8-bit. Given the large size of the image (e.g., 9000×3000 pixels), this conversion process is very slow, taking several seconds to display the image completely.

Currently, I am converting each 32-bit pixel to an 8-bit format by performing a lot of division operations, which makes the rendering process inefficient.

Is there a way to directly show the raw 32-bit image on the GUI, or is there a more efficient method to handle the conversion to 8-bit to speed up the display process?

Example image size: 9000×3000 pixels

Note: I have a similar software which is doing the same without using GPU. Consuming nearly negligible amount CPU, I am trying to do the same with Qt.

I tried rather than division the shift operation still its too slow.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT