Results 1 to 12 of 12

Thread: OpenGL image viewer, need some help on implementation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: OpenGL image viewer, need some help on implementation

    I think you'd have fewer problems with a painter approach. All the rendering problems (transformations, etc.) would vanish and getting cursor coordinates would be as easy as reading a variable from the mouse event.

    The most basic way to implement the viewer would be to use a QLabel with a pixmap. You can also embed it into a scroll area if you want scroll bars. Of course you can draw the image yourself using QPainter if you want more control over it (like easy scaling, etc.).

  2. #2
    Join Date
    Feb 2007
    Posts
    49
    Thanks
    4
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: OpenGL image viewer, need some help on implementation

    We talk about HDR images, which pixel is represented with 16 bit float, 32 bit float or 32 bit integer. QPixmap doesn't support this kind of format. OpenGL support textures in 32 bit float format (GF 6 up, Radeon 9800 up) or 16 bit float (GF2 up). Also, he can use shaders for image processing.

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

    Default Re: OpenGL image viewer, need some help on implementation

    Quote Originally Posted by minimoog View Post
    We talk about HDR images, which pixel is represented with 16 bit float, 32 bit float or 32 bit integer. QPixmap doesn't support this kind of format.
    Does your screen support it? Because if not, there is no point in doing something which you'll never see.

    Also, he can use shaders for image processing.
    And probe texels for colours when he wants to check the pixel value?

    Using shaders would make sense if he had 100 images per second to process, but not with an image viewer. At least that's my point of view.

Similar Threads

  1. Help needed handling image data
    By toratora in forum General Programming
    Replies: 2
    Last Post: 11th May 2007, 09:24
  2. Replies: 0
    Last Post: 4th May 2007, 10:44
  3. Requirement for versatile image viewer
    By deekayt in forum General Discussion
    Replies: 1
    Last Post: 27th October 2006, 14:28
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Image Viewer
    By sumsin in forum Qt Programming
    Replies: 3
    Last Post: 14th March 2006, 13:29

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
  •  
Qt is a trademark of The Qt Company.