Warning, /maui/booth/src/widgets/PhotoCaptureControls.qml is written in an unsupported language. File is not indexed.

0001 /****************************************************************************
0002 **
0003 ** Copyright (C) 2017 The Qt Company Ltd.
0004 ** Contact: https://www.qt.io/licensing/
0005 **
0006 ** This file is part of the examples of the Qt Toolkit.
0007 **
0008 ** $QT_BEGIN_LICENSE:BSD$
0009 ** Commercial License Usage
0010 ** Licensees holding valid commercial Qt licenses may use this file in
0011 ** accordance with the commercial license agreement provided with the
0012 ** Software or, alternatively, in accordance with the terms contained in
0013 ** a written agreement between you and The Qt Company. For licensing terms
0014 ** and conditions see https://www.qt.io/terms-conditions. For further
0015 ** information use the contact form at https://www.qt.io/contact-us.
0016 **
0017 ** BSD License Usage
0018 ** Alternatively, you may use this file under the terms of the BSD license
0019 ** as follows:
0020 **
0021 ** "Redistribution and use in source and binary forms, with or without
0022 ** modification, are permitted provided that the following conditions are
0023 ** met:
0024 **   * Redistributions of source code must retain the above copyright
0025 **     notice, this list of conditions and the following disclaimer.
0026 **   * Redistributions in binary form must reproduce the above copyright
0027 **     notice, this list of conditions and the following disclaimer in
0028 **     the documentation and/or other materials provided with the
0029 **     distribution.
0030 **   * Neither the name of The Qt Company Ltd nor the names of its
0031 **     contributors may be used to endorse or promote products derived
0032 **     from this software without specific prior written permission.
0033 **
0034 **
0035 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0036 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0037 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0038 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0039 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0040 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0041 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0042 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0043 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0044 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0045 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
0046 **
0047 ** $QT_END_LICENSE$
0048 **
0049 ****************************************************************************/
0050 
0051 import QtQuick 2.15
0052 import QtQuick.Controls 2.15
0053 import QtMultimedia 5.4
0054 
0055 FocusScope {
0056     property Camera camera
0057     property bool previewAvailable : false
0058 
0059     property int buttonsPanelWidth: buttonPaneShadow.width
0060 
0061     signal previewSelected
0062     signal videoModeSelected
0063     id : captureControls
0064 
0065     Rectangle {
0066         id: buttonPaneShadow
0067         width: bottomColumn.width + 16
0068         height: parent.height
0069         anchors.top: parent.top
0070         anchors.right: parent.right
0071         color: Qt.rgba(0.08, 0.08, 0.08, 1)
0072 
0073         Column {
0074             anchors {
0075                 right: parent.right
0076                 top: parent.top
0077                 margins: 8
0078             }
0079 
0080             id: buttonsColumn
0081             spacing: 8
0082 
0083             FocusButton {
0084                 camera: captureControls.camera
0085                 visible: camera.cameraStatus == Camera.ActiveStatus && camera.focus.isFocusModeSupported(Camera.FocusAuto)
0086             }
0087 
0088             CameraPropertyButton {
0089                 id : wbModesButton
0090                 value: CameraImageProcessing.WhiteBalanceAuto
0091                 model: ListModel {
0092                     ListElement {
0093                         icon: "images/camera_auto_mode.png"
0094                         value: CameraImageProcessing.WhiteBalanceAuto
0095                         text: "Auto"
0096                     }
0097                     ListElement {
0098                         icon: "images/camera_white_balance_sunny.png"
0099                         value: CameraImageProcessing.WhiteBalanceSunlight
0100                         text: "Sunlight"
0101                     }
0102                     ListElement {
0103                         icon: "images/camera_white_balance_cloudy.png"
0104                         value: CameraImageProcessing.WhiteBalanceCloudy
0105                         text: "Cloudy"
0106                     }
0107                     ListElement {
0108                         icon: "images/camera_white_balance_incandescent.png"
0109                         value: CameraImageProcessing.WhiteBalanceTungsten
0110                         text: "Tungsten"
0111                     }
0112                     ListElement {
0113                         icon: "images/camera_white_balance_flourescent.png"
0114                         value: CameraImageProcessing.WhiteBalanceFluorescent
0115                         text: "Fluorescent"
0116                     }
0117                 }
0118                 onValueChanged: captureControls.camera.imageProcessing.whiteBalanceMode = wbModesButton.value
0119             }
0120 
0121             CameraButton {
0122                 text: i18n("View")
0123                 onClicked: captureControls.previewSelected()
0124                 visible: captureControls.previewAvailable
0125             }
0126         }
0127 
0128         Column {
0129             anchors {
0130                 bottom: parent.bottom
0131                 right: parent.right
0132                 margins: 8
0133             }
0134 
0135             id: bottomColumn
0136             spacing: 8
0137 
0138             CameraListButton {
0139                 model: QtMultimedia.availableCameras
0140                 onValueChanged: captureControls.camera.deviceId = value
0141             }
0142 
0143         }
0144 
0145 
0146     }
0147 
0148 
0149     ZoomControl {
0150         x : 0
0151         y : 0
0152         width : 100
0153         height: parent.height
0154 
0155         currentZoom: camera.digitalZoom
0156         maximumZoom: Math.min(4.0, camera.maximumDigitalZoom)
0157         onZoomTo: camera.setDigitalZoom(value)
0158     }
0159 }