当前位置: 首页>>代码示例>>Java>>正文


Java CameraUtil.getDisplayOrientation方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:14,代码来源:PhotoModule.java

示例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);
    }
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:9,代码来源:VideoModule.java

示例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);
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:43,代码来源:WideAnglePanoramaModule.java


注:本文中的com.android.camera.util.CameraUtil.getDisplayOrientation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。