[Android M] Camera Features

Android 2015. 6. 11. 20:27 |

Camera Features

--------------------------------------------------------------------------------------------------------------------------------------------------------------


This preview includes the following new APIs for accessing the camera’s flashlight and for camera reprocessing of images:

이 프리뷰는 새 API들 카메라 플래쉬 억세스와 카메라 리프로세스 이미지를 위한 다음의 새 API들을 포함합니다.



Flashlight API

If a camera device has a flash unit, you can call the CameraManager.setTorchMode() method to switch the flash unit’s torch mode on or off without opening the camera device. The app does not have exclusive ownership of the flash unit or the camera device. The torch mode is turned off and becomes unavailable whenever the camera device becomes unavailable, or when other camera resources keeping the torch on become unavailable. Other apps can also call setTorchMode() to turn off the torch mode. When the last app that turned on the torch mode is closed, the torch mode is turned off.

만약 카메라 디바이스가 플레시 유닛을 가지고 있다면 당신은 CameraManager.setTorchMode() 메소드로 카메라 디바이스를 열지 않고 플레시 유닛의 손전등 스위치를 끄거나 켤 수 있습니다. 앱이 플래시 유닛이나 카메라 디바이스의 특별한 소유권을 가지고 있지 않습니다. 카메라 디바이스가 사용되지 않거나 카메라 리소스의 손전등 상태유지이지 않은 경우 손전등 모드는 꺼지고 사용되지 않습니다. 다른 앱도 setTorchMode() 에게 손전등 모드를 끄라고 할 수 있습니다. 손전등 모드 켜진 마지막 앱이 닫히면 손전등 모드도 꺼집니다.



You can register a callback to be notified about torch mode status by calling the CameraManager.registerTorchCallback() method. The first time the callback is registered, it is immediately called with the torch mode status of all currently known camera devices with a flash unit. If the torch mode is turned on or off successfully, the CameraManager.TorchCallback.onTorchModeChanged() method is invoked.

당신은 CameraManager.registerTorchCallback() method를 불러 손전등 모드 상태에 대해서 알 수 있도록 콜백을 등록할 수 있습니다. 콜백을 최초로 등록 했을 때 이것은 즉시 현재의 모든 플래시 유닛 카메라 디바이스로 알려진 손전등 모드 상태를 부릅니다.(Call with 가 확실하게 어떤 뜻인지 모르겠음) 만약 손전등 모드가 성공적으로 켜지거나 꺼진다면 CameraManager.TorchCallback.onTorchModeChanged() method는 적용된 것입니다.




Reprocessing API

The Camera2 API is extended to support YUV and private opaque format image reprocessing. Your app determine if the reprocessing capabilities are available via CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES. If a device supports reprocessing, you can create a reprocessable camera capture session by calling CameraDevice.createReprocessableCaptureSession(), and create requests for input buffer reprocessing.

Camera2 API는 YUV 지원과 개인의 불투명한 이미지 자원까지 확장되었습니다. 당신의 앱이 reprocessing 용량이 CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES를 통해 가능한지(수용 가능)에 대해 결정합니다. 만약 디바이스가 reprocessing을 지원한다면 당신은 CameraDevice.createReprocessableCaptureSession()를 불러서 재처리 가능한 카메라 캡쳐 세션을 만들 수 있고, buffer reprocessing 인풋을 요청할 수 있습니다.


Use the ImageWriter class to connect the input buffer flow to the camera reprocessing input. To get an empty buffer, follow this programming model:

카메라 reprocessing input으로 가는 버퍼 input 접속을 위해 이미지라이터 클래스를 사용 하세요. 빈 버퍼를 위해서는 이 프로그래밍 모델을 따라하세요.



Call the ImageWriter.dequeueInputImage() method. 

Fill the data into the input buffer. 

Send the buffer to the camera by calling the ImageWriter.queueInputImage() method. 

If you are using a ImageWriter object together with an android.graphics.ImageFormat.PRIVATE image, your app cannot access the image data directly. 

Instead, pass the ImageFormat.PRIVATE image directly to the ImageWriter by calling the ImageWriter.queueInputImage() method without any buffer copy.

인풋 버퍼에 데이터를 채우세요

ImageWriter.queueInputImage() method를 불러 버퍼를 카메라에 전송하세요.

만약 ImageWriter 오브젝트를 Android.graphics.ImageFormat.PRIVATE image와 함께 사용한다면 당신의 앱은 이미지 데이터에 직접 접속할 수 는 없을 것입니다. 대신, ImageFormat.PRIVATE 이미지를 버퍼 카피 없이 ImageWriter.queueInputImage() method를 불러 이미지 라이터에 직접 패스하세요.



The ImageReader class now supports android.graphics.ImageFormat.PRIVATE format image streams. This support allows your app to maintain a circular image queue of ImageReader output images, select one or more images, and send them to the ImageWriter for camera reprocessing.

ImageReader클래스는 지금 android.graphics.ImageFormat.PRIVATE format image streams을 지원합니다. 이 지원은 당신 앱이 ImageReader output images의 순환 이미지 라인(circular image queue)을 유지하거나, 하나 또는 하나 이상의 이미지를 선택하거나 카메라 리프로세싱을 위해 그들을 이미지 라이터에 전송하도록 해줍니다.








'Android' 카테고리의 다른 글

[WakeLock]  (0) 2018.03.27
[Android M] Permissions  (0) 2015.06.12
[Android M] API Overview  (0) 2015.06.11
[Android M] 4K Display Mode  (0) 2015.06.11
Android URL Intent, Intent Filter, Scheme  (0) 2015.04.22
Posted by 소망아기
: