Search in sources :

Example 16 with Size

use of com.yydcdut.note.utils.camera.param.Size in project PhotoNoter by yydcdut.

the class Camera2SettingModel method getSupportPictureSizes.

@Override
public List<Size> getSupportPictureSizes() {
    StreamConfigurationMap map = mCameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
    if (map == null) {
        return null;
    }
    android.util.Size[] supports = map.getOutputSizes(ImageFormat.JPEG);
    List<Size> sizeList = new ArrayList<>(supports.length);
    for (android.util.Size size : supports) {
        sizeList.add(Size.translate(size.getWidth(), size.getHeight()));
    }
    return sizeList;
}
Also used : Size(com.yydcdut.note.utils.camera.param.Size) ArrayList(java.util.ArrayList) StreamConfigurationMap(android.hardware.camera2.params.StreamConfigurationMap)

Example 17 with Size

use of com.yydcdut.note.utils.camera.param.Size in project PhotoNoter by yydcdut.

the class Camera2SettingModel method getSupportPreviewSizes.

@Override
public List<Size> getSupportPreviewSizes() {
    StreamConfigurationMap map = mCameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
    if (map == null) {
        return null;
    }
    android.util.Size[] supports = map.getOutputSizes(SurfaceTexture.class);
    List<Size> sizeList = new ArrayList<>(supports.length);
    for (android.util.Size size : supports) {
        sizeList.add(Size.translate(size.getWidth(), size.getHeight()));
    }
    return sizeList;
}
Also used : Size(com.yydcdut.note.utils.camera.param.Size) ArrayList(java.util.ArrayList) StreamConfigurationMap(android.hardware.camera2.params.StreamConfigurationMap)

Aggregations

Size (com.yydcdut.note.utils.camera.param.Size)17 ArrayList (java.util.ArrayList)5 JSONException (org.json.JSONException)5 SizeComparator (com.yydcdut.note.model.compare.SizeComparator)4 StreamConfigurationMap (android.hardware.camera2.params.StreamConfigurationMap)3 JSONObject (org.json.JSONObject)3 IPreviewModel (com.yydcdut.note.model.camera.IPreviewModel)2 JSONArray (org.json.JSONArray)2 SharedPreferences (android.content.SharedPreferences)1 Camera (android.hardware.Camera)1 ICameraFocus (com.yydcdut.note.model.camera.ICameraFocus)1 ICameraModel (com.yydcdut.note.model.camera.ICameraModel)1 ICameraSettingModel (com.yydcdut.note.model.camera.ICameraSettingModel)1 ICaptureModel (com.yydcdut.note.model.camera.ICaptureModel)1 IOException (java.io.IOException)1