Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VideoOutput {
- id: viewFinder
- property bool shouldBeCentered: device.isLandscape
- property real anchoredY: viewFinderGeometry.y * (device.isInverted ? +1 : -1)
- property real anchoredX: viewFinderGeometry.x * (device.isInverted ? +1 : -1)
- x: viewFinder.shouldBeCentered ? 0 : viewFinder.anchoredX
- y: viewFinder.shouldBeCentered || device.naturalOrientation === "landscape" ?
- 0 : viewFinder.anchoredY
- width: parent.width
- height: parent.height
- source: camera
- /* This rotation need to be applied since the camera hardware in the
- Galaxy Nexus phone is mounted at an angle inside the device, so the video
- feed is rotated too.
- FIXME: This should come from a system configuration option so that we
- don't have to have a different codebase for each different device we want
- to run on */
- orientation: device.naturalOrientation === "portrait" ? -90 : 0
- /* Convenience item tracking the real position and size of the real video feed.
- Having this helps since these values depend on a lot of rules:
- - the feed is automatically scaled to fit the viewfinder
- - the viewfinder might apply a rotation to the feed, depending on device orientation
- - the resolution and aspect ratio of the feed changes depending on the active camera
- The item is also separated in a component so it can be unit tested.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement