Camera Use Cases

Camera Use Cases

Examples of camera features usage and integrations.

Camera Use Cases

Examples of camera features usage and integrations.

The project contains the usage examples of the API that allows to work with camera: settings, capturing, frame processing.

The main purpose is to show not only what features are available to work with the camera, but also how to use them correctly.

Terms of Use and Participation

The source code of the project is provided under the license, that allows it to be used in third-party applications.

The contributor agreement documents the rights granted by contributors to the Open Mobile Platform.

For information about contributors see AUTHORS.

Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.

Project Structure

The project has a standard structure of an application based on C++ and QML for Aurora OS.

  • ru.auroraos.CameraUseCases.pro file describes the project structure for the qmake build system.
  • icons directory contains application icons for different screen resolutions.
  • The src directory contains both the main file source and the C++ code of the custom components.
  • qml directory contains the QML source code and the UI resources.
    • components directory contains the custom UI components.
    • cover directory contains the application cover implementations.
    • icons directory contains the custom UI icons.
    • pages directory contains the application pages.
    • CameraUseCases.qml file provides the application window implementation.
  • The JavaScript auxiliaries are in the qml/js directory.
  • Each use case has its own QML-file in the qml/pages directory.
  • Navigation by examples in the application is implemented in the MainPage.qml file.

Compatibility

The project is compatible with all the supported versions of the Aurora OS.

Project Building

The project is built in the usual way using the Aurora SDK.

Examples

The features related to the examples are the following:

Camera Info

This example shows how to get a list of available cameras and the basic information about each camera.

  • CameraInfoPage.qml is the example page.
  • camerainfomodel.h and camerainfomodel.cpp implement a model that provides a list of available cameras. Each element of the model has properties:
    • description is the human-readable description of the camera;
    • deviceName is the unique ID to identify the camera and may not be human-readable;
    • isDefault is true if the camera is default, false otherwise;
    • isNull is true if the camera info is invalid, false otherwise;
    • orientation is the orientation angle (clockwise, in steps of 90 degrees) of the camera sensor in relation to the display in its natural orientation;
    • position is the physical position of the camera on the hardware system (back face, front face or unspecified).

Camera Properties

This example demonstrates some techniques to read and analyze camera properties using C++.

  • CameraPropertiesPage.qml is the example page. It displays the status of the available properties of the selected camera and also allows you to activate and deactivate the camera using a pull down menu.
  • ConditionItem.qml implements the basic view for a property condition:
    • Theme.presenceColor(Theme.PresenceAvailable) is used for the valid property values;
    • Theme.presenceColor(Theme.PresenceBusy) is used for the invalid property values;
    • Theme.presenceColor(Theme.PresenceOffline) is used for the properties with unknown condition.
  • extendedcamera.h and extendedcamera.cpp implement an extension of QCamera to provide more properties for QML: capture mode, settings of viewfinder, exposure, focus, image processing and recorder. It uses additional classes to export some data types for QML:
  • cameraprovider.h and cameraprovider.cpp implement a provider of camera by the device name.

Declarative Camera

This example demonstrates how capture a images and record a video and how to change the camera as well as some other camera settings.

Screenshots

screenshots

This document in Russian / Перевод этого документа на русский язык