}
}
- FocusReticle {
- visible: controlsVisible && focusReticleVisible && cam.autoFocus.canFocus(cam.scene.value);
- id: focusReticle
- cafStatus: cam.autoFocus.cafStatus
- status: cam.autoFocus.status
- }
-
Rectangle {
// TODO: fade out transition
// TODO: there is a toolbar visible on the first startup
import CameraPlus 1.0
// TODO: I've seen the reticle color changing to red while dragging it but failed to reproduce :(
+// TODO: animate move
+// TODO: hide all controls when we are focusing
+// TODO: hide all controls when we are dragging
+
MouseArea {
property int cafStatus: AutoFocus.None
property int status: AutoFocus.None
+ property Camera cam: null
id: mouse
// A 100x100 central "rectangle"
property alias touchMode: reticle.touchMode
- x: cam.renderArea.x
- y: cam.renderArea.y
- width: cam.renderArea.width
- height: cam.renderArea.height
-
- // Changing mode (which implies changing pages) will not reset ROI thus we do it here
- Component.onCompleted: cam.autoFocus.setRegionOfInterest(Qt.rect(0, 0, 0, 0));
+ x: cam ? cam.renderArea.x : 0
+ y: cam ? cam.renderArea.y : 0
+ width: cam ? cam.renderArea.width : 0
+ height: cam ? cam.renderArea.height : 0
+
+ Connections {
+ target: settings
+ // Changing mode (which implies changing pages) will not reset ROI
+ // thus we do it here
+ onModeChanged: {
+ moveToCenter();
+ cam.autoFocus.setRegionOfInterest(Qt.rect(0, 0, 0, 0));
+ }
+ }
+ Connections {
+ target: cam
+ onRunningChanged: {
+ if (!cam.running) {
+ moveToCenter();
+ cam.autoFocus.setRegionOfInterest(Qt.rect(0, 0, 0, 0));
+ }
+ }
+ }
/*
// This is for debugging
Rectangle {
}
}
+ function moveToCenter() {
+ reticle.x = reticle.center.x;
+ reticle.y = reticle.center.y;
+ }
+
function moveReticle(x, y) {
var xPos = x - ((reticle.width * 1) / 2);
var yPos = y - ((reticle.height * 1) / 2);
// TODO: postcapture
// TODO: flash not ready
-// TODO: touch focus
// TODO: portrait/landscape
// TODO: stop viewfinder in settings pages ?
// TODO: grid lines, face tracking, ambr
}
Camera {
+ id: cam
+ anchors.fill: parent
+
+ FocusReticle {
+ id: focusReticle
+ cam: cam
+ visible: pageStack.currentPage && pageStack.currentPage.controlsVisible && pageStack.currentPage.focusReticleVisible && cam && cam.autoFocus.canFocus(cam.scene.value);
+ cafStatus: cam ? cam.autoFocus.cafStatus : -1
+ status: cam ? cam.autoFocus.status : -1
+ }
+
/*
onDeviceIdChanged: {
// TODO: is this needed ?
}
}
*/
- id: cam
- anchors.fill: parent
-
onError: {
console.log("Camera error (" + code + "): " + message + " " + debug);
showError(qsTr("Camera error. Please restart the application."));