Methods Summary |
---|
private void | buildFlashModes(android.hardware.camera2.CameraCharacteristics p)
mSupportedFlashModes.add(FlashMode.OFF);
if (p.get(FLASH_INFO_AVAILABLE)) {
mSupportedFlashModes.add(FlashMode.AUTO);
mSupportedFlashModes.add(FlashMode.ON);
mSupportedFlashModes.add(FlashMode.TORCH);
for (int expose : p.get(CONTROL_AE_AVAILABLE_MODES)) {
if (expose == CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE) {
mSupportedFlashModes.add(FlashMode.RED_EYE);
}
}
}
|
private void | buildFocusModes(android.hardware.camera2.CameraCharacteristics p)
int[] focuses = p.get(CONTROL_AF_AVAILABLE_MODES);
if (focuses != null) {
for (int focus : focuses) {
FocusMode equiv = focusModeFromInt(focus);
if (equiv != null) {
mSupportedFocusModes.add(equiv);
}
}
}
|
private void | buildSceneModes(android.hardware.camera2.CameraCharacteristics p)
int[] scenes = p.get(CONTROL_AVAILABLE_SCENE_MODES);
if (scenes != null) {
for (int scene : scenes) {
SceneMode equiv = sceneModeFromInt(scene);
if (equiv != null) {
mSupportedSceneModes.add(equiv);
}
}
}
|
private void | buildWhiteBalances(android.hardware.camera2.CameraCharacteristics p)
int[] bals = p.get(CONTROL_AWB_AVAILABLE_MODES);
if (bals != null) {
for (int bal : bals) {
WhiteBalance equiv = whiteBalanceFromInt(bal);
if (equiv != null) {
mSupportedWhiteBalances.add(equiv);
}
}
}
|
public static FocusMode | focusModeFromInt(int fm)Converts the API-related integer representation of the focus mode to the
abstract representation.
switch (fm) {
case CONTROL_AF_MODE_AUTO:
return FocusMode.AUTO;
case CONTROL_AF_MODE_CONTINUOUS_PICTURE:
return FocusMode.CONTINUOUS_PICTURE;
case CONTROL_AF_MODE_CONTINUOUS_VIDEO:
return FocusMode.CONTINUOUS_VIDEO;
case CONTROL_AF_MODE_EDOF:
return FocusMode.EXTENDED_DOF;
case CONTROL_AF_MODE_OFF:
return FocusMode.FIXED;
// TODO: We cannot support INFINITY
case CONTROL_AF_MODE_MACRO:
return FocusMode.MACRO;
}
Log.w(TAG, "Unable to convert from API 2 focus mode: " + fm);
return null;
|
public static SceneMode | sceneModeFromInt(int sm)Converts the API-related integer representation of the scene mode to the
abstract representation.
switch (sm) {
case CONTROL_SCENE_MODE_DISABLED:
return SceneMode.AUTO;
case CONTROL_SCENE_MODE_ACTION:
return SceneMode.ACTION;
case CONTROL_SCENE_MODE_BARCODE:
return SceneMode.BARCODE;
case CONTROL_SCENE_MODE_BEACH:
return SceneMode.BEACH;
case CONTROL_SCENE_MODE_CANDLELIGHT:
return SceneMode.CANDLELIGHT;
case CONTROL_SCENE_MODE_FIREWORKS:
return SceneMode.FIREWORKS;
case CONTROL_SCENE_MODE_LANDSCAPE:
return SceneMode.LANDSCAPE;
case CONTROL_SCENE_MODE_NIGHT:
return SceneMode.NIGHT;
// TODO: We cannot support NIGHT_PORTRAIT
case CONTROL_SCENE_MODE_PARTY:
return SceneMode.PARTY;
case CONTROL_SCENE_MODE_PORTRAIT:
return SceneMode.PORTRAIT;
case CONTROL_SCENE_MODE_SNOW:
return SceneMode.SNOW;
case CONTROL_SCENE_MODE_SPORTS:
return SceneMode.SPORTS;
case CONTROL_SCENE_MODE_STEADYPHOTO:
return SceneMode.STEADYPHOTO;
case CONTROL_SCENE_MODE_SUNSET:
return SceneMode.SUNSET;
case CONTROL_SCENE_MODE_THEATRE:
return SceneMode.THEATRE;
// TODO: We cannot expose FACE_PRIORITY, or HIGH_SPEED_VIDEO
}
if (sm == LegacyVendorTags.CONTROL_SCENE_MODE_HDR) {
return SceneMode.HDR;
}
Log.w(TAG, "Unable to convert from API 2 scene mode: " + sm);
return null;
|
public static WhiteBalance | whiteBalanceFromInt(int wb)Converts the API-related integer representation of the white balance to
the abstract representation.
switch (wb) {
case CONTROL_AWB_MODE_AUTO:
return WhiteBalance.AUTO;
case CONTROL_AWB_MODE_CLOUDY_DAYLIGHT:
return WhiteBalance.CLOUDY_DAYLIGHT;
case CONTROL_AWB_MODE_DAYLIGHT:
return WhiteBalance.DAYLIGHT;
case CONTROL_AWB_MODE_FLUORESCENT:
return WhiteBalance.FLUORESCENT;
case CONTROL_AWB_MODE_INCANDESCENT:
return WhiteBalance.INCANDESCENT;
case CONTROL_AWB_MODE_SHADE:
return WhiteBalance.SHADE;
case CONTROL_AWB_MODE_TWILIGHT:
return WhiteBalance.TWILIGHT;
case CONTROL_AWB_MODE_WARM_FLUORESCENT:
return WhiteBalance.WARM_FLUORESCENT;
}
Log.w(TAG, "Unable to convert from API 2 white balance: " + wb);
return null;
|