Simple proto to draw sawtooth waveform
Waveform - Custom qml component
- Inherited from QQuickItem
- Used to show waveform on screen.
- Uses QSGGeomtryNode & QSGGeomtry to plot the waveform
SawtoothGenerator - Data provider
getPlot
ill give the point to draw one vertical line on particular pixel.- Struct
Point
is having the information about the pixel coordinates(x position, y1&y2 position).
Logic:
- Instantiated the geometry with the
QSGGeometry::defaultAttributes_Point2D()
&2000
vertices - In a for loop fill the 2000 vertices with data provided by
getPlot
call.
Note: Here one vertical line of length=5pix has been drawn on every pixels with same 5pix Increment between 1-x pixel. So the line seems to be having the jagging effect. Is there a way to make this smooth sawtooth wave without jagging effect?