CameraParameters class
Camera service settings.
To make camera parameters take effect, applications have to call Camera.setParameters. For example, after CameraParameters.setWhiteBalance is called, white balance is not actually changed until Camera.setParameters is called with the changed parameters object.
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
CameraParameters.getSupportedColorEffects before calling
CameraParameters.setColorEffect. If the camera does not support color
effects, CameraParameters.getSupportedColorEffects will return null
.
- Annotations
-
- @Reference('android_hardware/camera/CameraParameters')
Constructors
- CameraParameters()
- Construct a CameraParameters.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
flatten(
) → Future< String> - Creates a single string with all the parameters set in this CameraParameters object.
-
get(
String key) → Future< String?> -
Returns the value of a
String
parameter. -
getAntibanding(
) → Future< String> - Gets the current antibanding setting.
-
getAutoExposureLock(
) → Future< bool> - Gets the state of the auto-exposure lock.
-
getAutoWhiteBalanceLock(
) → Future< bool> - Gets the state of the auto-white balance lock.
-
getColorEffect(
) → Future< String> - Gets the current color effect setting.
-
getExposureCompensation(
) → Future< int> - Gets the current exposure compensation index.
-
getExposureCompensationStep(
) → Future< double> - Gets the exposure compensation step.
-
getFlashMode(
) → Future< String?> - Gets the current flash mode setting.
-
getFocalLength(
) → Future< double> - Gets the focal length (in millimeter) of the camera.
-
getFocusAreas(
) → Future< List< CameraArea> ?> - Gets the current focus areas.
-
getFocusDistances(
) → Future< List< double> > - Gets the distances from the camera to where an object appears to be in focus.
-
getFocusMode(
) → Future< String> - Gets the current focus mode setting.
-
getHorizontalViewAngle(
) → Future< double> - Gets the horizontal angle of view in degrees.
-
getInt(
String key) → Future< int> - Returns the value of an integer parameter.
-
getJpegQuality(
) → Future< int> - Returns the quality setting for the JPEG picture.
-
getJpegThumbnailQuality(
) → Future< int> - Returns the quality setting for the EXIF thumbnail in Jpeg picture.
-
getJpegThumbnailSize(
) → Future< CameraSize> - Returns the dimensions for EXIF thumbnail in Jpeg picture.
-
getMaxExposureCompensation(
) → Future< int> - Gets the maximum exposure compensation index.
-
getMaxNumFocusAreas(
) → Future< int> - Gets the maximum number of focus areas supported.
-
getMaxNumMeteringAreas(
) → Future< int> - Gets the maximum number of metering areas supported.
-
getMaxZoom(
) → Future< int> - Gets the maximum zoom value allowed for snapshot.
-
getMeteringAreas(
) → Future< List< CameraArea> ?> - Gets the current metering areas.
-
getMinExposureCompensation(
) → Future< int> - Gets the minimum exposure compensation index.
-
getPictureFormat(
) → Future< int> - Returns the image format for pictures.
-
getPictureSize(
) → Future< CameraSize> - Returns the dimension setting for pictures.
-
getPreferredPreviewSizeForVideo(
) → Future< CameraSize?> - Returns the preferred or recommended preview size (width and height) in pixels for video recording.
-
getPreviewFormat(
) → Future< int> - Returns the image format for preview frames got from PreviewCallback.
-
getPreviewFpsRange(
) → Future< List< int> > - Returns the current minimum and maximum preview fps.
-
getPreviewSize(
) → Future< CameraSize> - Returns the dimensions setting for preview pictures.
-
getSceneMode(
) → Future< String?> - Gets the current scene mode setting.
-
getSupportedAntibanding(
) → Future< List< String> ?> - Gets the supported antibanding values.
-
getSupportedColorEffects(
) → Future< List< String> ?> - A list of supported color effects.
-
getSupportedFlashModes(
) → Future< List< String> > - Gets the supported flash modes.
-
getSupportedFocusModes(
) → Future< List< String> > - Gets the supported focus modes.
-
getSupportedJpegThumbnailSizes(
) → Future< CameraSize> - Gets the supported jpeg thumbnail sizes.
-
getSupportedPictureFormats(
) → Future< List< int> > - Gets the supported picture formats.
-
getSupportedPictureSizes(
) → Future< List< CameraSize> > - Gets the supported picture sizes.
-
getSupportedPreviewFormats(
) → Future< List< int> > - Gets the supported preview formats.
-
getSupportedPreviewFpsRange(
) → Future< List< List< >int> > - Gets the supported preview fps (frame-per-second) ranges.
-
getSupportedPreviewSizes(
) → Future< List< CameraSize> > - Gets the supported preview sizes.
-
getSupportedSceneModes(
) → Future< List< String> ?> - Gets the supported scene modes.
-
getSupportedVideoSizes(
) → Future< List< CameraSize> ?> - Gets the supported video frame sizes that can be used by MediaRecorder.
-
getSupportedWhiteBalance(
) → Future< List< String> ?> - Gets the supported white balance.
-
getVerticalViewAngle(
) → Future< double> - Gets the vertical angle of view in degrees.
-
getVideoStabilization(
) → Future< bool> - Get the current state of video stabilization.
-
getWhiteBalance(
) → Future< String?> - Gets the current white balance setting.
-
getZoom(
) → Future< int> - Gets current zoom value.
-
getZoomRatios(
) → Future< List< int> > - Gets the zoom ratios of all zoom values.
-
isAutoExposureLockSupported(
) → Future< bool> -
Returns
true
if auto-exposure locking is supported. -
isAutoWhiteBalanceLockSupported(
) → Future< bool> - If auto-white balance locking is supported.
-
isSmoothZoomSupported(
) → Future< bool> - Whether smooth zoom is supported.
-
isVideoSnapshotSupported(
) → Future< bool> - If video snapshot is supported.
-
isVideoStabilizationSupported(
) → Future< bool> - If video stabilization is supported.
-
isZoomSupported(
) → Future< bool> -
Returns
true
if zoom is supported. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
String key) → Future< void> -
removeGpsData(
) → Future< void> - Removes GPS latitude, longitude, altitude, and timestamp from the parameters.
-
set(
String key, Object value) → Future< void> - Sets a String parameter.
-
setAntibanding(
String antibanding) → Future< void> - Sets the antibanding.
-
setAutoExposureLock(
{required bool toggle}) → Future< void> - Sets the auto-exposure lock state.
-
setAutoWhiteBalanceLock(
{required bool toggle}) → Future< void> - Sets the auto-white balance lock state.
-
setColorEffect(
String effect) → Future< void> - Sets the current color effect setting.
-
setExposureCompensation(
int value) → Future< void> - Sets the exposure compensation index.
-
setFlashMode(
String mode) → Future< void> - Sets the flash mode.
-
setFocusAreas(
covariant List< CameraArea> ? focusAreas) → Future<void> - Sets focus areas.
-
setFocusMode(
String value) → Future< void> - Sets the focus mode.
-
setGpsAltitude(
double meters) → Future< void> - Sets GPS altitude in meters.
-
setGpsLatitude(
double latitude) → Future< void> - Sets GPS latitude coordinate.
-
setGpsLongitude(
double longitude) → Future< void> - Sets GPS longitude coordinate.
-
setGpsProcessingMethod(
String processingMethod) → Future< void> - Sets GPS processing method.
-
setGpsTimestamp(
int timestamp) → Future< void> - Sets GPS timestamp.
-
setJpegQuality(
int quality) → Future< void> - Sets Jpeg quality of captured picture.
-
setJpegThumbnailQuality(
int quality) → Future< void> - Sets the quality of the EXIF thumbnail in Jpeg picture.
-
setJpegThumbnailSize(
int width, int height) → Future< void> - Sets the dimensions for EXIF thumbnail in Jpeg picture in pixels.
-
setMeteringAreas(
List< CameraArea> meteringAreas) → Future<void> - Sets metering areas.
-
setPictureFormat(
int pixelFormat) → Future< void> - Sets the image format for pictures.
-
setPictureSize(
int width, int height) → Future< void> - Sets the dimensions for pictures.
-
setPreviewFormat(
int pixelFormat) → Future< void> - Sets the image format for preview pictures.
-
setPreviewFpsRange(
{required int min, required int max}) → Future< void> - Sets the minimum and maximum preview fps.
-
setPreviewSize(
int width, int height) → Future< void> - Sets the dimensions for preview pictures.
-
setRecordingHint(
{required bool hint}) → Future< void> - Sets recording mode hint.
-
setRotation(
int rotation) → Future< void> - Sets the clockwise rotation angle in degrees relative to the orientation of the camera.
-
setSceneMode(
String mode) → Future< void> - Sets the scene mode.
-
setVideoStabilization(
{required bool toggle}) → Future< void> - Enables and disables video stabilization.
-
setWhiteBalance(
String value) → Future< void> - Sets the white balance.
-
setZoom(
int value) → Future< void> - Sets current zoom value.
-
toString(
) → String -
A string representation of this object.
inherited
-
unflatten(
String flattened) → Future< void> - Takes a flattened string of parameters and adds each one to this CameraParameterss object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- antibanding50hz → const String
- Antibanding at 50hz.
- antibanding60hz → const String
- Antibanding at 60hz.
- antibandingAuto → const String
- Allow the sensor to detect the best setting for antibanding.
- antibandingOff → const String
- Turns off antibanding.
- effectAqua → const String
- Color effect aqua.
- effectBlackboard → const String
- Color effect blackboard.
- effectMono → const String
- Color effect mono.
- effectNegative → const String
- Color effect negative.
- effectNone → const String
- No color effect.
- effectPosterize → const String
- Color effect posterize.
- effectSepia → const String
- Color effect sepia.
- effectSolarize → const String
- Color effect solarize.
- effectWhiteboard → const String
- Color effect whiteboard.
- flashModeAuto → const String
- Flash will be fired automatically when required.
- flashModeOff → const String
- Flash will not be fired.
- flashModeOn → const String
- Flash will always be fired during snapshot.
- flashModeRedEye → const String
- Flash will be fired in red-eye reduction mode.
- flashModeTorch → const String
- Constant emission of light during preview, auto-focus and snapshot.
- focusDistanceFarIndex → const int
- The array index of far focus distance for use with getFocusDistances.
- focusDistanceNearIndex → const int
- The array index of near focus distance for use with getFocusDistances.
- focusDistanceOptimalIndex → const int
- The array index of optimal focus distance for use with getFocusDistances.
- focusModeAuto → const String
- Auto-focus mode.
- focusModeContinuousPicture → const String
- Continuous auto focus mode intended for taking pictures.
- focusModeContinuousVideo → const String
- Continuous auto focus mode intended for video recording.
- focusModeEDOF → const String
- Extended depth of field (EDOF).
- focusModeFixed → const String
- Focus is fixed.
- focusModeInfinity → const String
- Focus is set at infinity.
- focusModeMacro → const String
- Macro (close-up) focus mode.
- previewFpsMaxIndex → const int
- The array index of maximum preview fps for use with getPreviewFpsRange or getSupportedPreviewFpsRange.
- previewFpsMinIndex → const int
- The array index of minimum preview fps for use with getPreviewFpsRange or getSupportedPreviewFpsRange.
- sceneModeAction → const String
- Take photos of fast moving objects. Same as sceneModeSports.
- sceneModeAuto → const String
- Scene mode is off.
- sceneModeBarcode → const String
- Applications are looking for a barcode.
- sceneModeBeach → const String
- Take pictures on the beach.
- sceneModeCandlelight → const String
- Capture the naturally warm color of scenes lit by candles.
- sceneModeFireworks → const String
- For shooting firework displays.
- sceneModeHdr → const String
- Capture a scene using high dynamic range imaging techniques.
- sceneModeLandscape → const String
- Take pictures on distant objects.
- sceneModeNight → const String
- Take photos at night.
- sceneModeNightPortrait → const String
- Take people pictures at night.
- sceneModeParty → const String
- Take indoor low-light shot.
- sceneModePortrait → const String
- Take people pictures.
- sceneModeSnow → const String
- Take pictures on the snow.
- sceneModeSports → const String
- Take photos of fast moving objects. Same as sceneModeAction.
- sceneModeSteadyPhoto → const String
- Avoid blurry pictures (for example, due to hand shake).
- sceneModeSunset → const String
- Take sunset photos.
- sceneModeTheatre → const String
- Take photos in a theater. Flash light is off.
- whiteBalanceAuto → const String
- whiteBalanceCloudyDaylight → const String
- whiteBalanceDaylight → const String
- whiteBalanceFluorescent → const String
- whiteBalanceIncandescent → const String
- whiteBalanceShade → const String
- whiteBalanceTwilight → const String
- whiteBalanceWarmFluorescent → const String