java.lang.Object | |
↳ | android.hardware.Camera.Parameters |
Handles the parameters for pictures created by a Camera service.
To make camera parameters take effect, applications have to call Camera.setParameters. For example, after setWhiteBalance is called, white balance is not changed until Camera.setParameters() is called.
Different devices may have different camera capabilities, such as picture size or flash modes. The application should query the camera capabilities before setting parameters. For example, the application should call getSupportedColorEffects before calling setEffect. If the camera does not support color effects, getSupportedColorEffects will return null.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a single string with all the parameters set in
this Parameters object.
| |||||||||||
Returns the value of a String parameter.
| |||||||||||
Gets the current antibanding setting.
| |||||||||||
Gets the current color effect setting.
| |||||||||||
Gets the current flash mode setting.
| |||||||||||
Gets the current focus mode setting.
| |||||||||||
Returns the value of an integer parameter.
| |||||||||||
Returns the quality setting for the JPEG picture.
| |||||||||||
Returns the quality setting for the EXIF thumbnail in Jpeg picture.
| |||||||||||
Returns the dimensions for EXIF thumbnail in Jpeg picture.
| |||||||||||
Returns the image format for pictures.
| |||||||||||
Returns the dimension setting for pictures.
| |||||||||||
Returns the image format for preview pictures got from
Camera.PreviewCallback . | |||||||||||
Returns the setting for the rate at which preview frames
are received.
| |||||||||||
Returns the dimensions setting for preview pictures.
| |||||||||||
Gets the current scene mode setting.
| |||||||||||
Gets the supported antibanding values.
| |||||||||||
Gets the supported color effects.
| |||||||||||
Gets the supported flash modes.
| |||||||||||
Gets the supported focus modes.
| |||||||||||
Gets the supported picture formats.
| |||||||||||
Gets the supported picture sizes.
| |||||||||||
Gets the supported preview formats.
| |||||||||||
Gets the supported preview frame rates.
| |||||||||||
Gets the supported preview sizes.
| |||||||||||
Gets the supported scene modes.
| |||||||||||
Gets the supported white balance.
| |||||||||||
Gets the current white balance setting.
| |||||||||||
Removes GPS latitude, longitude, altitude, and timestamp from the
parameters.
| |||||||||||
Sets an integer parameter.
| |||||||||||
Sets a String parameter.
| |||||||||||
Sets the antibanding.
| |||||||||||
Sets the current color effect setting.
| |||||||||||
Sets the flash mode.
| |||||||||||
Sets the focus mode.
| |||||||||||
Sets GPS altitude.
| |||||||||||
Sets GPS latitude coordinate.
| |||||||||||
Sets GPS longitude coordinate.
| |||||||||||
Sets GPS timestamp.
| |||||||||||
Sets Jpeg quality of captured picture.
| |||||||||||
Sets the quality of the EXIF thumbnail in Jpeg picture.
| |||||||||||
Sets the dimensions for EXIF thumbnail in Jpeg picture.
| |||||||||||
Sets the image format for pictures.
| |||||||||||
Sets the dimensions for pictures.
| |||||||||||
Sets the image format for preview pictures.
| |||||||||||
Sets the rate at which preview frames are received.
| |||||||||||
Sets the dimensions for preview pictures.
| |||||||||||
Sets the orientation of the device in degrees.
| |||||||||||
Sets the scene mode.
| |||||||||||
Sets the white balance.
| |||||||||||
Takes a flattened string of parameters and adds each one to
this Parameters object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Flash will be fired automatically when required. The flash may be fired during preview, auto-focus, or snapshot depending on the driver.
Flash will not be fired.
Flash will always be fired during snapshot. The flash may also be fired during preview or auto-focus depending on the driver.
Flash will be fired in red-eye reduction mode.
Constant emission of light during preview, auto-focus and snapshot. This can also be used for video recording.
Auto-focus mode.
Focus is fixed. The camera is always in this mode if the focus is not
adjustable. If the camera has auto-focus, this mode can fix the
focus, which is usually at hyperfocal distance. Applications should
not call autoFocus(AutoFocusCallback)
in this mode.
Focus is set at infinity. Applications should not call
autoFocus(AutoFocusCallback)
in this mode.
Creates a single string with all the parameters set in this Parameters object.
The unflatten(String)
method does the reverse.
Returns the value of a String parameter.
key | the key name for the parameter |
---|
Gets the current antibanding setting.
Gets the current color effect setting.
Gets the current flash mode setting.
Gets the current focus mode setting.
FOCUS_MODE_FIXED
. If the focus mode is not FOCUS_MODE_FIXED
or FOCUS_MODE_INFINITY
, applications should call
autoFocus(AutoFocusCallback)
to start the focus.
Returns the value of an integer parameter.
key | the key name for the parameter |
---|
Returns the quality setting for the JPEG picture.
Returns the quality setting for the EXIF thumbnail in Jpeg picture.
Returns the dimensions for EXIF thumbnail in Jpeg picture.
Returns the image format for pictures.
Returns the dimension setting for pictures.
Returns the image format for preview pictures got from
Camera.PreviewCallback
.
PixelFormat
int representing
the preview picture format.
Returns the setting for the rate at which preview frames are received.
Returns the dimensions setting for preview pictures.
Gets the current scene mode setting.
Gets the supported antibanding values.
Gets the supported color effects.
Gets the supported flash modes.
Gets the supported focus modes.
Gets the supported picture formats.
Gets the supported picture sizes.
Gets the supported preview formats.
Gets the supported preview frame rates.
Gets the supported preview sizes.
Gets the supported scene modes.
Gets the supported white balance.
Gets the current white balance setting.
Removes GPS latitude, longitude, altitude, and timestamp from the parameters.
Sets an integer parameter.
key | the key name for the parameter |
---|---|
value | the int value of the parameter |
Sets a String parameter.
key | the key name for the parameter |
---|---|
value | the String value of the parameter |
Sets the antibanding.
antibanding | ANTIBANDING_XXX string constant. |
---|
Sets the current color effect setting.
value | EFFECT_XXX string constants. |
---|
Sets the flash mode.
value | FLASH_MODE_XXX string constants. |
---|
Sets the focus mode.
value | FOCUS_MODE_XXX string constants. |
---|
Sets GPS altitude. This will be stored in JPEG EXIF header.
altitude | GPS altitude in meters. |
---|
Sets GPS latitude coordinate. This will be stored in JPEG EXIF header.
latitude | GPS latitude coordinate. |
---|
Sets GPS longitude coordinate. This will be stored in JPEG EXIF header.
longitude | GPS longitude coordinate. |
---|
Sets GPS timestamp. This will be stored in JPEG EXIF header.
timestamp | GPS timestamp (UTC in seconds since January 1, 1970). |
---|
Sets Jpeg quality of captured picture.
quality | the JPEG quality of captured picture. The range is 1 to 100, with 100 being the best. |
---|
Sets the quality of the EXIF thumbnail in Jpeg picture.
quality | the JPEG quality of the EXIF thumbnail. The range is 1 to 100, with 100 being the best. |
---|
Sets the dimensions for EXIF thumbnail in Jpeg picture.
width | the width of the thumbnail, in pixels |
---|---|
height | the height of the thumbnail, in pixels |
Sets the image format for pictures.
pixel_format | the desired picture format (PixelFormat.YCbCr_420_SP (NV21), PixelFormat.RGB_565, or PixelFormat.JPEG) |
---|
Sets the dimensions for pictures.
width | the width for pictures, in pixels |
---|---|
height | the height for pictures, in pixels |
Sets the image format for preview pictures.
If this is never called, the default format will be
YCbCr_420_SP
, which
uses the NV21 encoding format.
pixel_format | the desired preview picture format, defined
by one of the PixelFormat constants.
(E.g., PixelFormat.YCbCr_420_SP (default),
PixelFormat.RGB_565, or
PixelFormat.JPEG) |
---|
Sets the rate at which preview frames are received.
fps | the frame rate (frames per second) |
---|
Sets the dimensions for preview pictures.
width | the width of the pictures, in pixels |
---|---|
height | the height of the pictures, in pixels |
Sets the orientation of the device in degrees. For example, suppose
the natural position of the device is landscape. If the user takes a
picture in landscape mode in 2048x1536 resolution, the rotation
should be set to 0. If the user rotates the phone 90 degrees
clockwise, the rotation should be set to 90. Applications can use
OrientationEventListener
to set this parameter.
The camera driver may set orientation in the EXIF header without
rotating the picture. Or the driver may rotate the picture and
the EXIF thumbnail. If the Jpeg picture is rotated, the orientation
in the EXIF header will be missing or 1 (row #0 is top and column #0
is left side).
rotation | The orientation of the device in degrees. Rotation can only be 0, 90, 180 or 270. |
---|
IllegalArgumentException | if rotation value is invalid. |
---|
Sets the scene mode. Other parameters may be changed after changing scene mode. For example, flash and supported flash mode may be changed to "off" in night scene mode. After setting scene mode, applications should call getParameters to know if some parameters are changed.
value | SCENE_MODE_XXX string constants. |
---|
Sets the white balance.
value | WHITE_BALANCE_XXX string constant. |
---|
Takes a flattened string of parameters and adds each one to this Parameters object.
The flatten()
method does the reverse.
flattened | a String of parameters (key-value paired) that are semi-colon delimited |
---|