Home | History | Annotate | Download | only in one
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.camera.one;
     18 
     19 import android.graphics.ImageFormat;
     20 import android.graphics.Rect;
     21 import android.hardware.camera2.CameraCharacteristics;
     22 
     23 import com.android.camera.ui.motion.LinearScale;
     24 import com.android.camera.util.Size;
     25 
     26 import java.util.List;
     27 
     28 /**
     29  * The properties describing a OneCamera device. These properties are fixed for
     30  * a given OneCamera device.
     31  */
     32 public interface OneCameraCharacteristics {
     33     public enum SupportedHardwareLevel {
     34         FULL, LIMITED, LEGACY
     35     }
     36 
     37     public enum FaceDetectMode {
     38         FULL, SIMPLE, NONE
     39     }
     40 
     41     /**
     42      * Gets the supported picture sizes for the given image format.
     43      *
     44      * @param imageFormat The specific image format listed on
     45      *            {@link ImageFormat}.
     46      */
     47     public List<Size> getSupportedPictureSizes(int imageFormat);
     48 
     49     /**
     50      * Gets the supported preview sizes.
     51      */
     52     public List<Size> getSupportedPreviewSizes();
     53 
     54     /**
     55      * @See {@link CameraCharacteristics#SENSOR_ORIENTATION}
     56      */
     57     public int getSensorOrientation();
     58 
     59     /**
     60      * @Return The direction of the camera
     61      */
     62     public OneCamera.Facing getCameraDirection();
     63 
     64     /**
     65      * @See {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE}
     66      */
     67     public Rect getSensorInfoActiveArraySize();
     68 
     69     /**
     70      * @See {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM}
     71      */
     72     public float getAvailableMaxDigitalZoom();
     73 
     74     /**
     75      * @return If flash is supported for this camera.
     76      */
     77     public boolean isFlashSupported();
     78 
     79     /**
     80      * @return If Scene-mode HDR is supported.
     81      */
     82     public boolean isHdrSceneSupported();
     83 
     84     /**
     85      * @return The supported hardware level.
     86      */
     87     public SupportedHardwareLevel getSupportedHardwareLevel();
     88 
     89     /**
     90      * @return The supported face detection modes.
     91      */
     92     public List<FaceDetectMode> getSupportedFaceDetectModes();
     93 
     94     /**
     95      * A converter from the physical focus range of the camera to a ratio.
     96      */
     97     public LinearScale getLensFocusRange();
     98 
     99     /**
    100      * @return A List of available focal lengths for this camera.
    101      */
    102     public List<Float> getAvailableFocalLengths();
    103 
    104     /**
    105      * Whether exposure compensation is supported for this camera.
    106      *
    107      * @return true if exposure compensation is supported for this camera.
    108      */
    109     public boolean isExposureCompensationSupported();
    110 
    111     /**
    112      * @return The min exposure compensation index. The EV is the compensation
    113      * index multiplied by the step value. If {@link
    114      * #isExposureCompensationSupported()} is false, return -1.
    115      */
    116     public int getMinExposureCompensation();
    117 
    118     /**
    119      * @return The max exposure compensation index. The EV is the compensation
    120      * index multiplied by the step value. If {@link
    121      * #isExposureCompensationSupported()} is false, return -1.
    122      */
    123     public int getMaxExposureCompensation();
    124 
    125     /**
    126      * @return The exposure compensation step. The EV is the compensation index
    127      * multiplied by the step value. If {@link
    128      * #isExposureCompensationSupported()} is false, return -1.
    129      */
    130     public float getExposureCompensationStep();
    131 
    132     /**
    133      * @return true if this camera supports custom AutoFocus regions.
    134      */
    135     public boolean isAutoFocusSupported();
    136 
    137     /**
    138      * @return true if this camera supports custom AutoExposure regions.
    139      */
    140     public boolean isAutoExposureSupported();
    141 }
    142