how to acces the RGB array.
-
wrote on 18 Jun 2022, 18:28 last edited by
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.
-
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.
-
wrote on 18 Jun 2022, 19:53 last edited by Natural_Bugger
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.
-
You can draw on a QImage with that equation.
Otherwise, the underlying buffer is accessible as well as each pixels.
-
wrote on 18 Jun 2022, 20:45 last edited by Natural_Bugger
@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.
-
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.
-
wrote on 19 Jun 2022, 22:23 last edited by
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/7