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. Create a colormap spectrum in Qt

Create a colormap spectrum in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 682 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    MajidKamali
    wrote on last edited by
    #1

    Hi.
    I want to create a colormap with a set of points, each have a value. But my problem is that their position is not aligned to a grid, e.g somthing like this:
    positions.png
    Each circle is a point with known and constant location (x, y) which has some data (double z). but no other point in rectangle has any data and I should interpolate values for them.
    I looked into qcustomplot QCPColorMap and qwt QwtPlotSpectrogram but in both cases, there is a grid of points in rows and columns that has values.
    So I have two options:

    1. Ask GPU (via OpenGL) to interpolate colors between points (recommended option)
    2. 2D-interpolate whole area and feed that data to above-mentioned libraries

    So:
    Is this even possible to achieve option 1? If yes, how?
    If option one is not possible or too heavy (because I don't know opengl), how can I implement option 1?

    Thanks :-)

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Might be overkill but Qt DataVisualisation should be able to do this no problem.

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MajidKamali
        wrote on last edited by
        #3

        In my researches, I found this example https://doc.qt.io/qt-5/qtgui-openglwindow-example.html
        a triangle with normalized coordinates between [-1,1] (obviously because of opengl, iirc) and a color for each corner is drawn, and color is interpolated in between.
        can I use the same technic with these points? something like below:
        points.png
        with triangulating points and feed them to opengl, I want to have an interpolated and colored surface

        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