Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opengl and PGM display
Forum Updated to NodeBB v4.3 + New Features

Opengl and PGM display

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 150 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OneWayOrAnother
    wrote on last edited by OneWayOrAnother
    #1

    Hello guys.
    I want to show some pgm image using OpenGL.
    I achieved that pretty easy with this:

    void OGLPyramid::display(const QImage* img)
    {
        m_image = img;
        this->update();
    
    
    }
    
    void OGLPyramid::paintEvent(QPaintEvent *)
    {
        QPainter painter(this);
        painter.drawImage(this->rect(), *m_image);
    
    }
    

    But i got a question - how can i specify display range? like if image got brightness distribution is between 0 and 65535 it looks pretty much okay, but if distribution is between 5000 and 5500 it looks black since display range stays from 0 to 65535. How can i adjust display range? Ofc would be nice to avoid changing the initial img data.

    Thanks for your help.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved