WZCamera

Superclass:
NSObject
Declared In:

Introduction

The WZCamera class provides an interface for accessing and controlling a camera device. The 'cameras' property of WZCameraPreview can be used to retrieve a list of all cameras.



Methods

-initWithCaptureDevice:
-isBack
-isFront
-setExposureMode:exposurePoint:
-setFocusMode:focusPoint:
-supportsExposureMode:
-supportsFocusMode:
-supportsWidth:

initWithCaptureDevice:


- (nonnull instancetype) initWithCaptureDevice:(nonnull AVCaptureDevice *)captureDevice; 
Parameters
captureDevice

the AVCaptureDevice

Return Value

An instance of WZCamera

Discussion

Initialize a WZCamera from a given AVCaptureDevice


isBack


- (BOOL) isBack; 
Return Value

YES if this is the back-facing camera, otherwise NO

Discussion

Is this the back-facing camera


isFront


- (BOOL) isFront; 
Return Value

YES if this is the front-facing camera, otherwise NO

Discussion

Is this the front-facing camera


setExposureMode:exposurePoint:


- (void) setExposureMode:(WZCameraExposureMode)exposureMode 
        exposurePoint:(CGPoint)point; 
Parameters
exposureMode

the exposure mode

point

the point of interest, with a value between (0,0) and (1,1); a value of (0,0) indicates the camera should focus at the top left corner of the image, while a value of (1,1) indicates that the camera should focus at the bottom right.

Discussion

Sets the exposure mode for this camera at a given point of interest.


setFocusMode:focusPoint:


- (void) setFocusMode:(WZCameraFocusMode)focusMode 
        focusPoint:(CGPoint)point; 
Parameters
focusMode

the focus mode

point

the point of interest, with a value between (0,0) and (1,1); a value of (0,0) indicates the camera should focus at the top left corner of the image, while a value of (1,1) indicates that the camera should focus at the bottom right.

Discussion

Sets the focus mode for this camera at a given point of interest.


supportsExposureMode:


Parameters
mode

the exposure mode

Return Value

YES if the camera supports the exposure mode, otherwise no

Discussion

Does the camera support the given exposure mode


supportsFocusMode:


Parameters
mode

the focus mode

Return Value

YES if the camera supports the focus mode, otherwise no

Discussion

Does the camera support the given focus mode


supportsWidth:


- (BOOL) supportsWidth:(NSUInteger)width; 
Parameters
width

The width

Return Value

YES if the width is supported by the camera, otherwise NO

Discussion

Does the camera support the given frame width


Typedefs

NS_ENUM
NS_ENUM
NS_ENUM
WZCameraDirection
WZCameraExposureMode
WZCameraFocusMode

NS_ENUM


typedef NS_ENUM(NSUInteger, WZCameraDirection) { 
    WZCameraDirectionBack = 0, WZCameraDirectionFront 
}; 
Constants
WZCameraDirectionBack

The back-facing camera.

WZCameraDirectionFront

The front-facing camera.

Discussion

A camera direction, either front or back.

See Also


NS_ENUM


typedef NS_ENUM(NSUInteger, WZCameraFocusMode) { 
    WZCameraFocusModeLocked = 0, WZCameraFocusModeAuto, WZCameraFocusModeContinuous 
}; 
Constants
WZCameraFocusModeLocked

Indicates that the camera focus is locked at the lens' current position.

WZCameraFocusModeAuto

Indicates that the camera will autofocus, and then switch to WZCameraFocusModeLocked.

WZCameraFocusModeContinuous

Indicates that the camera will automatically focus as needed.

Discussion

A camera focus mode.

See Also


NS_ENUM


typedef NS_ENUM(NSUInteger, WZCameraExposureMode) { 
    WZCameraExposureModeLocked = 0, WZCameraExposureModeAuto, WZCameraExposureModeContinuous 
}; 
Constants
WZCameraExposureModeLocked

Indicates that the camera exposure is locked at it's current value.

WZCameraExposureModeAuto

Indicates that the camera will automatically adjust exposure once, and then switch to WZCameraExposureModeLocked.

WZCameraExposureModeContinuous

Indicates that the camera will automatically adjust exposure as needed.

Discussion

A camera exposure mode.

See Also


WZCameraDirection


typedef NS_ENUM(NSUInteger, WZCameraDirection) { 
    WZCameraDirectionBack = 0, WZCameraDirectionFront 
}; 
Constants
WZCameraDirectionBack

The back-facing camera.

WZCameraDirectionFront

The front-facing camera.

Discussion

A camera direction, either front or back.

See Also


WZCameraExposureMode


typedef NS_ENUM(NSUInteger, WZCameraExposureMode) { 
    WZCameraExposureModeLocked = 0, WZCameraExposureModeAuto, WZCameraExposureModeContinuous 
}; 
Constants
WZCameraExposureModeLocked

Indicates that the camera exposure is locked at it's current value.

WZCameraExposureModeAuto

Indicates that the camera will automatically adjust exposure once, and then switch to WZCameraExposureModeLocked.

WZCameraExposureModeContinuous

Indicates that the camera will automatically adjust exposure as needed.

Discussion

A camera exposure mode.

See Also


WZCameraFocusMode


typedef NS_ENUM(NSUInteger, WZCameraFocusMode) { 
    WZCameraFocusModeLocked = 0, WZCameraFocusModeAuto, WZCameraFocusModeContinuous 
}; 
Constants
WZCameraFocusModeLocked

Indicates that the camera focus is locked at the lens' current position.

WZCameraFocusModeAuto

Indicates that the camera will autofocus, and then switch to WZCameraFocusModeLocked.

WZCameraFocusModeContinuous

Indicates that the camera will automatically focus as needed.

Discussion

A camera focus mode.

See Also


Properties

cameraId
direction
exposureMode
focusMode
frameSizes
hasTorch
iOSCaptureDevice
supportedPresetConfigs
torchOn

cameraId


@property (readonly) NSUInteger cameraId; 
Discussion

A unique identifier for this camera


direction


@property (readonly) WZCameraDirection direction; 
Discussion

The facing direction of this camera


exposureMode


@property (nonatomic) WZCameraExposureMode exposureMode; 
Discussion

The exposure mode for this camera


focusMode


@property (nonatomic) WZCameraFocusMode focusMode; 
Discussion

The focus mode for this camera


frameSizes


@property (nonatomic,
    nonnull,
    readonly) NSArray<NSValue *> *frameSizes; 
Discussion

The supported frame sizes for this camera, as an array of CGSize values


hasTorch


@property (nonatomic,
    readonly) BOOL hasTorch; 
Discussion

Returns whether or not this camera has a torch (flash)


iOSCaptureDevice


@property (nonatomic,
    readonly,
    nonnull) AVCaptureDevice *iOSCaptureDevice; 
Discussion

The AVCaptureDevice represented by this camera


supportedPresetConfigs


@property (nonatomic,
    nonnull,
    readonly) NSArray<WZMediaConfig *> *supportedPresetConfigs; 
Discussion

The supported WZMediaConfigs for this camera


torchOn


@property (nonatomic,
    getter=isTorchOn) BOOL torchOn; 
Discussion

Set the torch (flash) on or off