CameraParameters class Null safety

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.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

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 non-existent 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.
'50hz'
antibanding60hz → const String
Antibanding at 60hz.
'60hz'
antibandingAuto → const String
Allow the sensor to detect the best setting for antibanding.
'auto'
antibandingOff → const String
Turns off antibanding.
'off'
effectAqua → const String
Color effect aqua.
'aqua'
effectBlackboard → const String
Color effect blackboard.
'blackboard'
effectMono → const String
Color effect mono.
'mono'
effectNegative → const String
Color effect negative.
'negative'
effectNone → const String
No color effect.
'none'
effectPosterize → const String
Color effect posterize.
'posterize'
effectSepia → const String
Color effect sepia.
'sepia'
effectSolarize → const String
Color effect solarize.
'solarize'
effectWhiteboard → const String
Color effect whiteboard.
'whiteboard'
flashModeAuto → const String
Flash will be fired automatically when required.
'auto'
flashModeOff → const String
Flash will not be fired.
'off'
flashModeOn → const String
Flash will always be fired during snapshot.
'on'
flashModeRedEye → const String
Flash will be fired in red-eye reduction mode.
'red-eye'
flashModeTorch → const String
Constant emission of light during preview, auto-focus and snapshot.
'torch'
focusDistanceFarIndex → const int
The array index of far focus distance for use with getFocusDistances.
0x00000002
focusDistanceNearIndex → const int
The array index of near focus distance for use with getFocusDistances.
0x00000000
focusDistanceOptimalIndex → const int
The array index of optimal focus distance for use with getFocusDistances.
0x00000001
focusModeAuto → const String
Auto-focus mode.
'auto'
focusModeContinuousPicture → const String
Continuous auto focus mode intended for taking pictures.
'continuous-picture'
focusModeContinuousVideo → const String
Continuous auto focus mode intended for video recording.
'continuous-video'
focusModeEDOF → const String
Extended depth of field (EDOF).
'edof'
focusModeFixed → const String
Focus is fixed.
'fixed'
focusModeInfinity → const String
Focus is set at infinity.
'infinity'
focusModeMacro → const String
Macro (close-up) focus mode.
'macro'
previewFpsMaxIndex → const int
The array index of maximum preview fps for use with getPreviewFpsRange or getSupportedPreviewFpsRange.
0x00000001
previewFpsMinIndex → const int
The array index of minimum preview fps for use with getPreviewFpsRange or getSupportedPreviewFpsRange.
0x00000000
sceneModeAction → const String
Take photos of fast moving objects. Same as sceneModeSports.
'action'
sceneModeAuto → const String
Scene mode is off.
'auto'
sceneModeBarcode → const String
Applications are looking for a barcode.
'barcode'
sceneModeBeach → const String
Take pictures on the beach.
'beach'
sceneModeCandlelight → const String
Capture the naturally warm color of scenes lit by candles.
'candlelight'
sceneModeFireworks → const String
For shooting firework displays.
'fireworks'
sceneModeHdr → const String
Capture a scene using high dynamic range imaging techniques.
'hdr'
sceneModeLandscape → const String
Take pictures on distant objects.
'landscape'
sceneModeNight → const String
Take photos at night.
'night'
sceneModeNightPortrait → const String
Take people pictures at night.
'night-portrait'
sceneModeParty → const String
Take indoor low-light shot.
'party'
sceneModePortrait → const String
Take people pictures.
'portrait'
sceneModeSnow → const String
Take pictures on the snow.
'snow'
sceneModeSports → const String
Take photos of fast moving objects. Same as sceneModeAction.
'sports'
sceneModeSteadyPhoto → const String
Avoid blurry pictures (for example, due to hand shake).
'steadyphoto'
sceneModeSunset → const String
Take sunset photos.
'sunset'
sceneModeTheatre → const String
Take photos in a theater. Flash light is off.
'theatre'
whiteBalanceAuto → const String
'auto'
whiteBalanceCloudyDaylight → const String
'cloudy-daylight'
whiteBalanceDaylight → const String
'daylight'
whiteBalanceFluorescent → const String
'fluorescent'
whiteBalanceIncandescent → const String
'incandescent'
whiteBalanceShade → const String
'shade'
whiteBalanceTwilight → const String
'twilight'
whiteBalanceWarmFluorescent → const String
'warm-fluorescent'