正在加载图片...
中国科学技术大学电子工程与信息科学系©2018 final void setPreviewTexture(SurfaceTexture surfaceTexture) Sets the SurfaceTexture to be used for live preview. final void setZoomChangeListener(Camera.OnZoomChangeListener listener) Registers a listener to be notified when the zoom value is updated by the camera driver during smooth zoom. final void startFaceDetection() Starts the face detection. final void startPreview() Starts capturing and drawing preview frames to the screen. final void startSmoothZoom(int value) Zooms to the requested value smoothly. final void stopFaceDetection() Stops the face detection final void stopPreview() Stops capturing and drawing preview frames to the surface,and resets the camera for a future call to startPreview() final void stopSmoothZoom() Stops the smooth zoom. final void takePicture(Camera.ShutterCallback shutter,Camera.PictureCallback raw,Camera.PictureCallback jpeg) Equivalent to takePicture(shutter,raw,null,jpeg). final void takePicture(Camera.ShutterCallback shutter,Camera.PictureCallback raw,Camera.PictureCallback postview,Camera.PictureCallback jpeg) Triggers an asynchronous image capture. final void unlock() Unlocks the camera to allow another process to access it. 3、Camera2类说明 Android5.O(SDK21)之后android.hardware.Camera就被废弃了,取而代之的 是全新的android.hardware.Camera22。Android5.0对拍照API进行了全新的设计, 新增了全新设计的Camera v2API,这些API不仅大幅提高了Android系统拍照 的功能,还能支持RAW照片输出,甚至允许程序调整相机的对焦模式、曝光模 式、快门等2]。 CameraManager:摄像头管理器。这是一个全新的系统管理器,专门用于检测系统 摄像头、打开系统摄像头。除此之外,调用CameraManager的 getCameraCharacteristics(String)方法即可获取指定摄像头的相关特性。 CameraCharacteristics:摄像头特性。该对象通过CameraManager来获取,用于描 述特定摄像头所支持的各种特性。 CameraDevice:代表系统摄像头。该类的功能类似于早期的Camera类。 CameraCaptureSession:这是一个非常重要的API,当程序需要预览、拍照时,都 需要先通过该类的实例创建Session。而且不管预览还是拍照,也都是由该对象的 方法进行控制的,其中控制预览的方法为setRepeatingRequest():控制拍照的方法 为capture()。 CameraRequest和CameraRequest..Builder:当程序调用setRepeatingRequest()方法进 行预览时,或调用capture()方法进行拍照时,都需要传入CameraRequest参数。 CameraRequest代表了一次捕获请求,用于描述捕获图片的各种参数设置,比如对 焦模式、曝光模式.…总之,程序需要对照片所做的各种控制,都通过 如果您在阅读过程中发现疏漏和错误,请联系《多媒体技术基础》课程组{network,cxh}@ustc.edu.cn中国科学技术大学电子工程与信息科学系© 2018 如果您在阅读过程中发现疏漏和错误,请联系《多媒体技术基础》课程组{network,cxh}@ustc.edu.cn final void setPreviewTexture(SurfaceTexture surfaceTexture) Sets the SurfaceTexture to be used for live preview. final void setZoomChangeListener(Camera.OnZoomChangeListener listener) Registers a listener to be notified when the zoom value is updated by the camera driver during smooth zoom. final void startFaceDetection() Starts the face detection. final void startPreview() Starts capturing and drawing preview frames to the screen. final void startSmoothZoom(int value) Zooms to the requested value smoothly. final void stopFaceDetection() Stops the face detection. final void stopPreview() Stops capturing and drawing preview frames to the surface, and resets the camera for a future call to startPreview(). final void stopSmoothZoom() Stops the smooth zoom. final void takePicture(Camera.ShutterCallback shutter, Camera.PictureCallback raw, Camera.PictureCallback jpeg) Equivalent to takePicture(shutter, raw, null, jpeg). final void takePicture(Camera.ShutterCallback shutter, Camera.PictureCallback raw, Camera.PictureCallback postview, Camera.PictureCallback jpeg) Triggers an asynchronous image capture. final void unlock() Unlocks the camera to allow another process to access it. 3、Camera2 类说明 Android 5.0(SDK 21)之后 android.hardware.Camera 就被废弃了,取而代之的 是全新的 android.hardware.Camera2 。Android 5.0 对拍照 API 进行了全新的设计, 新增了全新设计的 Camera v2 API,这些 API 不仅大幅提高了 Android 系统拍照 的功能,还能支持 RAW 照片输出,甚至允许程序调整相机的对焦模式、曝光模 式、快门等[2]。  CameraManager:摄像头管理器。这是一个全新的系统管理器,专门用于检测系统 摄像头、打开系统摄像头。除此之外,调用 CameraManager 的 getCameraCharacteristics(String)方法即可获取指定摄像头的相关特性。  CameraCharacteristics:摄像头特性。该对象通过 CameraManager 来获取,用于描 述特定摄像头所支持的各种特性。  CameraDevice:代表系统摄像头。该类的功能类似于早期的 Camera 类。  CameraCaptureSession:这是一个非常重要的 API,当程序需要预览、拍照时,都 需要先通过该类的实例创建 Session。而且不管预览还是拍照,也都是由该对象的 方法进行控制的,其中控制预览的方法为 setRepeatingRequest();控制拍照的方法 为 capture()。  CameraRequest 和 CameraRequest.Builder:当程序调用 setRepeatingRequest()方法进 行预览时,或调用 capture()方法进行拍照时,都需要传入 CameraRequest 参数。 CameraRequest 代表了一次捕获请求,用于描述捕获图片的各种参数设置,比如对 焦模式、曝光模式……总之,程序需要对照片所做的各种控制,都通过
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有