|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
FocusControl
controls the focus of the camera device.
Please note, that (optical) zooming might affect the focusing settings. See
ZoomControl.setOpticalZoom
for details.
Field Summary | |
static int |
AUTO
Autofocus. |
static int |
AUTO_LOCK
Locks the autofocus. |
static int |
NEXT
Moves the setting to the next supported level. |
static int |
PREVIOUS
Moves the setting to the previous supported level. |
static int |
UNKNOWN
Unknown value. |
Method Summary | |
int |
getFocus()
Returns the focus setting of the camera device. |
int |
getFocusSteps()
Tells how many steps the focus has. |
boolean |
getMacro()
Gets the current macro focus mode. |
int |
getMinFocus()
Returns the minimum focus distance supported (either manual or AUTO). |
boolean |
isAutoFocusSupported()
Returns true if the automatic focus is supported by being able to set AUTO as a parameter for the setFocus method. |
boolean |
isMacroSupported()
Returns true if the macro focus mode is supported. |
boolean |
isManualFocusSupported()
Returns true if the manual focus is supported by being able to set the distance (or NEXT or PREVIOUS or Integer.MAX_VALUE) with setFocus method. |
int |
setFocus(int distance)
Sets the focus distance. |
void |
setMacro(boolean enable)
Toggles the macro focus mode. |
Field Detail |
public static final int AUTO
public static final int AUTO_LOCK
public static final int NEXT
public static final int PREVIOUS
public static final int UNKNOWN
Method Detail |
public int setFocus(int distance) throws javax.microedition.media.MediaException
distance
- in millimeters or AUTO for autofocus
or AUTO_LOCK for locking the autofocus or Interger.MAX_VALUE
for focus to infinity or NEXT for next
supported distance (further from the camera) or PREVIOUS
for previous supported distance (closer to the camera).
Setting a value other than AUTO, AUTO_LOCK or Integer.MAX_VALUE might
be rounded to the closest distance supported.
If the current focus setting is other than AUTO,
setFocus(AUTO_LOCK)
will not affect anything.
Integer.MAX_VALUE
for infinity
javax.microedition.media.MediaException
- if the given focus setting is not supportedisManualFocusSupported()
,
isAutoFocusSupported()
public int getFocus()
Integer.MAX_VALUE
for focus to infinity
or UNKNOWN if the focus setting is unknown.public int getMinFocus()
public int getFocusSteps()
public boolean isManualFocusSupported()
true
if the manual focus is supported,
false
otherwisepublic boolean isAutoFocusSupported()
setFocus
method.
true
if the automatic focus is supported,
false
otherwisepublic boolean isMacroSupported()
true
if the macro focus is supported,
false
otherwisepublic void setMacro(boolean enable) throws javax.microedition.media.MediaException
Toggles the macro focus mode. With this mode on, you can focus closer to the camera compared to a normal focusing mode. On the contrary, the range of available optical zoom settings might be more limited in the macro mode.
Please note, that this method might affect all optical
zoom settings in the ZoomControl
.
This method might also change all the settings
in this FocusControl
.
enable
- true
to turn the macro mode on,
false
to turn it off
javax.microedition.media.MediaException
- if the given mode is not supportedpublic boolean getMacro()
true
if the macro focus is enabled,
false
otherwise
|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |