Thanks for the info, I will take a look at the QGL Classes for hardware acceleration.
As far as QPixmap goes, I'm still not sure how to get my uchar buffer into the QPixmap properly. The uchar buffer can be 8 Bit Indexed, 16 Bit RGB or 32 Bit RGB, but there is no header data in the buffer; pixel one starts at the first index in the buffer.
None of the Constructors look like they match what I'm trying to do. The only thing that makes sense is creating a QPixmap and then calling:
|
Source code
|
1
|
loadFromData ( const uchar * data, uint len, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor )
|
But char * format in this case (I believe) is looking for a standard image format like "BMP", "GIF", "PNG", etc, this doesn't make sense in my case. The format parmas in QImage such as: QImage::Format_Indexed8, Format_RGB32, and Format_RGB16 are what I think I need.
I've tried:
|
Source code
|
1
2
3
|
pixmap_32Bit = new QPixmap();
pixmap_32Bit.loadFromData(image_buf_32Bit,width()*height()*4);
update();
|
And then in paintEvent():
|
Source code
|
1
2
|
QPainter painter(this);
painter.drawPixmap(0,0,* pixmap_32Bit);
|
But got nothing in my widget.