当前位置: 首页>>代码示例>>Java>>正文


Java CameraConfigurationUtils.setBestExposure方法代码示例

本文整理汇总了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) {
    }
}
 
开发者ID:yuriy-budiyev,项目名称:code-scanner,代码行数:22,代码来源:CodeScanner.java

示例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);
    }
}
 
开发者ID:xiong-it,项目名称:ZXingAndroidExt,代码行数:8,代码来源:CameraConfigurationManager.java

示例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);
  //}
}
 
开发者ID:crisfg86,项目名称:Zxing-Custom,代码行数:8,代码来源:CameraConfigurationManager.java

示例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);
  }
}
 
开发者ID:srowen,项目名称:zxing-bsplus,代码行数:8,代码来源:CameraConfigurationManager.java

示例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));
}
 
开发者ID:yuriy-budiyev,项目名称:code-scanner,代码行数:68,代码来源:CodeScanner.java

示例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);
  }
}
 
开发者ID:10045125,项目名称:QrCode,代码行数:7,代码来源:CameraConfigurationManager.java

示例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);
    }
}
 
开发者ID:snice,项目名称:androidscan,代码行数:7,代码来源:CameraConfigurationManager.java

示例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);
    }
}
 
开发者ID:BottleRocketStudios,项目名称:Android-Barcode,代码行数:7,代码来源:CameraConfigurationManager.java

示例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);
    }
}
 
开发者ID:mgouline,项目名称:droidxing,代码行数:7,代码来源:CameraConfigurationManager.java


注:本文中的com.google.zxing.client.android.camera.CameraConfigurationUtils.setBestExposure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。