Home > Products > SophiaFramework UNIVERSE > Tutorial > BREW Camera Application > - 3 / 6 -

Simple BREW Camera Application - 3 / 6 -

ICamera Interface

SFBCamera

In SophiaFramework UNIVERSE, the SFBCamera class is used to operate a camera.

The SFBCamera class is the wrapper for the BREW ICamera interface(*).

This tutorial explains the fundamental programming knowledge for processing picture images taken by the camera of a mobile handset.

* ICamera infertace depends on the kind of a mobile handset. The following cannot be applied to some mobile handsets.

* SImulator testing for this application was done using Sophia Cradle's Camulator.

Modes of the ICamera Interface

ICamera interface has the following 3 modes.

In general, Preview Mode and Snapshot Mode are used together. For example, an object that is being previewed in the Preview Mode, can be captured as a photograph in the Snapshot Mode.

This tutorial explains how to use the Preview and Snapshot Modes.

Handle Camera Events

Event handling is the most important part of the ICamera interface.

In the Preview Mode, the event CAM_STATUS_FRAME will occur when a frame image for previewing is taken.

In the Snapshot Mode, the event CAM_STATUS_START will occur when starting to take a picture and the event CAM_STATUS_DONE when a photo is taken.

A variety of events on camera processing must be correctly handled by following the proper procedure, and it is necessary to take precautions into account within the user interface.

For instance, no key inputs can be accepted when in the Snapshot Mode until a picture is ready to be taken.

DeferEncode

In the ICamera interface, the output format of a photo image should be declared by using the ICAMERA_SetMediaData ( SFBCamera::SetMediaData in SophiaFramework UNIVERSE ) macro before moving into the Snapshot Mode.

If DeferEncode is disabled, it means that the photo image will be converted into a file format as soon as it is taken by the camera in the Snapshot Mode.

If DeferEncode is enabled, the photo image will be converted into a file format at some time after it is taken.

It is therefore, not a necessity to convert a photo image into a file format immediately after it has been taken. DeferEncode could for example be used when a temporary image is being taken and does not need to be saved as a file.

However, even when DeferEncode is enabled, a photo image can be saved as a file by using the ICAMERA_EncodeSnapshot() ( SFBCamera::EncodeSnapshot() in SophiaFramework UNIVERSE ) function.

The next sections only explain the procedures using DeferEncode enabled. ( but it is almost the same with DeferEncode disabled)

Go back  1   2   3   4   5   Apdx   Next page