Warning, /multimedia/kdenlive/src/effects/effectstack/view/qml/LiftGammaGain.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2018 Jean-Baptiste Mardelle <jb@kdenlive.org>
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 import QtQuick 2.15
0007 import QtQuick.Controls 2.15
0008 import Kdenlive.Controls 1.0
0009 import QtQuick.Layouts 1.15
0010 
0011 Item {
0012     id: liftgammagain
0013     property string effectName: 'lift_gamma_gain'
0014     property double liftFactor : 2.0
0015     property double gammaFactor: 2.0
0016     property double gainFactor: 4.0
0017     Layout.fillWidth: true
0018     function loadWheels() {
0019         if (!effectstackmodel.hasFilter(liftgammagain.effectName)) {
0020             // Set default parameter values
0021             liftwheel.setColor(0. / liftFactor, 0. / liftFactor, 0. / liftFactor, 1.0);
0022             gammawheel.setColor(1.0 / gammaFactor, 1.0 / gammaFactor, 1.0 / gammaFactor, 1.0);
0023             gainwheel.setColor(1.0 / gainFactor, 1.0 / gainFactor, 1.0 / gainFactor, 1.0);
0024         } else {
0025             liftwheel.setColor(effectstackmodel.getFilterParam(liftgammagain.effectName, 'lift_r') / liftFactor,
0026                                    effectstackmodel.getFilterParam(liftgammagain.effectName, 'lift_g') / liftFactor,
0027                                    effectstackmodel.getFilterParam(liftgammagain.effectName, 'lift_b') / liftFactor,
0028                                    1.0 )
0029             gammawheel.setColor(effectstackmodel.getFilterParam(liftgammagain.effectName, 'gamma_r') / gammaFactor,
0030                                     effectstackmodel.getFilterParam(liftgammagain.effectName, 'gamma_g') / gammaFactor,
0031                                     effectstackmodel.getFilterParam(liftgammagain.effectName, 'gamma_b') / gammaFactor,
0032                                     1.0 )
0033             gainwheel.setColor(effectstackmodel.getFilterParam(liftgammagain.effectName, 'gain_r') / gainFactor,
0034                                    effectstackmodel.getFilterParam(liftgammagain.effectName, 'gain_g') / gainFactor,
0035                                    effectstackmodel.getFilterParam(liftgammagain.effectName, 'gain_b') / gainFactor,
0036                                    1.0 )
0037         }
0038     }
0039     RowLayout {
0040         spacing: 0
0041         Layout.fillWidth: true
0042     Column {
0043         height: parent.height
0044         width: liftgammagain.width / 3
0045             Label {
0046                 text: i18n("Lift")
0047             }
0048             ColorWheelItem {
0049                 id: liftwheel
0050                 width: liftgammagain.width / 3
0051                 height: width
0052                 onColorChanged: {
0053                     effectstackmodel.adjust(liftgammagain.effectName, 'lift_r', liftwheel.red );
0054                     effectstackmodel.adjust(liftgammagain.effectName, 'lift_g', liftwheel.green );
0055                     effectstackmodel.adjust(liftgammagain.effectName, 'lift_b', liftwheel.blue );
0056                 }
0057             }
0058         }
0059     Column {
0060         height: parent.height
0061         width: liftgammagain.width / 3
0062             Label {
0063                 text: i18n("Gamma")
0064             }
0065             ColorWheelItem {
0066                 id: gammawheel
0067                 width: liftgammagain.width / 3
0068                 height: width
0069                 onColorChanged: {
0070                     effectstackmodel.adjust(liftgammagain.effectName, 'gamma_r', gammawheel.red);
0071                     effectstackmodel.adjust(liftgammagain.effectName, 'gamma_g', gammawheel.green);
0072                     effectstackmodel.adjust(liftgammagain.effectName, 'gamma_b', gammawheel.blue);
0073                 }
0074             }
0075         }
0076         Column {
0077             height: parent.height
0078             width: liftgammagain.width / 3
0079             Label {
0080                 text: i18n("Gain")
0081             }
0082             ColorWheelItem {
0083                 id: gainwheel
0084                 width: liftgammagain.width / 3
0085                 height: width
0086                 onColorChanged: {
0087                     effectstackmodel.adjust(liftgammagain.effectName, 'gain_r', gainwheel.red);
0088                     effectstackmodel.adjust(liftgammagain.effectName, 'gain_g', gainwheel.green);
0089                     effectstackmodel.adjust(liftgammagain.effectName, 'gain_b', gainwheel.blue);
0090                 }
0091             }
0092         }
0093     }
0094     Component.onCompleted: {
0095         liftwheel.setFactorDefaultZero(liftgammagain.liftFactor, 0, 0.5);
0096         gammawheel.setFactorDefaultZero(liftgammagain.gammaFactor, 1, 0);
0097         gainwheel.setFactorDefaultZero(liftgammagain.gainFactor, 1, 0);
0098     }
0099 }