Android Utililty Methods Camera Set

List of utility methods to do Camera Set

Description

The list of methods to do Camera Set are organized into topic(s).

Method

voidsetBarcodeSceneMode(Camera.Parameters parameters)
set Barcode Scene Mode
if (Camera.Parameters.SCENE_MODE_BARCODE.equals(parameters
        .getSceneMode())) {
    Log.i(TAG, "Barcode scene mode already set");
    return;
String sceneMode = findSettableValue("scene mode",
        parameters.getSupportedSceneModes(),
        Camera.Parameters.SCENE_MODE_BARCODE);
...
voidsetBestExposure(Camera.Parameters parameters, boolean lightOn)
set Best Exposure
int minExposure = parameters.getMinExposureCompensation();
int maxExposure = parameters.getMaxExposureCompensation();
float step = parameters.getExposureCompensationStep();
if ((minExposure != 0 || maxExposure != 0) && step > 0.0f) {
    float targetCompensation = lightOn ? MIN_EXPOSURE_COMPENSATION
            : MAX_EXPOSURE_COMPENSATION;
    int compensationSteps = Math.round(targetCompensation / step);
    float actualCompensation = step * compensationSteps;
...
voidsetBestPreviewFPS(Camera.Parameters parameters)
set Best Preview FPS
setBestPreviewFPS(parameters, MIN_FPS, MAX_FPS);
voidsetBestPreviewFPS(Camera.Parameters parameters, int minFPS, int maxFPS)
set Best Preview FPS
List<int[]> supportedPreviewFpsRanges = parameters
        .getSupportedPreviewFpsRange();
Log.i(TAG, "Supported FPS ranges: "
        + toString(supportedPreviewFpsRanges));
if (supportedPreviewFpsRanges != null
        && !supportedPreviewFpsRanges.isEmpty()) {
    int[] suitableFPSRange = null;
    for (int[] fpsRange : supportedPreviewFpsRanges) {
...
voidsetCameraDisplayOrientation(Context mContext, int cameraId, Camera camera)
set Camera Display Orientation
CameraInfo info = new CameraInfo();
Camera.getCameraInfo(cameraId, info);
int rotation = ((Activity) mContext).getWindowManager()
        .getDefaultDisplay().getRotation();
int degrees = 0;
switch (rotation) {
case Surface.ROTATION_0:
    degrees = 0;
...
voidsetFocus(Camera.Parameters parameters, boolean autoFocus, boolean disableContinuous, boolean safeMode)
set Focus
List<String> supportedFocusModes = parameters
        .getSupportedFocusModes();
String focusMode = null;
if (autoFocus) {
    if (safeMode || disableContinuous) {
        focusMode = findSettableValue("focus mode",
                supportedFocusModes,
                Camera.Parameters.FOCUS_MODE_AUTO);
...
voidsetFocusArea(Camera.Parameters parameters)
set Focus Area
if (parameters.getMaxNumFocusAreas() > 0) {
    Log.i(TAG,
            "Old focus areas: "
                    + toString(parameters.getFocusAreas()));
    List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000);
    Log.i(TAG, "Setting focus area to : " + toString(middleArea));
    parameters.setFocusAreas(middleArea);
} else {
...
voidsetInvertColor(Camera.Parameters parameters)
set Invert Color
if (Camera.Parameters.EFFECT_NEGATIVE.equals(parameters
        .getColorEffect())) {
    Log.i(TAG, "Negative effect already set");
    return;
String colorMode = findSettableValue("color effect",
        parameters.getSupportedColorEffects(),
        Camera.Parameters.EFFECT_NEGATIVE);
...
voidsetMetering(Camera.Parameters parameters)
set Metering
if (parameters.getMaxNumMeteringAreas() > 0) {
    Log.i(TAG,
            "Old metering areas: " + parameters.getMeteringAreas());
    List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000);
    Log.i(TAG, "Setting metering area to : " + toString(middleArea));
    parameters.setMeteringAreas(middleArea);
} else {
    Log.i(TAG, "Device does not support metering areas");
...
voidsetTorch(Camera.Parameters parameters, boolean on)
set Torch
List<String> supportedFlashModes = parameters
        .getSupportedFlashModes();
String flashMode;
if (on) {
    flashMode = findSettableValue("flash mode",
            supportedFlashModes,
            Camera.Parameters.FLASH_MODE_TORCH,
            Camera.Parameters.FLASH_MODE_ON);
...