SBSDKUIPage

@interface SBSDKUIPage : NSObject <NSCopying>

This class represents a scanned documents page.

  • The ID of the images in the default ‘SBSDKUIPageFileStorage’.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nonnull) NSUUID *pageFileUUID;

    Swift

    var pageFileUUID: UUID { get }
  • The status of the documents polygon that was detected on the original image.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SBSDKDocumentDetectionStatus status;

    Swift

    var status: SBSDKDocumentDetectionStatus { get }
  • The polygon of the area where the document is located within the pages image.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) SBSDKPolygon *polygon;

    Swift

    var polygon: SBSDKPolygon? { get set }
  • The filter of the receiver.

    Declaration

    Objective-C

    @property (nonatomic) SBSDKImageFilterType filter;

    Swift

    var filter: SBSDKImageFilterType { get set }
  • The index of the of the base filter (SBSDKImageFilterType) within the filter chain. Has no effect, if adjustableFilters is nil or empty.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger baseFilterOrder;

    Swift

    var baseFilterOrder: UInt { get set }
  • Array of adjustable filters being applied to the document image. If nil or empty, nod adjustable filters are applied. Defaults to nil.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<SBSDKBaseAdjustableFilter *> *adjustableFilters;

    Swift

    var adjustableFilters: [SBSDKBaseAdjustableFilter]? { get set }
  • The source the image was received from.

    Declaration

    Objective-C

    @property (nonatomic, readonly) SBSDKPageImageSource pageImageSource;

    Swift

    var pageImageSource: SBSDKPageImageSource { get }
  • Limits the maximum size of the document image. If width or height are zero, this property is effectively ignored. Defaults to CGSizeZero.

    Declaration

    Objective-C

    @property (nonatomic) CGSize documentImageSizeLimit;

    Swift

    var documentImageSizeLimit: CGSize { get set }
  • Not available.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Designated initializer. Creates a new page object.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPageFileID:(nonnull NSUUID *)uuid
                                       polygon:(nullable SBSDKPolygon *)polygon;

    Swift

    init(pageFileID uuid: UUID, polygon: SBSDKPolygon?)

    Parameters

    uuid

    The ID of the images in the default ‘SBSDKUIPageFileStorage’.

    polygon

    The polygon of the area where the document is located within the pages image.

    Return Value

    A new instance of ‘SBSDKUIPage’.

  • Designated initializer. Creates a new page object.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPageFileID:(nonnull NSUUID *)uuid
                                       polygon:(nullable SBSDKPolygon *)polygon
                                        filter:(SBSDKImageFilterType)filter;

    Swift

    init(pageFileID uuid: UUID, polygon: SBSDKPolygon?, filter: SBSDKImageFilterType)

    Parameters

    uuid

    The ID of the images in the default ‘SBSDKUIPageFileStorage’.

    polygon

    The polygon of the area where the document is located within the pages image.

    filter

    The filter to be applied to the page.

    Return Value

    A new instance of ‘SBSDKUIPage’.

  • Designated initializer. Creates a new page object.

    Caution: This method is only for serialization and deserialization of SBSDKUIPage. If using, you are responsible for the correctness of the parameters compared to the stored images at the page file ID.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPageFileID:(nonnull NSUUID *)uuid
                                       polygon:(nullable SBSDKPolygon *)polygon
                                        filter:(SBSDKImageFilterType)filter
                        documentImageSizeLimit:(CGSize)documentImageSizeLimit;

    Swift

    convenience init(pageFileID uuid: UUID, polygon: SBSDKPolygon?, filter: SBSDKImageFilterType, documentImageSizeLimit: CGSize)

    Parameters

    uuid

    The ID of the images in the default ‘SBSDKUIPageFileStorage’.

    polygon

    The polygon of the area where the document is located within the pages image.

    filter

    The filter to be applied to the page.

    documentImageSizeLimit

    Limits the maximum size of the document image. If width or height are zero this parameter is being ignored.

    Return Value

    A new instance of ‘SBSDKUIPage’.

  • Designated initializer. Creates a new page object.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithImage:(nonnull UIImage *)image
                                  polygon:(nullable SBSDKPolygon *)polygon
                                   filter:(SBSDKImageFilterType)filter;

    Swift

    init(image: UIImage, polygon: SBSDKPolygon?, filter: SBSDKImageFilterType)

    Parameters

    image

    The image used as original image.

    polygon

    The polygon of the area where the document is located within the pages image.

    filter

    The filter to be applied to the page.

    Return Value

    A new instance of ‘SBSDKUIPage’.

  • Rotates the receiver clockwise.

    Declaration

    Objective-C

    - (BOOL)rotateClockwise:(NSInteger)times;

    Swift

    func rotateClockwise(_ times: Int) -> Bool

    Parameters

    times

    The number of 90 degree clockwise rotations. Negative values will rotate counter clockwise.

    Return Value

    YES, if the operation was successful, NO otherwise.

  • Detects the documents polygon on the original image of the receiver.

    Declaration

    Objective-C

    - (nullable SBSDKDocumentDetectorResult *)detectDocument:
        (BOOL)applyPolygonIfOkay;

    Swift

    func detectDocument(_ applyPolygonIfOkay: Bool) -> SBSDKDocumentDetectorResult?

    Parameters

    applyPolygonIfOkay

    If set to YES, the detected polygon will be applied to the receiver if its detection status is ‘SBSDKDocumentDetectionStatusOK’.

    Return Value

    The document detector result describing the location of the detected document in the image and the status of the detection, or nil, if no document was detected.

  • Detects the documents polygon on the original image of the receiver.

    Declaration

    Objective-C

    - (nullable SBSDKDocumentDetectorResult *)
        detectDocument:(BOOL)applyPolygonIfOkay
          detectorMode:(SBSDKDocumentDetectorMode)detectorMode;

    Swift

    func detectDocument(_ applyPolygonIfOkay: Bool, detectorMode: SBSDKDocumentDetectorMode) -> SBSDKDocumentDetectorResult?

    Parameters

    applyPolygonIfOkay

    If set to YES, the detected polygon will be applied to the receiver if its detection status is ‘SBSDKDocumentDetectionStatusOK’.

    detectorMode

    Detector mode of document detector,

    Return Value

    The document detector result describing the location of the detected document in the image and the status of the detection, or nil, if no document was detected.

  • Detects the documents polygon on the original image of the receiver and applies it, regardless of the detection status

    Declaration

    Objective-C

    - (void)applyDocumentDetection;

    Swift

    func applyDocumentDetection()
  • Detects the documents polygon on the original image of the receiver and applies it, regardless of the detection status

    Declaration

    Objective-C

    - (void)applyDocumentDetectionWithDetectorMode:
        (SBSDKDocumentDetectorMode)detectorMode;

    Swift

    func applyDocumentDetection(with detectorMode: SBSDKDocumentDetectorMode)

    Parameters

    detectorMode

    Detector mode of document detector,

  • The URL of the original image including any applied rotations.

    Declaration

    Objective-C

    - (NSURL *_Nullable)originalImageURL;

    Swift

    func originalImageURL() -> URL?
  • An UIImage of the original image including any applied rotations.

    Declaration

    Objective-C

    - (UIImage *_Nullable)originalImage;

    Swift

    func originalImage() -> UIImage?
  • An UIImage of the original image including any applied rotations in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (UIImage *_Nullable)originalPreviewImage;

    Swift

    func originalPreviewImage() -> UIImage?
  • The URL of the unfiltered document image including applied rotations and polygon.

    Declaration

    Objective-C

    - (NSURL *_Nullable)unfilteredDocumentImageURL;

    Swift

    func unfilteredDocumentImageURL() -> URL?
  • An UIImage of the unfiltered document image including applied rotations and polygon.

    Declaration

    Objective-C

    - (UIImage *_Nullable)unfilteredDocumentImage;

    Swift

    func unfilteredDocumentImage() -> UIImage?
  • The URL of the unfiltered document image including applied rotations and polygon in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (NSURL *_Nullable)unfilteredDocumentPreviewImageURL;

    Swift

    func unfilteredDocumentPreviewImageURL() -> URL?
  • An UIImage of the unfiltered document image including applied rotations and polygon in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (UIImage *_Nullable)unfilteredDocumentPreviewImage;

    Swift

    func unfilteredDocumentPreviewImage() -> UIImage?
  • The URL of the document image including applied rotations, filter and polygon.

    Declaration

    Objective-C

    - (NSURL *_Nullable)documentImageURL;

    Swift

    func documentImageURL() -> URL?
  • An UIImage of the document image including applied rotations, filter and polygon.

    Declaration

    Objective-C

    - (UIImage *_Nullable)documentImage;

    Swift

    func documentImage() -> UIImage?
  • The URL of the document image including applied rotations, filter and polygon in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (NSURL *_Nullable)documentPreviewImageURL;

    Swift

    func documentPreviewImageURL() -> URL?
  • An UIImage of the document image including applied rotations, filter and polygon in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (UIImage *_Nullable)documentPreviewImage;

    Swift

    func documentPreviewImage() -> UIImage?
  • A preview UIImage of the document image including applied rotations, polygon and the given filter in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (UIImage *_Nullable)documentPreviewImageUsingFilter:
        (SBSDKImageFilterType)filter;

    Swift

    func documentPreviewImage(using filter: SBSDKImageFilterType) -> UIImage?
  • The URL of a preview UIImage of the document image including applied rotations, polygon and the given filter in a resolution matching the devices screen.

    Declaration

    Objective-C

    - (NSURL *_Nullable)documentPreviewImageURLUsingFilter:
        (SBSDKImageFilterType)filter;

    Swift

    func documentPreviewImageURL(using filter: SBSDKImageFilterType) -> URL?