PDA

View Full Version : Image brightness/contrast adjustments



striker303
2nd September 2008, 14:46
Greetings,

I'm developing an application, which has a simple image viewer included. The image viewer is used to display rather large--color and grayscale--images (> tens of megabytes). I want to add a brightness/contrast slider for the user to dynamically alter the image's pixel values.

Currently I'm using QGraphicsView and QGraphicsScene with a single QPixmap item. I can nicely transform (e.g., rotate and transform) the image, but when it becomes to altering the pixel values, the response becomes very sluggish. This must be due to the need of converting the QPixmap into QImage for pixel manipulation, and again back to QPixmap to be inserted back into the scene.

Back with MFC, I used to do this with the device context's SetColorAdjustment() function, which would then be used with BitBlt() function. Everything worked nice and smoothly.

If somebody has some ideas on how to implement this on Qt (4.3), I would reaaaally appreciate it! I'd prefer to use the QGraphicsScene-based approach, since it offers a great many features.

Thanks for this awesome forum, keep up the good work..

Best regards,
Jim Reeds

kingslee
2nd September 2008, 17:35
Have a look into this thread

http://www.qtcentre.org/forum/f-qt-programming-2/t-qgraphicsscene-and-qthread-5110.html

striker303
8th September 2008, 08:29
Many thanks, that pointed me into the right tracks. The timer approach works.

All the best,
Jim