本文整理汇总了Java中com.google.zxing.client.android.camera.CameraConfigurationUtils.setBestExposure方法的典型用法代码示例。如果您正苦于以下问题:Java CameraConfigurationUtils.setBestExposure方法的具体用法?Java CameraConfigurationUtils.setBestExposure怎么用?Java CameraConfigurationUtils.setBestExposure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.zxing.client.android.camera.CameraConfigurationUtils
的用法示例。
在下文中一共展示了CameraConfigurationUtils.setBestExposure方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFlashEnabledInternal
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void setFlashEnabledInternal(boolean flashEnabled) {
try {
DecoderWrapper decoderWrapper = mDecoderWrapper;
Camera camera = decoderWrapper.getCamera();
Camera.Parameters parameters = camera.getParameters();
if (parameters == null) {
return;
}
boolean changed;
if (flashEnabled) {
changed = Utils.setFlashMode(parameters, Camera.Parameters.FLASH_MODE_TORCH);
} else {
changed = Utils.setFlashMode(parameters, Camera.Parameters.FLASH_MODE_OFF);
}
if (changed) {
CameraConfigurationUtils.setBestExposure(parameters, flashEnabled);
camera.setParameters(parameters);
}
} catch (Exception ignored) {
}
}
示例2: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!safeMode && !prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例3: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
//if (!safeMode && !prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
//}
}
示例4: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (!safeMode && !prefs.getBoolean(PreferencesActivity.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例5: initialize
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void initialize() {
Camera camera = null;
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
int cameraId = mCameraId;
if (cameraId == DEFAULT_CAMERA) {
int numberOfCameras = Camera.getNumberOfCameras();
for (int i = 0; i < numberOfCameras; i++) {
Camera.getCameraInfo(i, cameraInfo);
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
camera = Camera.open(i);
mCameraId = i;
break;
}
}
} else {
camera = Camera.open(cameraId);
Camera.getCameraInfo(cameraId, cameraInfo);
}
if (camera == null) {
throw new CodeScannerException("Unable to access camera");
}
Camera.Parameters parameters = camera.getParameters();
if (parameters == null) {
throw new CodeScannerException("Unable to configure camera");
}
int orientation = Utils.getDisplayOrientation(mContext, cameraInfo);
boolean portrait = Utils.isPortrait(orientation);
Point imageSize =
Utils.findSuitableImageSize(parameters, portrait ? mHeight : mWidth, portrait ? mWidth : mHeight);
int imageWidth = imageSize.getX();
int imageHeight = imageSize.getY();
parameters.setPreviewSize(imageWidth, imageHeight);
Point previewSize =
Utils.getPreviewSize(portrait ? imageHeight : imageWidth, portrait ? imageWidth : imageHeight,
mWidth, mHeight);
List<String> focusModes = parameters.getSupportedFocusModes();
boolean autoFocusSupported = focusModes != null &&
(focusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO) ||
focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE));
if (!autoFocusSupported) {
mAutoFocusEnabled = false;
}
if (autoFocusSupported && mAutoFocusEnabled) {
Utils.setAutoFocusMode(parameters, mAutoFocusMode);
}
List<String> flashModes = parameters.getSupportedFlashModes();
boolean flashSupported = flashModes != null && flashModes.contains(Camera.Parameters.FLASH_MODE_TORCH);
if (!flashSupported) {
mFlashEnabled = false;
}
Utils.optimizeParameters(parameters);
CameraConfigurationUtils.setBestExposure(parameters, mFlashEnabled);
camera.setParameters(parameters);
camera.setDisplayOrientation(orientation);
mInitializeLock.lock();
try {
Decoder decoder = new Decoder(mDecoderStateListener, mFormats, mDecodeCallback);
mDecoderWrapper = new DecoderWrapper(camera, cameraInfo, decoder, imageSize, previewSize,
new Point(mWidth, mHeight), orientation, autoFocusSupported, flashSupported);
decoder.start();
mInitialization = false;
mInitialized = true;
} finally {
mInitializeLock.unlock();
}
mMainThreadHandler.post(new FinishInitializationTask(previewSize));
}
示例6: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
if (!safeMode && !Config.ConfigType.KEY_DISABLE_EXPOSURE.enable()) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例7: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
if (!safeMode) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例8: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
if (!safeMode && !mZXingConfiguration.getBoolean(ZXingConfiguration.KEY_DISABLE_EXPOSURE, true)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}
示例9: doSetTorch
import com.google.zxing.client.android.camera.CameraConfigurationUtils; //导入方法依赖的package包/类
private void doSetTorch(Camera.Parameters parameters, boolean newSetting, boolean safeMode) {
CameraConfigurationUtils.setTorch(parameters, newSetting);
if (!safeMode && !CapturePreferences.getBoolean(CapturePreferences.KEY_DISABLE_EXPOSURE)) {
CameraConfigurationUtils.setBestExposure(parameters, newSetting);
}
}