forked from google/cameraview
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I91eaa845c6afd80c99fad9ec1979254dec2ef9ab
- Loading branch information
Showing
12 changed files
with
179 additions
and
9 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
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
29 changes: 29 additions & 0 deletions
29
library/src/main/base/com/google/android/cameraview/Constants.java
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,29 @@ | ||
/* | ||
* Copyright (C) 2016 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.android.cameraview; | ||
|
||
|
||
interface Constants { | ||
|
||
int FOCUS_MODE_OFF = 0; | ||
int FOCUS_MODE_AUTO = 1; | ||
int FOCUS_MODE_MACRO = 2; | ||
int FOCUS_MODE_CONTINUOUS_PICTURE = 3; | ||
int FOCUS_MODE_CONTINUOUS_VIDEO = 4; | ||
int FOCUS_MODE_EDOF = 5; | ||
|
||
} |
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
43 changes: 43 additions & 0 deletions
43
library/src/main/camera1/com/google/android/cameraview/Camera1Constants.java
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,43 @@ | ||
/* | ||
* Copyright (C) 2016 The Android Open Source Project | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.android.cameraview; | ||
|
||
|
||
import android.hardware.Camera; | ||
import android.support.v4.util.SparseArrayCompat; | ||
|
||
@SuppressWarnings("deprecation") | ||
class Camera1Constants { | ||
|
||
private static SparseArrayCompat<String> sFocusModesMap; | ||
|
||
static String convertFocusMode(int focusMode) { | ||
if (sFocusModesMap == null) { | ||
sFocusModesMap = new SparseArrayCompat<>(); | ||
sFocusModesMap.put(Constants.FOCUS_MODE_OFF, Camera.Parameters.FOCUS_MODE_FIXED); | ||
sFocusModesMap.put(Constants.FOCUS_MODE_AUTO, Camera.Parameters.FOCUS_MODE_AUTO); | ||
sFocusModesMap.put(Constants.FOCUS_MODE_MACRO, Camera.Parameters.FOCUS_MODE_MACRO); | ||
sFocusModesMap.put(Constants.FOCUS_MODE_CONTINUOUS_PICTURE, | ||
Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE); | ||
sFocusModesMap.put(Constants.FOCUS_MODE_CONTINUOUS_VIDEO, | ||
Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); | ||
sFocusModesMap.put(Constants.FOCUS_MODE_EDOF, Camera.Parameters.FOCUS_MODE_EDOF); | ||
} | ||
return sFocusModesMap.get(focusMode); | ||
} | ||
|
||
} |
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