ALCutoutConfig Class Reference

Inherits from NSObject
Conforms to ALJSONStringRepresentable
Declared in ALCutoutConfig.h

Overview

Configuration object for a plugin’s cutout visible on the ScanView

  alignment

Preset position indicating where a cutout is generally placed

@property (nonatomic, readonly) ALCutoutAlignment alignment

Declared In

ALCutoutConfig.h

  width

Suggested width in pixels (based on device capture resolution width) of the cutout. Used, unless maxWidthPercent is specified, and evaluates to a smaller width.

@property (nonatomic, readonly) NSInteger width

Declared In

ALCutoutConfig.h

  maxWidthPercent

The maximum width in percent (0-100) of the scan view the cutout will occupy

@property (nonatomic, readonly) NSInteger maxWidthPercent

Declared In

ALCutoutConfig.h

  maxHeightPercent

The maximum height in percent (0-100) of the scan view the cutout will occupy

@property (nonatomic, readonly) NSInteger maxHeightPercent

Declared In

ALCutoutConfig.h

  ratioFromSize

A CGSize value indicating the cutout width-height ratio

@property (nonatomic, readonly) CGSize ratioFromSize

Declared In

ALCutoutConfig.h

  strokeWidth

Stroke width of the cutout

@property (nonatomic, readonly) NSInteger strokeWidth

Declared In

ALCutoutConfig.h

  strokeColor

Stroke color of the cutout: use a hex string (“00CCFF”)

@property (nonatomic, readonly) NSString *strokeColor

Declared In

ALCutoutConfig.h

  feedbackStrokeColor

Color of the cutout when the scanner is reporting feedback: use a hex string (eg “00CCFF”)

@property (nonatomic, readonly) NSString *feedbackStrokeColor

Declared In

ALCutoutConfig.h

  cornerRadius

Amount of corner rounding applied to the cutout

@property (nonatomic, readonly) NSInteger cornerRadius

Declared In

ALCutoutConfig.h

  outerColor

Background color as a hex string. Use a hex string format (“XXXXXX”, or “XXXXXXXX” in which the alpha component takes the first two characters).

@property (nonatomic, readonly) NSString *outerColor

Declared In

ALCutoutConfig.h

  offset

Position offset of the cutout, used in conjunction with alignment

@property (nonatomic, readonly) CGPoint offset

Declared In

ALCutoutConfig.h

  image

(Not currently supported) image used for the cutout

@property (nonatomic, readonly) NSString *image

Declared In

ALCutoutConfig.h

  animation

(Not currently supported) animation shown with the cutout

@property (nonatomic, readonly) ALCutoutAnimationStyle animation

Declared In

ALCutoutConfig.h

  cropPadding

Amount of padding to be applied to the cutout (use positive amounts only). A crop padding truncates the visual area represented by the cutout; used in optimizing scan performance for some plugins

@property (nonatomic, readonly) CGSize cropPadding

Declared In

ALCutoutConfig.h

  cropOffset

Used in conjunction with cropPadding. The offset further adjusts the crop position after the padding is applied

@property (nonatomic, readonly) CGPoint cropOffset

Declared In

ALCutoutConfig.h

  alignmentString

The cutout alignment as a human-readable string

@property (nonatomic, readonly) NSString *alignmentString

Declared In

ALCutoutConfig.h

  animationString

The cutout animation as a human-readable string

@property (nonatomic, readonly) NSString *animationString

Declared In

ALCutoutConfig.h

+ defaultCutoutConfig

Used to create a cutout configuration with default values; possibly useful as a base for further customization

+ (ALCutoutConfig *)defaultCutoutConfig

Declared In

ALCutoutConfig.h

– initWithJSONDictionary:error:

Initializes a CutoutConfig with a JSON Dictionary

- (instancetype _Nullable)initWithJSONDictionary:(NSDictionary *)JSONDict error:(NSError *_Nullable *_Nullable)error

Parameters

JSONDict

JSON dictionary. “cutoutConfig” can be the parent node

error

an NSError object which is filled when attempting to initialize with the JSON fails

Declared In

ALCutoutConfig.h

+ withJSONDictionary:

Convenience initializer that takes a JSON Dictionary

+ (ALCutoutConfig *_Nullable)withJSONDictionary:(NSDictionary *)JSONDict

Parameters

JSONDict

the JSON Dictionary

Declared In

ALCutoutConfig.h

– initWithAlignment:animation:ratioFromSize:offset:width:maxHeightPercent:maxWidthPercent:cornerRadius:strokeWidth:strokeColor:feedbackStrokeColor:outerColor:cropOffset:cropPadding:image:

- (instancetype _Nullable)initWithAlignment:(ALCutoutAlignment)alignment animation:(ALCutoutAnimationStyle)animation ratioFromSize:(CGSize)ratioFromSize offset:(CGPoint)offset width:(NSInteger)width maxHeightPercent:(NSInteger)maxHeightPercent maxWidthPercent:(NSInteger)maxWidthPercent cornerRadius:(NSInteger)cornerRadius strokeWidth:(NSInteger)strokeWidth strokeColor:(NSString *_Nullable)strokeColor feedbackStrokeColor:(NSString *_Nullable)feedbackStrokeColor outerColor:(NSString *_Nullable)outerColor cropOffset:(CGPoint)cropOffset cropPadding:(CGSize)cropPadding image:(NSString *_Nullable)image

+ withAlignment:animation:ratioFromSize:offset:width:maxHeightPercent:maxWidthPercent:cornerRadius:strokeWidth:strokeColor:feedbackStrokeColor:outerColor:cropOffset:cropPadding:image:

+ (ALCutoutConfig *)withAlignment:(ALCutoutAlignment)alignment animation:(ALCutoutAnimationStyle)animation ratioFromSize:(CGSize)ratioFromSize offset:(CGPoint)offset width:(NSInteger)width maxHeightPercent:(NSInteger)maxHeightPercent maxWidthPercent:(NSInteger)maxWidthPercent cornerRadius:(NSInteger)cornerRadius strokeWidth:(NSInteger)strokeWidth strokeColor:(NSString *_Nullable)strokeColor feedbackStrokeColor:(NSString *_Nullable)feedbackStrokeColor outerColor:(NSString *_Nullable)outerColor cropOffset:(CGPoint)cropOffset cropPadding:(CGSize)cropPadding image:(NSString *_Nullable)image