ALSquare Class Reference

Inherits from NSObject
Declared in ALSquare.h

Overview

An ALSquare is an object with 4 points. They are an 2D representation of a rectangle in the image.

  upLeft

The up left point of the square.

@property (nonatomic, assign) CGPoint upLeft

Declared In

ALSquare.h

  upRight

The up right point of the square.

@property (nonatomic, assign) CGPoint upRight

Declared In

ALSquare.h

  downLeft

The down left point of the square.

@property (nonatomic, assign) CGPoint downLeft

Declared In

ALSquare.h

  downRight

The down right point of the square.

@property (nonatomic, assign) CGPoint downRight

Declared In

ALSquare.h

– initWithUpLeft:upRight:downLeft:downRight:

Initialises an ALSquare with 4 points

- (instancetype)initWithUpLeft:(CGPoint)upLeft upRight:(CGPoint)upRight downLeft:(CGPoint)downLeft downRight:(CGPoint)downRight

Parameters

upLeft

The up left point of the square.

upRight

The up right point of the square.

downLeft

The down left point of the square.

downRight

The down right point of the square.

Return Value

A new instance of ALSquare.

Declared In

ALSquare.h

– initWithCGRect:

Initialises an ALSquare with an CGRect

- (instancetype)initWithCGRect:(CGRect)rect

Parameters

rect

The rectangle to create an ALSquare

Return Value

A new instance of ALSquare.

Declared In

ALSquare.h

– boundingX

- (CGFloat)boundingX

– boundingY

- (CGFloat)boundingY

– boundingWidth

- (CGFloat)boundingWidth

– boundingHeight

- (CGFloat)boundingHeight

– squareWithPointOffset:

- (ALSquare *)squareWithPointOffset:(CGPoint)offset

– squareWithScale:

- (ALSquare *)squareWithScale:(CGFloat)scale

– area

- (CGFloat)area

– area2

- (CGFloat)area2

– ratio

- (float)ratio

– boxRect

- (CGRect)boxRect

– similiarTo:

- (BOOL)similiarTo:(ALSquare *)square