[Qt-interest] [OT] RE: Fwd: image processing

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Fri Mar 27 11:00:22 CET 2009


ami guru wrote on Thursday, March 26, 2009 5:27 PM:

> ...
> 2009/3/26 ami guru <dosto.walla at gmail.com>
> ...
> 	In that case i have read image as a texture and paste that on to a
> quad.  

Just a small sidenote: GL_QUAD (and generally polygons) are deprecated as per OpenGL 3.0 spec:

  http://www.opengl.org/registry/doc/glspec31.20090324.pdf, p. 297

It will still work though in OpenGL 3.0. The reason appears to be that GL_QUAD and co. is generally NOT supported in hardware (at least not 1:1: most drivers split it up into 2 triangles, but in software, or so I understand), and OpenGL aims to get as close as possible the API to "hardware supported features".

I am just mentioning this because I am also in this area with my private project: in batch mode I want to scale images (large ones, coming from cameras, up to 4000 x 3000 pixels) in hardware.

In a first naive (but easy) implementation I compared QImage::scaled() (software) vs QPainter::drawImage() on a QGLWidget (hardware accelerated).

I found that the bottleneck is not the scaling in OpenGL, but transfering the image data to the graphic card memory (including converting it to GL format, if necessary) and back again (converting it again to a QImage). I know that OpenGL 2.x offers "Pixel Buffer Objects" (PBO - http://www.songho.ca/opengl/gl_pbo.html), but I did not find the time yet to experiment with those :)

Cheer, Oliver

-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list