-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LumaGradientMixer and luma gradient viewer
- Loading branch information
1 parent
911d2a8
commit 05f603e
Showing
9 changed files
with
223 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2024 Andrew Wason | ||
// | ||
// This file is part of mediaFX. | ||
// | ||
// mediaFX is free software: you can redistribute it and/or modify it under the | ||
// terms of the GNU General Public License as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// mediaFX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along with mediaFX. | ||
// If not, see <https://www.gnu.org/licenses/>. | ||
|
||
import QtQuick | ||
import QtQuick.Shapes | ||
import MediaFX | ||
|
||
LumaMixer { | ||
id: root | ||
property alias fillGradient: path.fillGradient | ||
Shape { | ||
ShapePath { | ||
id: path | ||
scale: Qt.size(root.width, root.height) | ||
PathPolyline { | ||
path: [Qt.point(0, 0), Qt.point(0, 1), Qt.point(1, 1), Qt.point(1, 0), Qt.point(0, 0)] | ||
} | ||
} | ||
} | ||
} |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
// Copyright (C) 2024 Andrew Wason | ||
// | ||
// This file is part of mediaFX. | ||
// | ||
// mediaFX is free software: you can redistribute it and/or modify it under the | ||
// terms of the GNU General Public License as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// mediaFX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along with mediaFX. | ||
// If not, see <https://www.gnu.org/licenses/>. | ||
import QtQuick | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
import QtQuick.Shapes | ||
import MediaFX | ||
import MediaFX.Viewer | ||
|
||
Rectangle { | ||
SystemPalette { | ||
id: palette | ||
colorGroup: SystemPalette.Active | ||
} | ||
color: palette.window | ||
width: layout.implicitWidth | ||
height: layout.implicitHeight | ||
|
||
ColumnLayout { | ||
id: layout | ||
MediaMixerViewer { | ||
mixer: linearMixer | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
ColumnLayout { | ||
anchors.fill: parent | ||
LabeledSlider { | ||
id: x1Slider | ||
label: "x1" | ||
to: linearMixer.width | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: y1Slider | ||
label: "y1" | ||
to: linearMixer.height | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: x2Slider | ||
label: "x2" | ||
to: linearMixer.width | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: y2Slider | ||
label: "y2" | ||
to: linearMixer.height | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: tw1Slider | ||
label: "transitionWidth" | ||
to: linearMixer.width | ||
Layout.fillWidth: true | ||
} | ||
LumaGradientMixer { | ||
id: linearMixer | ||
transitionWidth: tw1Slider.value | ||
fillGradient: LinearGradient { | ||
x1: x1Slider.value | ||
y1: y1Slider.value | ||
x2: x2Slider.value | ||
y2: y2Slider.value | ||
GradientStop { | ||
position: 0.0 | ||
color: "white" | ||
} | ||
GradientStop { | ||
position: 1.0 | ||
color: "black" | ||
} | ||
} | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
} | ||
} | ||
} | ||
MediaMixerViewer { | ||
mixer: conicalMixer | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
ColumnLayout { | ||
anchors.fill: parent | ||
LabeledSlider { | ||
id: angleSlider | ||
label: "angle" | ||
to: 360 | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: centerXSlider | ||
label: "centerX" | ||
to: conicalMixer.width | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: centerYSlider | ||
label: "centerY" | ||
to: conicalMixer.height | ||
Layout.fillWidth: true | ||
} | ||
LabeledSlider { | ||
id: tw2Slider | ||
label: "transitionWidth" | ||
to: conicalMixer.width | ||
Layout.fillWidth: true | ||
} | ||
LumaGradientMixer { | ||
id: conicalMixer | ||
transitionWidth: tw2Slider.value | ||
fillGradient: ConicalGradient { | ||
angle: angleSlider.value | ||
centerX: centerXSlider.value | ||
centerY: centerYSlider.value | ||
GradientStop { | ||
position: 0.0 | ||
color: "white" | ||
} | ||
GradientStop { | ||
position: 1.0 | ||
color: "black" | ||
} | ||
} | ||
Layout.fillWidth: true | ||
Layout.fillHeight: true | ||
} | ||
} | ||
} | ||
} | ||
component LabeledSlider: RowLayout { | ||
property alias label: label.text | ||
property alias from: slider.from | ||
property alias to: slider.to | ||
property alias value: slider.value | ||
Label { | ||
id: label | ||
} | ||
Slider { | ||
id: slider | ||
hoverEnabled: true | ||
ToolTip.delay: 1000 | ||
ToolTip.visible: hovered | ||
ToolTip.text: slider.value | ||
Layout.fillWidth: true | ||
} | ||
} | ||
} |
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
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