@Implements(value=android.hardware.Camera.class) public class ShadowCamera extends Object
Camera.| Modifier and Type | Class and Description |
|---|---|
static class |
ShadowCamera.ShadowParameters
Shadows the Android
Camera.Parameters class. |
static class |
ShadowCamera.ShadowSize
Shadow for the Android
Camera.Size value object. |
| Constructor and Description |
|---|
ShadowCamera() |
| Modifier and Type | Method and Description |
|---|---|
void |
__constructor__() |
void |
addCallbackBuffer(byte[] callbackBuffer) |
static void |
addCameraInfo(int id,
android.hardware.Camera.CameraInfo camInfo)
Add a mock
Camera.CameraInfo object to simulate
the existence of one or more cameras. |
void |
autoFocus(android.hardware.Camera.AutoFocusCallback callback) |
void |
cancelAutoFocus() |
static void |
clearCameraInfo() |
List<byte[]> |
getAddedCallbackBuffers() |
static void |
getCameraInfo(int cameraId,
android.hardware.Camera.CameraInfo cameraInfo) |
int |
getDisplayOrientation() |
static int |
getLastOpenedCameraId() |
static int |
getNumberOfCameras() |
android.hardware.Camera.Parameters |
getParameters() |
android.view.SurfaceHolder |
getPreviewDisplay() |
boolean |
hasRequestedAutoFocus() |
void |
invokeAutoFocusCallback(boolean success,
android.hardware.Camera camera) |
void |
invokePreviewCallback(byte[] data)
Allows test cases to invoke the preview callback, to simulate a frame of camera data.
|
boolean |
isLocked() |
boolean |
isPreviewing() |
boolean |
isReleased() |
static android.hardware.Camera |
open() |
static android.hardware.Camera |
open(int cameraId) |
void |
reconnect() |
void |
release() |
void |
setDisplayOrientation(int degrees) |
void |
setOneShotPreviewCallback(android.hardware.Camera.PreviewCallback cb) |
void |
setParameters(android.hardware.Camera.Parameters params) |
void |
setPreviewCallback(android.hardware.Camera.PreviewCallback cb) |
void |
setPreviewCallbackWithBuffer(android.hardware.Camera.PreviewCallback cb) |
void |
setPreviewDisplay(android.view.SurfaceHolder holder) |
void |
startPreview() |
void |
stopPreview() |
void |
unlock() |
public void __constructor__()
@Implementation public static android.hardware.Camera open()
@Implementation public static android.hardware.Camera open(int cameraId)
public static int getLastOpenedCameraId()
@Implementation public void unlock()
@Implementation public void reconnect()
@Implementation public android.hardware.Camera.Parameters getParameters()
@Implementation public void setParameters(android.hardware.Camera.Parameters params)
@Implementation public void setPreviewDisplay(android.view.SurfaceHolder holder)
@Implementation public void startPreview()
@Implementation public void stopPreview()
@Implementation public void release()
@Implementation public void setPreviewCallback(android.hardware.Camera.PreviewCallback cb)
@Implementation public void setOneShotPreviewCallback(android.hardware.Camera.PreviewCallback cb)
@Implementation public void setPreviewCallbackWithBuffer(android.hardware.Camera.PreviewCallback cb)
public void invokePreviewCallback(byte[] data)
data - byte buffer of simulated camera data@Implementation public void addCallbackBuffer(byte[] callbackBuffer)
public List<byte[]> getAddedCallbackBuffers()
@Implementation public void setDisplayOrientation(int degrees)
public int getDisplayOrientation()
@Implementation public void autoFocus(android.hardware.Camera.AutoFocusCallback callback)
@Implementation public void cancelAutoFocus()
public boolean hasRequestedAutoFocus()
public void invokeAutoFocusCallback(boolean success,
android.hardware.Camera camera)
@Implementation
public static void getCameraInfo(int cameraId,
android.hardware.Camera.CameraInfo cameraInfo)
@Implementation public static int getNumberOfCameras()
public boolean isLocked()
public boolean isPreviewing()
public boolean isReleased()
public android.view.SurfaceHolder getPreviewDisplay()
public static void addCameraInfo(int id,
android.hardware.Camera.CameraInfo camInfo)
Camera.CameraInfo object to simulate
the existence of one or more cameras. By default, no
cameras are defined.id - The camera idcamInfo - The CameraInfopublic static void clearCameraInfo()
Copyright © 2016. All rights reserved.