Camera

Description

APIs to use the Camera on BlackBerry 10

Documentation

The main forum for questions depends on the software stack being used:

Samples

HelloCamera
Shows how to set up a Cascades foreign window and connect the Camera viewfinder to it.

NativeCamera
Shows how to set up a Camera viewfinder in a non-cascades environment using libscreen.

HelloVideoCamera
Shows how to record videos using the Camera. This sample is based on the HelloCamera sample so it also illustrates how to set up a Cascades foreign window and connect the Camera viewfinder to it.

Photobomber
A camera application that let’s you take photos and then have them “bombed” by somebody. The app shows how to use the Cascades multimedia library with Camera, take a picture, manipulate the image, and add an image over another image.

RotationCamera
Demonstrates some best-practices for handling device rotation in the video viewfinder case.

BBJam Samples

A collection of sample apps demonstrated in the Native Camera API Deep-Dive session at the BlackBerry JAM conferences in San Jose, Amsterdam, and Orlando. Some of these samples are similar to those listed above, but with a focus on more in-line documentation, as well as notes on best-practices and “gotchas”. Some more advanced samples and demos are also found in this section.

Viewfinder A simple sample using libscreen which illustrates how to start a viewfinder. Includes notes on how to inventory available cameras and search for cameras based on the features you require.

RecordVideo Builds on the Viewfinder sample by adding the ability to record a video. Shows how to play a start/stop tone and how to select a filename on the camera roll to save the video to.

TakePhoto This is similar to the NativeCamera sample, but with some additional documentation. Demonstrates how to take a picture and save it to the camera roll.

TakeBurst This sample demonstrates how to do a burst photo capture and provides recommendations for efficiently saving full-resolution images at 15fps through the use of buffering. Burst capture can be used as the basis for many interesting effects such as HDR, exposure bracketing, and is used to implement the time-warp effect in the BB10 camera app.

FlashPhoto A Cascades photo-taking sample which illustrates how to query available flash modes, how to configure the flash, and how to detect whether the flash has fired when a photo is captured.

SceneZoom A Cascades photo-taking sample which illustrates how to query available scene modes and how to switch between scene modes. Also demonstrates the two mechanisms for adjusting the zoom level and how to determine the range for zoom values.

Focus A Cascades photo-taking sample which demonstrates how to operate the various focus modes available on the device. Shows how to query the available modes, how to configure them, and provides controls for interacting with the various modes (eg. sliders for manual focus or a touch-interface to focus on a particular region of the scene).

FaceFilter A C video recording sample which illustrates how to apply in-line filter effects to the live camera video stream. Face-detect metadata reporting is enabled, the face co-ordinates are extracted from the preview image stream, and the video buffer is modified with a pixelating mosaic effect. If you tap to enable video recording, you will find that the mosaic effect is present when the video is played back. This sample also illustrates the concept of event-based access to the camera buffers. For read/write buffer access, the familiar callback mechanism cannot be used.

Camera3D A C camera sample which shows how to render the camera viewfinder into an OpenGL texture. Also demonstrates the use of the event-mode interface, and the RGB video viewfinder. This sample extends the GoodCitizen 3d-cube demo.

Heartbeat A Cascades sample showing how the camera viewfinder can be used in some interesting ways. Specifically, this sample uses the video viewfinder to measure your heartrate when your finger is held over the on-board videolight. The algorithm was hastily put together, so this sample is ripe for someone who has a bit more time to implement a proper FFT. Community contribution welcome!

Presentations, Articles and Other Media

Also See

Cascades, WebWorks, Native