當前位置: 首頁>>代碼示例>>Java>>正文


Java CameraConfiguration.SensorPosition方法代碼示例

本文整理匯總了Java中com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration.SensorPosition方法的典型用法代碼示例。如果您正苦於以下問題:Java CameraConfiguration.SensorPosition方法的具體用法?Java CameraConfiguration.SensorPosition怎麽用?Java CameraConfiguration.SensorPosition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration的用法示例。


在下文中一共展示了CameraConfiguration.SensorPosition方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPhotoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
protected int getPhotoOrientation(@CameraConfiguration.SensorPosition int sensorPosition) {
    int rotate;
    if (currentCameraId.equals(faceFrontCameraId)) {
        rotate = (360 + faceFrontCameraOrientation + configurationProvider.getDegrees()) % 360;
    } else {
        rotate = (360 + faceBackCameraOrientation - configurationProvider.getDegrees()) % 360;
    }

    if (rotate == 0) {
        orientation = ExifInterface.ORIENTATION_NORMAL;
    } else if (rotate == 90) {
        orientation = ExifInterface.ORIENTATION_ROTATE_90;
    } else if (rotate == 180) {
        orientation = ExifInterface.ORIENTATION_ROTATE_180;
    } else if (rotate == 270) {
        orientation = ExifInterface.ORIENTATION_ROTATE_270;
    }

    return orientation;
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:22,代碼來源:Camera1Manager.java

示例2: getVideoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
protected int getVideoOrientation(@CameraConfiguration.SensorPosition int sensorPosition) {
    int degrees = 0;
    switch (sensorPosition) {
        case CameraConfiguration.SENSOR_POSITION_UP:
            degrees = 0;
            break; // Natural orientation
        case CameraConfiguration.SENSOR_POSITION_LEFT:
            degrees = 90;
            break; // Landscape left
        case CameraConfiguration.SENSOR_POSITION_UP_SIDE_DOWN:
            degrees = 180;
            break;// Upside down
        case CameraConfiguration.SENSOR_POSITION_RIGHT:
            degrees = 270;
            break;// Landscape right
        case CameraConfiguration.SENSOR_POSITION_UNSPECIFIED:
            degrees = 0;
            break; // Natural orientation
    }

    int rotate;
    if (currentCameraId.equals(faceFrontCameraId)) {
        rotate = (360 + faceFrontCameraOrientation + degrees) % 360;
    } else {
        rotate = (360 + faceBackCameraOrientation - degrees) % 360;
    }

    return rotate;
}
 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:31,代碼來源:Camera1Manager.java

示例3: getVideoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
protected int getVideoOrientation(@CameraConfiguration.SensorPosition int sensorPosition) {
    int degrees = 0;
    switch (sensorPosition) {
        case CameraConfiguration.SENSOR_POSITION_UP:
            degrees = 0;
            break; // Natural orientation
        case CameraConfiguration.SENSOR_POSITION_LEFT:
            degrees = 90;
            break; // Landscape left
        case CameraConfiguration.SENSOR_POSITION_UP_SIDE_DOWN:
            degrees = 180;
            break;// Upside down
        case CameraConfiguration.SENSOR_POSITION_RIGHT:
            degrees = 270;
            break;// Landscape right
        case CameraConfiguration.SENSOR_POSITION_UNSPECIFIED:
            break;
    }

    int rotate;
    if (Objects.equals(currentCameraId, faceFrontCameraId)) {
        rotate = (360 + faceFrontCameraOrientation + degrees) % 360;
    } else {
        rotate = (360 + faceBackCameraOrientation - degrees) % 360;
    }
    return rotate;
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:29,代碼來源:Camera2Manager.java

示例4: getVideoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
protected int getVideoOrientation(@CameraConfiguration.SensorPosition int sensorPosition) {
    int degrees = 0;
    switch (sensorPosition) {
        case CameraConfiguration.SENSOR_POSITION_UP:
            degrees = 0;
            break; // Natural orientation
        case CameraConfiguration.SENSOR_POSITION_LEFT:
            degrees = 90;
            break; // Landscape left
        case CameraConfiguration.SENSOR_POSITION_UP_SIDE_DOWN:
            degrees = 180;
            break;// Upside down
        case CameraConfiguration.SENSOR_POSITION_RIGHT:
            degrees = 270;
            break;// Landscape right
        case CameraConfiguration.SENSOR_POSITION_UNSPECIFIED:
            degrees = 0;
            break; // Natural orientation
    }

    int rotate;
    if (currentCameraId.equals(faceFrontCameraId)) {
        rotate = (360 + faceFrontCameraOrientation + degrees) % 360;
    } else {
        rotate = (360 + faceBackCameraOrientation - degrees) % 360;
    }
    return rotate;
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:30,代碼來源:Camera1Manager.java

示例5: getPhotoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
@Override
protected int getPhotoOrientation(@CameraConfiguration.SensorPosition int sensorPosition) {
    return getVideoOrientation(sensorPosition);
}
 
開發者ID:sandrios,項目名稱:sandriosCamera,代碼行數:5,代碼來源:Camera2Manager.java

示例6: getPhotoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
protected abstract int getPhotoOrientation(@CameraConfiguration.SensorPosition int sensorPosition); 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:2,代碼來源:BaseCameraManager.java

示例7: getVideoOrientation

import com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration; //導入方法依賴的package包/類
protected abstract int getVideoOrientation(@CameraConfiguration.SensorPosition int sensorPosition); 
開發者ID:MartinRGB,項目名稱:android_camera_experiment,代碼行數:2,代碼來源:BaseCameraManager.java


注:本文中的com.sandrios.sandriosCamera.internal.configuration.CameraConfiguration.SensorPosition方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。