net.rim.device.api.amms.control.camera
Interface EnhancedFocusControl

All Superinterfaces:
FocusControl, Control

public interface EnhancedFocusControl
extends FocusControl

EnhancedFocusControl extends the functionality provided by FocusControl to provide more functionality over the camera focus. Note: If usage relies on a particular focus mode setting, then that focus mode should be set explicitly via EnhancedFocusControl.setFocusMode(java.lang.String). Even if the desired focus mode currently appears to be the default, the default focus mode is not guaranteed to stay the same.

Sample Code

 Player player = javax.microedition.media.Manager.createPlayer( "capture://video?encoding=image/jpeg" );
 EnhancedFocusControl efc = (EnhancedFocusControl) player.getControl("net.rim.device.api.amms.control.camera.EnhancedFocusControl");
 

Since:
BlackBerry API 6.0.0

Field Summary
static String FOCUS_MODE_CONTINUOUS
          Focus Mode Type: Continuous.
static String FOCUS_MODE_FIXED
          Focus Mode Type: Fixed.
static String FOCUS_MODE_SINGLESHOT
          Focus Mode Type: Singleshot.
 
Fields inherited from interface javax.microedition.amms.control.camera.FocusControl
AUTO, AUTO_LOCK, NEXT, PREVIOUS, UNKNOWN
 
Method Summary
 String getCurrentFocusMode()
          Returns the currently set focus mode.
 boolean isAutoFocusLocked()
          Returns whether or not the autofocus is locked.
 boolean isFocusModeSupported(String focusModeID)
          Used to determine if the device supports the input Focus Mode settings is supported on the device.
 void setFocusMode(String focusMode)
          Sets the desired focus mode setting.
 void startAutoFocus()
          Locks the camera autofocus.
 void stopAutoFocus()
          Unlocks the camera autofocus.
 
Methods inherited from interface javax.microedition.amms.control.camera.FocusControl
getFocus, getFocusSteps, getMacro, getMinFocus, isAutoFocusSupported, isMacroSupported, isManualFocusSupported, setFocus, setMacro
 



Field Detail

FOCUS_MODE_FIXED

static final String FOCUS_MODE_FIXED
Focus Mode Type: Fixed. The focus is locked at infinity.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FOCUS_MODE_SINGLESHOT

static final String FOCUS_MODE_SINGLESHOT
Focus Mode Type: Singleshot. The focus is locked immediately before capture.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0

FOCUS_MODE_CONTINUOUS

static final String FOCUS_MODE_CONTINUOUS
Focus Mode Type: Continuous. The focus is continuously scanned and always ready for capture.

See Also:
Constant Field Values
Since:
BlackBerry API 7.0.0


Method Detail

startAutoFocus

void startAutoFocus()
                    throws MediaException
Locks the camera autofocus. The camera viewfinder will remain focused until EnhancedFocusControl.stopAutoFocus() is called, until a picture is taken (via burst shooting with a SnapshotControl or a call to VideoControl.getSnapshot(String)), or until the viewfinder is stopped or closed. If the autofocus is already locked, this method does nothing.

Throws:
UnsupportedOperationException - If autofocus is not supported.
MediaException - If locking the autofocus fails.
Since:
BlackBerry API 6.0.0

stopAutoFocus

void stopAutoFocus()
                   throws MediaException
Unlocks the camera autofocus. If the focus is unlocked, this method does nothing. Note that taking a picture when the focus is unlocked will still lock focus momentarily to capture the image.

Throws:
MediaException - If unlocking the autofocus fails.
Since:
BlackBerry API 6.0.0

isAutoFocusLocked

boolean isAutoFocusLocked()
Returns whether or not the autofocus is locked.

Returns:
true if autofocus is locked, false otherwise.
Since:
BlackBerry API 6.0.0

setFocusMode

void setFocusMode(String focusMode)
Sets the desired focus mode setting. The focus mode must be supported or will

Parameters:
focusMode - A value indicating the type of Focus Mode that will be set. Currently, there are 3 focus modes settings, the focusMode values for each of the possible Focus Mode settings are defined as follows:

FOCUS_MODE_FIXED - The focus is locked to infinity. FOCUS_MODE_SINGLESHOT - The focus locked can be set manually via EnhancedFocusControl.startAutoFocus()/EnhancedFocusControl.stopAutoFocus(). As well, if the focus, is not manually locked, it will be locked during the photo capture when VideoControl.getSnapshot(String) is called. FOCUS_MODE_CONTINUOUS - The focus is continuously scanned and set automatically.

Since:
BlackBerry API 7.0.0

getCurrentFocusMode

String getCurrentFocusMode()
Returns the currently set focus mode.

Returns:
the constant defined string representing the currently set focus mode.
Since:
BlackBerry API 7.0.0

isFocusModeSupported

boolean isFocusModeSupported(String focusModeID)
Used to determine if the device supports the input Focus Mode settings is supported on the device.

Parameters:
focusMode - A value indicating the type of Focus Mode that is checked. Currently, there are 3 focus modes settings, the focusMode values for each of the possible Focus Mode settings are defined as follows:

FOCUS_MODE_FIXED - The focus is locked to infinity. FOCUS_MODE_SINGLESHOT - The focus locked can be set manually via EnhancedFocusControl.startAutoFocus()/EnhancedFocusControl.stopAutoFocus(). As well, if the focus, is not manually locked, it will be locked during the photo capture when VideoControl.getSnapshot(String) is called. FOCUS_MODE_CONTINUOUS - The focus is continuously scanned and set automatically.

Returns:
a boolean value indicating whether or not the input Focus Mode is supported.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal