Kofax Mobile SDK API Reference
Instance Methods | Class Methods | Properties | List of all members
kfxKUIImageCaptureControl Class Reference

This class renders the camera preview to the screen and returns an image. More...

#import <kfxKUIImageCaptureControl.h>

Inheritance diagram for kfxKUIImageCaptureControl:

Instance Methods

(int) - forceTakePicture
 Begins the image capture process and ignores all capture constraints. More...
 
(int) - forceTakePicture:
 Begins the image capture process and ignores all capture constraints. More...
 
(int) - setImageResolution:
 Sets the desired preset for image capture. More...
 
(BOOL) - canSetResolution:
 Returns whether the given preset can be used. More...
 
(void) - SessionCreate
 Begin an AppStats session. More...
 
(void) - SessionDismiss
 End an AppStats session. More...
 
(int) - setCameraType:
 Sets the camera type for capture experience. More...
 

Class Methods

(void) + initializeControl
 This message initializes the control and must be sent to the class before it is used. More...
 

Properties

kfxKUIFlashSetting flash
 The current camera flash mode. More...
 
BOOL useVideoFrame
 Whether the video frame is retured, or a full-resolution image is captured. More...
 
BOOL automaticallyEnablesStillImageStabilization
 A Boolean value that indicates whether still image stabilization should be automatically enabled when available. More...
 
BOOL highResolutionStillImageEnabled
 A Boolean value that indicates whether capture control should emit still images at the highest resolution supported. More...
 
int deviceDeclinationPitch
 The reference pitch that indicates what angle means that the device is level. More...
 
int deviceDeclinationRoll
 The reference roll that indicates what angle means that the device is level. More...
 
CGSize imagePreviewSize
 Gets the camera preview resolution. More...
 
CGPoint defaultFocusPoint
 Gets the default camera focus point. More...
 
CGPoint focusPoint
 The camera focus point. More...
 
IBOutlet id< kfxKUIImageCaptureControlDelegatedelegate
 A delegate to receive messages from the control. More...
 
CMMotionManager * motionManager
 The motion manager being used to detect the levelness of the device. More...
 
kfxKUIGPSUsageLimits gpsUsageLimits
 gpsUsageLimits - controls whether GPS location information is captured with the image. More...
 

Detailed Description

This class renders the camera preview to the screen and returns an image.

This class is responsible for rendering the camera preview and provides visual level and stability feedback to guide the user to take a clear photo.

Method Documentation

◆ canSetResolution:()

- (BOOL) canSetResolution: (NSString *)  resolution

Returns whether the given preset can be used.

The preset values accepted by this method are the same session presets defined by Apple in AVFoundation.

The camera session must be active before this method can return correct results. If your instance of the ImageCaptureControl is being attached to your view implicitly by a storyboard or Interface Builder, then the earliest place you should query this method is in your view's viewDidAppear method.

If you are explicitly attaching an ImageCaptureControl to your view in code, then you can query this method at any point after, as long as the control remains attached to the active view hierarchy.

Parameters
resolutionA session preset
See also
- setImageResolution:

◆ forceTakePicture()

- (int) forceTakePicture

Begins the image capture process and ignores all capture constraints.

Calling this method will stat the image capture process, but constraints like levelness, stability, and page detection will be ignored. The control will attempt to take a picture as quickly as possible. The delegate will receive a imageCaptureControl:imageCaptured: message for each captured iamge.

Return values
KMC_SUCCESSThe control will attempt to capture a picture.
KMC_EV_LICENSINGThe control did attempt attempt to capture a picture due to a licensing error.

◆ forceTakePicture:()

- (int) forceTakePicture: (BOOL)  waitForFocus

Begins the image capture process and ignores all capture constraints.

Calling this method will start the image capture process, but constraints like levelness, stability, and page detection will be ignored. The control will attempt to take a picture as quickly as possible. The delegate will receive a imageCaptureControl:imageCaptured: message for each captured iamge.

Parameters
waitForFocusYES to check focus check Criteria, NO to take picture without checking any crieteria.
Return values
KMC_SUCCESSThe control will attempt to capture a picture.
KMC_EV_LICENSINGThe control did not attempt to capture a picture due to a licensing error.

◆ initializeControl()

+ (void) initializeControl

This message initializes the control and must be sent to the class before it is used.

This message initializes the control for use and must be sent to the class before it is used. It is ok to send the message more than once. A common way to do this is in your UIViewController subclasses initialize or init methods.

◆ SessionCreate()

- (void) SessionCreate

Begin an AppStats session.

This method begins a new AppStats session. It creates a new instance object and initializes it with the current time. In combination with SessionDismiss, it allows specified log information to be bracketed with begin and end times.

◆ SessionDismiss()

- (void) SessionDismiss

End an AppStats session.

This method ends an AppStats session. It updates a previously created instance object with a dismissal time.

◆ setCameraType:()

- (int) setCameraType: (kfxKUICameraType cameraType

Sets the camera type for capture experience.

Parameters
cameraTypeA enumaration value to set front/back camera.
Return values
KMC_SUCCESSwhen camera type is available
KMC_GN_UNSUPPORTED_OPERATIONwhen camera type is not available

◆ setImageResolution:()

- (int) setImageResolution: (NSString *)  resolution

Sets the desired preset for image capture.

Sets the desired preset for image capture. The actual resolution of a captured image may be reversed from what is given (e.g. a 960x1280 image may be returned for a 1280x960 request). Presets may select different image resolutions depending on device.

After calling this method, the kfxUIImageCaptureControl instance may resize itself.

Note: The AVCaptureControlInputPriority preset is not supported.

Parameters
resolutionA session preset
Return values
KMC_SUCCESSThe desired preset was accepted
KMC_GN_UNSUPPORTED_OPERATIONThe desired preset is not supported
See also
useVideoFrame

Property Documentation

◆ automaticallyEnablesStillImageStabilization

- (BOOL) automaticallyEnablesStillImageStabilization
readwritenonatomicassign

A Boolean value that indicates whether still image stabilization should be automatically enabled when available.

If Image Stabilization is supported by device, it may be applied to reduce blur commonly found in low light photos. When stabilization is enabled, still image captures incur additional latency.

This setting is applicable only for a full-resolution image capture mode when useVideoFrame is set to NO. For devices with no stabilization support this will do nothing.

The default value is YES which mean stabilization will be automatically enabled when available.

◆ defaultFocusPoint

- (CGPoint) defaultFocusPoint
readatomicassign

Gets the default camera focus point.

See also
focusPoint

◆ delegate

- (IBOutlet id<kfxKUIImageCaptureControlDelegate>) delegate
readwritenonatomicweak

A delegate to receive messages from the control.

A property to get or set the delegate that will be notified of stability, levelness and captured images.

◆ deviceDeclinationPitch

- (int) deviceDeclinationPitch
readwritenonatomicassign

The reference pitch that indicates what angle means that the device is level.

A property to get or set an angle in degrees that will be used to determine that the device is level. The default value is 0, which indicates that the top and bottom of the device are in the same horizontal plane. A positive value indicates that the top of the device should be higher than the bottom for the device to be considered level, and a negative value means that the bottom should be higher.

Valid values are in the range [-180, 180].

◆ deviceDeclinationRoll

- (int) deviceDeclinationRoll
readwritenonatomicassign

The reference roll that indicates what angle means that the device is level.

A property to get or set an angle in degrees that will be used to determine that the device is level. The default value is 0, which indicates that the left and right sides of the device are in the same horizontal plane. A positive value indicates that the left side of the device should be higher than the right for the device to be considered level, and a negative value means that the right side should be higher.

Valid values are in the range [-180, 180].

◆ flash

- (kfxKUIFlashSetting) flash
readwritenonatomicassign

The current camera flash mode.

A property to get or set the flash/torch mode. The supported values are: kfxKUIFlashOff - Indicates that the flash should always be off. kfxKUIFlashOn - Indicates that the flash should always be on. Supported only for still image capture mode. kfxKUIFlashAuto - Indicates that the flash should be used automatically depending on ambient light conditions. Supported only for still image capture mode. kfxKUITorch - Indicates that the torch should always be on. kfxKUITorchAuto - Indicates that the torch should be turned on automatically depending on ambient light conditions. Once torch is on it will not be turned off automatically.

The default value is kfxKUIFlashOff.

See also
kfxKUIFlashSetting

◆ focusPoint

- (CGPoint) focusPoint
readwritenonatomicassign

The camera focus point.

Specifies the point where the camera should adjust focus. The camera will analyze the image data in a small area around the focus point to determine the optimal focus.

The camera focus point is specified in the control's local coordinate space. The valid coordinate range is (0, 0) to (width, height) using the dimensions of the ImageCaptureControl. The property will translate these coordinates into the camera's coordinate space.

If a coordinate is specified outside an area covered by the camera preview, then the closest valid point will be used instead. For example, if the camera preview aspect ratio does not match the aspect ratio of the control, black margins will be present on sides. Specifying a point in the margin area will result in the closest point on the preview edge being used instead.

A set focus point will remain in effect until the control is invalidated. Resizing the control, changing camera parameters, or suspending the application are all sufficient to invalidate the set focus point. The value of the focus point is undefined once it is invalided.

If setting the focus point is not supported on the device, setting this property will raise an exception.

See also
defaultFocusPoint

◆ gpsUsageLimits

- (kfxKUIGPSUsageLimits) gpsUsageLimits
readwritenonatomicassign

gpsUsageLimits - controls whether GPS location information is captured with the image.

The property allows the app to determine whether the Image Capture Control includes GPS location information with the captured image. The kfxKUIGPSUsageLimits enum has two settings:

kfxKUINeverUse - GPS information will not be gathered under any circumstances. When using kfxKUINeverUse, the user is not queried for permission to collect location information. kfxKUIAlwaysUseIfEnabled - GPS information will be gathered if permitted by the operating system. With kfxKUIAlwaysUseIfEnabled, the user may be queried for permission if no user preference has previously been determined. This is the default setting of this property.

This property should be set in the viewDidLoad method (before the control is displayed).

◆ highResolutionStillImageEnabled

- (BOOL) highResolutionStillImageEnabled
readwritenonatomicassign

A Boolean value that indicates whether capture control should emit still images at the highest resolution supported.

When enabled, the capture control emits still images at the highest resolution supported. When disabled, the capture control emits images with the same dimensions as current session preset.

This setting is applicable only for a full-resolution image capture mode when useVideoFrame is set to NO. Supported starting iPhone 6 and 6 Plus.

The default value is YES.

◆ imagePreviewSize

- (CGSize) imagePreviewSize
readnonatomicassign

Gets the camera preview resolution.

A read-only property to get the resolution of the camera preview. This value will vary depending on the target device and its camera capabilities.

Note, this property can only return an accurate value after the camera has been initialized and processed its first preview frame. This property cannot be reliably called anywhere in the view construction lifecycle, including the methods viewDidLoad and viewDidAppear.

◆ motionManager

- (CMMotionManager*) motionManager
readwritenonatomicstrong

The motion manager being used to detect the levelness of the device.

A property to get or set the motion manager to use to detect the levelness of the device. If this is never set, one will be allocated which is available to use if the application wants to get motion events at the same time as the control. It may also be set, but that must be done in the view controller's viewDidLoad or before.

◆ useVideoFrame

- (BOOL) useVideoFrame
readwritenonatomicassign

Whether the video frame is retured, or a full-resolution image is captured.

A boolean that indicates whether the video frame, or a full-resolution image is returned when capture is requested. Using the video frame may speed up image classification, but will result in less accurate results, as there is less image data to work with.

switching between video frame and full-resolution capture will cause the session preset (the capture resolution) to be reset to its default value. For video frame capture, the default preset is 1080p if supported, or 720p. For full-resoluton capture, the default preset is photo quality. If you want to change the session preset, do so after changing this property.


The documentation for this class was generated from the following file:
Untitled Document © 2018 Kofax, Inc. All rights reserved. Use is subject to license terms.