Wednesday, 16 January 2013

Camera


Camera

For using the built-in camera of an S60 phone, PyS60 offers a module
named camera. We think that this is one of the most fun modules in
PyS60, as it can give your programs a new view of the surrounding world.
Because of our enthusiasm for the camera module, this book includes
seven examples that are based on taking photos. Being able to use
the camera programmatically – even in the most esoteric ways – may
change your relationship with camera phones in a profound manner. For
instance, see Section 11.2 for a description of a large-scale urban photo
hunt that was implemented using the camera module! The camera
module includes three types of functions: to query features of the camera;
to open and close the viewfinder; and to take photos.
Note that the camera consumes a lot of energy. If you have an
application that uses the viewfinder or takes photos frequently, in many
cases it is necessary to recharge the battery after four or five hours.

Querying Features of the Camera

The following functions are available in the camera module to query
camera-related features of your phone:


• cameras available() returns the number of cameras available
in the device.
• image modes() returns the image modes supported by the device
as a list of strings, for example: [RGB12, RGB16, RGB] (the last one
corresponds to full-color images).
• image sizes() returns the image resolutions supported by the
device as a list of (w, h) tuples, for example: [(640, 480), (160, 120)].
• flash modes() returns the flash modes supported by the device as
a list of strings.
• max zoom() returns the maximum digital zoom value supported by
the device as an integer.
• exposure modes() returns the exposure settings supported by the
device as a list of strings.
• white balance modes() returns the white-balance modes supported
by the device as a list of strings.

No comments:

Post a Comment