Functions

The following functions are available globally.

Points

  • Undocumented

    Declaration

    Objective-C

    CGDelta CGDeltaMake(CGFloat deltaX, CGFloat deltaY)

    Swift

    func CGDeltaMake(_ deltaX: CGFloat, _ deltaY: CGFloat) -> CGDelta
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGPointWithDelta(CGPoint point, CGDelta delta)

    Swift

    func CGPointWithDelta(_ point: CGPoint, _ delta: CGDelta) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    CGFloat CGPointDistance(CGPoint p1, CGPoint p2)

    Swift

    func CGPointDistance(_ p1: CGPoint, _ p2: CGPoint) -> CGFloat
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGPointAlongLine(CGLine line, CGFloat distance)

    Swift

    func CGPointAlongLine(_ line: CGLine, _ distance: CGFloat) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGPointRotatedAroundPoint(CGPoint point, CGPoint pivot, CGFloat degrees)

    Swift

    func CGPointRotatedAroundPoint(_ point: CGPoint, _ pivot: CGPoint, _ degrees: CGFloat) -> CGPoint

Lines

Rectangles

  • Undocumented

    Declaration

    Objective-C

    CGPoint CGRectTopLeftPoint(CGRect rect)

    Swift

    func CGRectTopLeftPoint(_ rect: CGRect) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGRectTopRightPoint(CGRect rect)

    Swift

    func CGRectTopRightPoint(_ rect: CGRect) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGRectBottomLeftPoint(CGRect rect)

    Swift

    func CGRectBottomLeftPoint(_ rect: CGRect) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGRectBottomRightPoint(CGRect rect)

    Swift

    func CGRectBottomRightPoint(_ rect: CGRect) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    CGRect CGRectResize(CGRect rect, CGSize newSize)

    Swift

    func CGRectResize(_ rect: CGRect, _ newSize: CGSize) -> CGRect
  • Undocumented

    Declaration

    Objective-C

    CGRect CGRectInsetEdge(CGRect rect, CGRectEdge edge, CGFloat amount)

    Swift

    func CGRectInsetEdge(_ rect: CGRect, _ edge: CGRectEdge, _ amount: CGFloat) -> CGRect
  • Calculates the stacking of rectangles within a larger rectangle. The resulting rectangle is stacked counter clockwise along the edge specified. As soon as there are more rects than will fit, a new row is started, thus, they are stacked by column, then by row. reverse will cause them to be stacked counter-clockwise along the specified edge.

    Declaration

    Objective-C

    CGRect CGRectStackedWithinRectFromEdge(CGRect rect, CGSize size, int count,
                                           CGRectEdge edge, _Bool reverse)

    Swift

    func CGRectStackedWithinRectFromEdge(_ rect: CGRect, _ size: CGSize, _ count: Int32, _ edge: CGRectEdge, _ reverse: Bool) -> CGRect
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGRectCenterPoint(CGRect rect)

    Swift

    func CGRectCenterPoint(_ rect: CGRect) -> CGPoint
  • Undocumented

    Declaration

    Objective-C

    void CGRectClosestTwoCornerPoints(CGRect rect, CGPoint point, CGPoint *point1, CGPoint *point2)

    Swift

    func CGRectClosestTwoCornerPoints(_ rect: CGRect, _ point: CGPoint, _ point1: UnsafeMutablePointer<CGPoint>!, _ point2: UnsafeMutablePointer<CGPoint>!)
  • Undocumented

    Declaration

    Objective-C

    CGPoint CGLineIntersectsRectAtPoint(CGRect rect, CGLine line)

    Swift

    func CGLineIntersectsRectAtPoint(_ rect: CGRect, _ line: CGLine) -> CGPoint

Arcs

  • Undocumented

    Declaration

    Objective-C

    void CGControlPointsForArcBetweenPointsWithRadius(CGPoint startPoint, CGPoint endPoint, CGFloat radius, bool rightHandRule,
                                                      CGPoint *controlPoint1, CGPoint *controlPoint2)

    Swift

    func CGControlPointsForArcBetweenPointsWithRadius(_ startPoint: CGPoint, _ endPoint: CGPoint, _ radius: CGFloat, _ rightHandRule: Bool, _ controlPoint1: UnsafeMutablePointer<CGPoint>!, _ controlPoint2: UnsafeMutablePointer<CGPoint>!)

ScanningRegion

  • Undocumented

    Declaration

    Objective-C

    PP_EXTERN CGRect scanningRegionForFrameInBounds(CGRect frame, CGRect bounds)

    Swift

    func scanningRegionForFrameInBounds(_ frame: CGRect, _ bounds: CGRect) -> CGRect
  • Method which creates a image extension factors structure

    Declaration

    Objective-C

    static inline MBImageExtensionFactors
    MBMakeImageExtensionFactors(CGFloat top, CGFloat right, CGFloat bottom,
                                CGFloat left)
  • Undocumented

    Declaration

    Objective-C

    static inline NSString * MB_LOCALIZED_DEFAULT_STRING(NSString *key) {
        return ([NSString stringWithFormat:@"[[%@]]", key]);
    }

    Swift

    func MB_LOCALIZED_DEFAULT_STRING(_ key: String!) -> String!
  • Undocumented

    Declaration

    Objective-C

    static inline NSString * MB_LOCALIZED(NSString *key) {
        NSString *localizationFileName = MBMicroblinkApp.instance.customLocalizationFileName;
        if (localizationFileName) {
            NSString *overridenStringFromCustomLocalizationFile = NSLocalizedStringWithDefaultValue(key, localizationFileName, [NSBundle mainBundle], @"", @"");
    
            if (![overridenStringFromCustomLocalizationFile isEqualToString:key]) {
                return overridenStringFromCustomLocalizationFile;
            }
        }
    
        return NSLocalizedStringWithDefaultValue(key,
                                                 MBMicroblinkApp.instance.language,
                                                 [[MBMicroblinkApp instance] resourcesBundle],
                                                 MB_LOCALIZED_DEFAULT_STRING(key), nil);
    }

    Swift

    func MB_LOCALIZED(_ key: String!) -> String!