public class Cam
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Cam.ANTI_BANDING |
static class |
Cam.CAMERA_FACING |
static class |
Cam.FLASH_MODE |
static class |
Cam.FOCUS_MODE |
static interface |
Cam.OnStateChangeListener
Camera state change Interface
|
static class |
Cam.PictureCallback
Abstract picture callback
|
static class |
Cam.SCENE_MODE |
class |
Cam.Size
Size model
|
class |
Cam.State
Current Camera state object
|
static class |
Cam.WHITE_BALANCE |
| Modifier and Type | Method and Description |
|---|---|
Cam.CAMERA_FACING |
getCameraFacing()
Get the current camera facing.
|
int |
getCameraOrientation()
Get camera cameraOrientation
|
int |
getCurrentExifOrientation() |
Cam.FLASH_MODE |
getFlashMode()
Get the current FlashMode
|
static Cam |
getInstance()
Get a singleton Camera Instance.
|
Cam.Size |
getPreviewSize()
Get Preview Size
|
Cam.State |
getState()
Get the State of the current Camera getSettingsModel.
|
boolean |
hasSceneMode(java.lang.String mode)
Check if the current state has scene mode is available.
|
static boolean |
isAvailable()
Check if min. 1 Camera is available.
|
boolean |
isFront()
Check if Camera is Front Camera
|
Cam.CAMERA_FACING |
setCameraFacing(Cam.CAMERA_FACING cameraFacing)
Try to set a Camera Facing.
|
Cam.FLASH_MODE |
setFlashMode(Cam.FLASH_MODE mode)
Try to set a flash mode and take a fallback mode if not supported by current Camera.
|
void |
setFocus(java.util.List<android.hardware.Camera.Area> focusAreas)
* Set Camera FOCUS.
|
void |
setOnStateChangeListener(Cam.OnStateChangeListener onStateChangeListener)
Set a listener to catch any getSettingsModel state changes.
|
void |
setPreviewSize(int maxTextureSize,
int maxRenderBufferSize)
Set the maximum TextureSize the device will support.
|
Cam.SCENE_MODE |
setSceneMode(Cam.SCENE_MODE mode)
Try to set a Scene mode and take a fallback mode if not supported by current Camera.
|
void |
setSurface(android.view.SurfaceHolder holder)
Set Preview Texture or a Surface holder
|
void |
setSurface(android.graphics.SurfaceTexture surfaceTexture)
Set Preview Texture
|
void |
startPreview()
Start the Camera Preview, this is async and will begin if the surface are set.
|
void |
stopPreview(boolean release)
Stop the Camera Preview and release the surface.
|
void |
takePicture(CamView.CaptureCallback callback,
java.lang.String outputPath)
* Take a Picture
|
public static boolean isAvailable()
public static Cam getInstance()
@NonNull public Cam.State getState()
public void setOnStateChangeListener(Cam.OnStateChangeListener onStateChangeListener)
onStateChangeListener - state change callback.public void setSurface(android.graphics.SurfaceTexture surfaceTexture)
surfaceTexture - SurfaceTexture that should receive the Camera imagepublic void setSurface(android.view.SurfaceHolder holder)
holder - Surface holder that should receive the Camera imagepublic void setFocus(java.util.List<android.hardware.Camera.Area> focusAreas)
focusAreas - list of focus areas@Nullable public Cam.FLASH_MODE setFlashMode(Cam.FLASH_MODE mode)
mode - flash mode.public Cam.FLASH_MODE getFlashMode()
@Nullable public Cam.SCENE_MODE setSceneMode(Cam.SCENE_MODE mode)
mode - scene mode.@Nullable public boolean hasSceneMode(java.lang.String mode)
mode - scene mode.public Cam.CAMERA_FACING setCameraFacing(Cam.CAMERA_FACING cameraFacing)
cameraFacing - camera facing.public Cam.CAMERA_FACING getCameraFacing()
public void takePicture(CamView.CaptureCallback callback, java.lang.String outputPath)
callback - Callback that fired after image will saved as jpg.outputPath - the output path for saving the imagepublic int getCurrentExifOrientation()
public void startPreview()
public void stopPreview(boolean release)
public void setPreviewSize(int maxTextureSize,
int maxRenderBufferSize)
maxTextureSize - max OpenGl texture sizemaxRenderBufferSize - max OpenGl buffer size@Nullable public Cam.Size getPreviewSize()
public int getCameraOrientation()
public boolean isFront()