Example usage for android.hardware Camera getParameters

List of usage examples for android.hardware Camera getParameters

Introduction

In this page you can find the example usage for android.hardware Camera getParameters.

Prototype

public Parameters getParameters() 

Source Link

Document

Returns the current settings for this Camera service.

Usage

From source file:Main.java

public static List<Size> getResolutionList(Camera camera) {
    return camera.getParameters().getSupportedPreviewSizes();
}

From source file:Main.java

static boolean isUsingFocusMode(@NonNull String focusMode, @NonNull Camera camera) {
    return camera.getParameters().getFocusMode().equals(focusMode);
}

From source file:Main.java

static boolean isFocusModeSupported(@NonNull String focusMode, @NonNull Camera camera) {
    return camera.getParameters().getSupportedFocusModes().contains(focusMode);
}

From source file:Main.java

public static List<Camera.Size> getResolutionList(Camera mCamera) {
    return mCamera.getParameters().getSupportedPreviewSizes();
}

From source file:Main.java

public static List<Size> getResolutionList(Camera camera) {
    Parameters parameters = camera.getParameters();
    List<Size> previewSizes = parameters.getSupportedPreviewSizes();
    return previewSizes;
}

From source file:Main.java

public static void setCameraFocusMode(String focusMode, Camera camera) {
    Camera.Parameters parameters = camera.getParameters();
    List<String> sfm = parameters.getSupportedFocusModes();
    if (sfm.contains(focusMode)) {
        parameters.setFocusMode(focusMode);
    }/*from  w ww  .j av  a2  s .c om*/
    camera.setParameters(parameters);
}

From source file:Main.java

public static Camera.Size getHighestResolution(Camera c) {
    List<Camera.Size> sizes = c.getParameters().getSupportedPictureSizes();
    Camera.Size size = null;/*from  ww w  . j a v  a 2s. co  m*/
    int maxres = 0;

    for (Size s : sizes) {
        if (s.width * s.height > maxres) {
            maxres = s.width * s.height;
            size = s;
        }
    }

    return size;
}

From source file:Main.java

public static boolean supportTouchFocus(Camera camera) {
    if (camera != null) {
        return (camera.getParameters().getMaxNumFocusAreas() != 0);
    }/*from www .jav  a2s  .  com*/
    return false;
}

From source file:Main.java

static boolean isFlashModeSupported(@NonNull String flashMode, @NonNull Camera camera) {
    List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes();
    return supportedFlashModes != null && supportedFlashModes.contains(flashMode);
}

From source file:Main.java

public static boolean supportFlash(Camera camera) {
    Camera.Parameters params = camera.getParameters();
    List<String> flashModes = params.getSupportedFlashModes();
    if (flashModes == null) {
        return false;
    }//from w  ww  .  j  a  v a 2  s .  c om
    for (String flashMode : flashModes) {
        if (Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode)) {
            return true;
        }
    }
    return false;
}