Results 1 to 5 of 5

Thread: Image Manipulations using OpenGL

  1. #1
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Image Manipulations using OpenGL

    Hi folks,

    I need some image manipulation in my qt application. Some of the features required are: Translate, Rotate, Scale, Blur, Sharpen, Contrast, Red Eye Removal, Add Noise, Charcoal, Shadow, Sketch, Enhance, Edge, Gamma, Implode, Negate, Flip, Flop, OilPaint etc to Image.

    I tried with Image Magick but it seems to be very expensive in terms of converting an image to Pixmap and vice versa. It is too heavy and also not very easy to deploy.

    I am now also looking towards OpenGL. Is it possible to manipulate image using OpenGL and where do I find the proper api reference for that?

    Quick help is required.

    Regards,
    Manoj

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Image Manipulations using OpenGL

    Pure OpenGL won't help you here. You'd have to implement fragment programs for each operation and run them on your GPU.

  3. #3
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Image Manipulations using OpenGL

    Thanks wysota. I am not much famaliar with using GPU and reading about it. All I could understood till now is that GPU is a special type of processor using a portion of memory to process graphics operations. I don't know how to use it with some graphics library. Please be kind enough to give me some useful pointers about the same.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Image Manipulations using OpenGL

    Quote Originally Posted by manojmka View Post
    I don't know how to use it with some graphics library.
    You can't. You have to implement your own routines in a special language understood by the GPU.

  5. #5
    Join Date
    Jan 2006
    Posts
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Lightbulb Re: Image Manipulations using OpenGL

    ahoy,
    I think there might be a way, briefly:
    1. Sub-class or inherit your painting Widget from QGLWidget
    2. Override the inherited member function QGLWidget::paintGL(), where u would typically do either pixmap rendering (glDrawPixels) or texture mapping
    3. Also in QGLWidget::paintGL() or ::resizeGL(), do GPU based pixel manipulation using various ARB_imaging functions such as glConvolutionFilter1D, glConvolutionFilter2D, glPixelTransferf... Doign so, will greatly improving your processing performance up to 20 folds (given you have a new fast GPU !). Practically you can do most of image processing algorithms using the ARB_imaging calls with lightning fast processing.
    4. Create a custom function that reads the GPU processed color bit buffer from the GPU memory to a buffer residing in system memory using glReadPixels.

    For more info there is google and many good people willing to spread the disease :)
    hope it is somewhat en-lighting
    cheers

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. problem with opengl, zooming, drawpixels, and origin
    By ntp in forum General Programming
    Replies: 0
    Last Post: 22nd February 2008, 21:48
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  4. Replies: 7
    Last Post: 27th June 2007, 09:34
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.