本文整理汇总了Java中com.android.camera.util.CameraUtil.getDisplayOrientation方法的典型用法代码示例。如果您正苦于以下问题:Java CameraUtil.getDisplayOrientation方法的具体用法?Java CameraUtil.getDisplayOrientation怎么用?Java CameraUtil.getDisplayOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.camera.util.CameraUtil
的用法示例。
在下文中一共展示了CameraUtil.getDisplayOrientation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDisplayOrientation
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
private void setDisplayOrientation() {
mDisplayRotation = CameraUtil.getDisplayRotation(mActivity);
mDisplayOrientation = CameraUtil.getDisplayOrientation(mDisplayRotation, mCameraId);
mCameraDisplayOrientation = mDisplayOrientation;
mUI.setDisplayOrientation(mDisplayOrientation);
if (mFocusManager != null) {
mFocusManager.setDisplayOrientation(mDisplayOrientation);
}
// Change the camera display orientation
if (mCameraDevice != null) {
mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation);
}
}
示例2: setDisplayOrientation
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
private void setDisplayOrientation() {
mDisplayRotation = CameraUtil.getDisplayRotation(mActivity);
mCameraDisplayOrientation = CameraUtil.getDisplayOrientation(mDisplayRotation, mCameraId);
// Change the camera display orientation
if (mCameraDevice != null) {
mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation);
}
}
示例3: startCapture
import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
public void startCapture() {
// Reset values so we can do this again.
mCancelComputation = false;
mTimeTaken = System.currentTimeMillis();
mActivity.setSwipingEnabled(false);
mCaptureState = CAPTURE_STATE_MOSAIC;
mUI.onStartCapture();
mMosaicFrameProcessor.setProgressListener(new MosaicFrameProcessor.ProgressListener() {
@Override
public void onProgress(boolean isFinished, float panningRateX, float panningRateY,
float progressX, float progressY) {
float accumulatedHorizontalAngle = progressX * mHorizontalViewAngle;
float accumulatedVerticalAngle = progressY * mVerticalViewAngle;
if (isFinished
|| (Math.abs(accumulatedHorizontalAngle) >= DEFAULT_SWEEP_ANGLE)
|| (Math.abs(accumulatedVerticalAngle) >= DEFAULT_SWEEP_ANGLE)) {
stopCapture(false);
} else {
float panningRateXInDegree = panningRateX * mHorizontalViewAngle;
float panningRateYInDegree = panningRateY * mVerticalViewAngle;
mUI.updateCaptureProgress(panningRateXInDegree, panningRateYInDegree,
accumulatedHorizontalAngle, accumulatedVerticalAngle,
PANNING_SPEED_THRESHOLD);
}
}
});
mUI.resetCaptureProgress();
// TODO: calculate the indicator width according to different devices to reflect the actual
// angle of view of the camera device.
mUI.setMaxCaptureProgress(DEFAULT_SWEEP_ANGLE);
mUI.showCaptureProgress();
mDeviceOrientationAtCapture = mDeviceOrientation;
keepScreenOn();
// TODO: mActivity.getOrientationManager().lockOrientation();
mOrientationManager.lockOrientation();
int degrees = CameraUtil.getDisplayRotation(mActivity);
int cameraId = CameraHolder.instance().getBackCameraId();
int orientation = CameraUtil.getDisplayOrientation(degrees, cameraId);
mUI.setProgressOrientation(orientation);
}