-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vectorscope render fix #7652
Open
michaelgregorius
wants to merge
12
commits into
LMMS:master
Choose a base branch
from
michaelgregorius:VectorscopeRenderFix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Vectorscope render fix #7652
michaelgregorius
wants to merge
12
commits into
LMMS:master
from
michaelgregorius:VectorscopeRenderFix
+202
−268
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The rendering of the Vectorscope is broken on Wayland if the size of the Vectorscope is increased. This is caused by using a `QImage` to render the scope traces which is then scaled up. Introduce a new way to paint the vector scope (goniometer) which simply paints lines or points that progressively get dimmer and which does not make use of a QImage anymore. It supports the following features: * Log mode * Zooming * Rendering the drawing performance * Selecting a different color for the traces It does not support: * HQ Mode: The new implementation provides a performance that's equivalent to Non-HQ mode. * Blurring of old data * Persistence: Might be implemented by using a factor for the dimming This commit introduces new controls: * Lines mode: Switches between painting lines or points in the new implementation * Legacy mode: Use to switch between the new and the old rendering. Only used during development as the old mode will be removed completely. Rendering of the samples/trances uses the composition mode "Plus" so that overlapping elements will appear like adding brightness. Painting the grid and lines is done using the normal composition mode "Source Over" so that it simply replaces existing pixels. Painting of the lines/points and the grids and lines is done in a "signal space", i.e. a transform where elements in the interval of [-1, 1] feel "natural". The text is painted in "widget space". The "HQ" button and the "Persistence" knob have been temporarily made members so that they can be hidden in non-legacy mode. They will later be removed completely. Rendering in "Log" mode currently paints a horizontal line for silence. It needs to be investigated why this is the case. It's likely caused by the division by the distance of the points from the origin. If this becomes very small (and non-zero) then the division might produce large values.
Use the `SampleFrame` representation as long as possible when doing the calculations in the paint method.
Remove HQ mode and persistence. Also remove the legacy option again. This removes the models, loading, saving and the GUI controls. Remove all unnecessary members from `VectorView`, adjust the constructor. Move the implementation of `paintLinesMode` into `paintEvent`. Remove methods `paintLegacyMode` and `paintLinesMode`.
Move the colors out of `VecControls` into `VectorView` as they are related to presentation.
Remove a friend relationship to `VectorView` from `VecControls` by introducing const getters for the models.
Remove the unnecessary member `m_visible` from `VectorView`. It was not initialized and only written to but never read.
Make the Vectorscope themeable by introducing Qt properties for the relevant colors. The default theme gets the values from the code whereas the classic theme gets a trace with amber color.
Rename `m_colorFG` to `m_colorTrace`. Adjust the Qt property accordingly. Remove local variable `traceColor` from paint method and use member `m_colorTrace` directly.
Remove unused member `m_colorOutline`.
Fix the horizontal lines that are rendered on silence. They seem to be produced when rendering lines that start and end at the same point. Therefore we only draw a point if the current and last point are the same.
Add some margin to the rendering of the `VectorView` so that the circle does not touch the bounary of the widget.
Clean up the layout of the Vectorscope. The checkboxes are not put on top of the vector view anymore but are organized in a horizontal layout beneath it. This gives a much tidier look.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The rendering of the Vectorscope is broken on Wayland if the size of the Vectorscope is increased. This is caused by using a
QImage
to render the scope traces which is then scaled up.The fix introduce a new implementation of the paint method which simply paints lines or points that progressively get dimmer without using a
QImage
anymore. It is possible to switch between rendering lines or points using the "Lines" control.The following shows a comparison between the old and the new implementation (using commit c0538b1). It shows the performance difference and switching between rendering lines and points with the new implementation:
LMMS-VectorScopeExecutionTimes.webm
Feature changes
It supports the following pre-existing features:
It does not support anymore:
Style sheets
The Vectorscope now supports style sheets by introducing Qt properties for the relevant colors. The default theme gets the values from the code whereas the classic theme gets a trace with amber color.
Technical details
Rendering of the samples/trances uses the composition mode "Plus" so that overlapping elements will appear like adding brightness. Painting the grid and lines is done using the normal composition mode "Source Over" so that it simply replaces existing pixels.
Painting of the lines/points and the grids and lines is done in a "signal space", i.e. a transform where elements in the interval of [-1, 1] feel "natural". The text is painted in "widget space".
Other changes
VecControls
intoVectorView
as they are related to presentation.VectorView
fromVecControls
by introducing const getters for the models.m_visible
fromVectorView
. It was not initialized and only written to but never read.m_colorFG
tom_colorTrace
.Fixes #7518.