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. how to acces the RGB array.
Forum Updated to NodeBB v4.3 + New Features

how to acces the RGB array.

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 475 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.
  • N Offline
    N Offline
    Natural_Bugger
    wrote on 18 Jun 2022, 18:28 last edited by
    #1

    hi,

    i found this code: lQGraphicsView_QGraphicsScenet
    It compiles and works using QT 5.9, i believe.

    What enables me to access the RGB array to insert a custom one.
    Qimage?

    i want to create something that's looks like an oscilloscope.
    i really want to access the RGB array.

    i haven't done much "visual" QT for a while.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 18 Jun 2022, 19:41 last edited by
      #2

      Hi,

      Qwt provides a nice oscilloscope example that might be of interest.

      It would also help if you could explain what you want to do with the RGB values.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Natural_Bugger
        wrote on 18 Jun 2022, 19:53 last edited by Natural_Bugger
        #3

        Well, actually in the end, i want to make a mcp4921 dac move to create ADSR profiles.
        linear, exponentiation, logarithmic.

        this guy, who is making the "Jeany" teensy 4.1 polyphonic synthesizer gave me this, after i asked how the envelope code create these logarithmic/exponential curves.

        Rolf Degen:
            if (I <= 3) {
                    tft.drawLine(xplot1,40,xplot1 + xplot1_decay,yplot2_sustain,ST7735_RED);
                    } else {
                    for (i = 0; i <= I; i++) {
                        result = (exp(k*i/I) - exp(0)) / (exp(k) - exp(0));
                        int value = float(result * (46 - (SUSvalue / 2.8f)));
                        tft.drawLine(xplot1 + i2, 40 + value2, xplot1 + i, 40 + value, ST7735_RED);
                        i2 = i;
                        value2 = value;
                    }
               }
        

        i would like to simulate that, pixel based.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 18 Jun 2022, 20:04 last edited by
          #4

          You can draw on a QImage with that equation.

          Otherwise, the underlying buffer is accessible as well as each pixels.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Natural_Bugger
            wrote on 18 Jun 2022, 20:45 last edited by Natural_Bugger
            #5

            @Natural_Bugger said in how to acces the RGB array.:

            result = (exp(k*i/I) - exp(0)) / (exp(k) - exp(0));

            i don't know what "k" or "I" is.
            i have done some reading, it returns the Euler number, that's all i know, some weird number if you try it online euler calculator/c++ compiler and enter 1, 2.

            i only have the code from the above example.
            How to add a "QImage" via code, what is the indentifierof the buffer?

            it's my first project in ages.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 19 Jun 2022, 18:49 last edited by
              #6

              You might want to ask him a reference for the equations used.

              To access the raw data: QImage::bits.

              If you really don't remember how to create an object like QImage then I would suggest to first check the C++ basics.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • N Offline
                N Offline
                Natural_Bugger
                wrote on 19 Jun 2022, 22:23 last edited by
                #7

                didn't get a response from him.

                console coding, openGL isn't a big deal, haven't done much on QT "visual" lately.

                want to learn how to create logarithmic, experiential curves in a binary method.
                having a array of 12 bit values (mcp4921), time vs amplitude.

                the Akai MPC devices have this as well in their envelopes.

                1 Reply Last reply
                0

                1/7

                18 Jun 2022, 18:28

                • Login

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