[vlc-commits] [Git][videolan/vlc][master] qml: optimize soft edges depending on size in RoundImage
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sat Dec 21 12:35:22 UTC 2024
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
caa02fe5 by Fatih Uzunoglu at 2024-12-21T12:13:37+00:00
qml: optimize soft edges depending on size in RoundImage
The edges (-0.01, 0.01) seem to cover most of the images
used in the interface. But for extraordinary sizes, too
small or too big, adjusting the parameters seem to provide
better anti-aliasing. The interface displayed round image
sizes seem to vary between roughly (32, 32) and (550, 340)
at the moment.
I found `1 / size` to be yielding good results for a span of
different sizes. In normal case, if we assume size to be
100 (minimum of width and height), then it is essentially
the same as the value used before 0.01. I have also checked
with the smallest and the largest images displayed in the
interface.
As per the function `1 / x`, the deviation can be expected
to be in the order of 10^1 (0.002 and 0.2), considering the
rounded rectangular image sizes displayed in the interface.
This means that such function would not cause issues with
regard to precision.
- - - - -
1 changed file:
- modules/gui/qt/widgets/qml/RoundImage.qml
Changes:
=====================================
modules/gui/qt/widgets/qml/RoundImage.qml
=====================================
@@ -116,8 +116,8 @@ Item {
readonly property size size: Qt.size(width, height)
- readonly property double softEdgeMin: -0.01
- readonly property double softEdgeMax: 0.01
+ readonly property double softEdgeMin: -1. / Math.min(width, height)
+ readonly property double softEdgeMax: -softEdgeMin
readonly property size cropRate: {
let ret = Qt.size(0.0, 0.0)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/caa02fe5e422625649e7706475a03d8cef5e4b38
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/caa02fe5e422625649e7706475a03d8cef5e4b38
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list