forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[camera_platform_interface] Add platform interface methods for settin…
…g auto exposure. (flutter#3345) * Added platform interface methods for setting auto exposure. * Added platform interface methods for setting auto exposure. * Remove workspace files
- Loading branch information
Showing
11 changed files
with
494 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/camera/camera_platform_interface/lib/src/types/exposure_mode.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2019 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
/// The possible exposure modes that can be set for a camera. | ||
enum ExposureMode { | ||
/// Automatically determine exposure settings. | ||
auto, | ||
|
||
/// Lock the currently determined exposure settings. | ||
locked, | ||
} | ||
|
||
/// Returns the exposure mode as a String. | ||
String serializeExposureMode(ExposureMode exposureMode) { | ||
switch (exposureMode) { | ||
case ExposureMode.locked: | ||
return 'locked'; | ||
case ExposureMode.auto: | ||
return 'auto'; | ||
default: | ||
throw ArgumentError('Unknown ExposureMode value'); | ||
} | ||
} | ||
|
||
/// Returns the exposure mode for a given String. | ||
ExposureMode deserializeExposureMode(String str) { | ||
switch (str) { | ||
case "locked": | ||
return ExposureMode.locked; | ||
case "auto": | ||
return ExposureMode.auto; | ||
default: | ||
throw ArgumentError('"$str" is not a valid ExposureMode value'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.