### Type parameters

- #### BoxType = any

### Hierarchy

- Box
  - BoundingBox
  - LabeledBox
  - Rect

### Implements

- IBoundingBox
- IRect

## Index

### Constructors

- constructor

### Accessors

- area
- bottom
- bottomLeft
- bottomRight
- height
- left
- right
- top
- topLeft
- topRight
- width
- x
- y

### Methods

- calibrate
- clipAtImageBorders
- floor
- pad
- padAtBorders
- rescale
- round
- shift
- toSquare
- assertIsValidBox
- isRect

## Constructors

### constructor

- new Box<BoxType>(_box: IRect | IBoundingBox, allowNegativeDimensions?: boolean): Box <BoxType>

- - Defined in classes/Box.ts:28

  #### Type parameters

  - #### BoxType = any

  #### Parameters

  - ##### _box: IRect | IBoundingBox

  - ##### allowNegativeDimensions: boolean = true

  #### Returns Box <BoxType>

## Accessors

### area

- get area(): number

- - Defined in classes/Box.ts:70

  #### Returns number

### bottom

- get bottom(): number

- Implementation of IBoundingBox.bottom

  - Defined in classes/Box.ts:68

  #### Returns number

### bottomLeft

- get bottomLeft(): Point

- - Defined in classes/Box.ts:76

  #### Returns Point

### bottomRight

- get bottomRight(): Point

- - Defined in classes/Box.ts:78

  #### Returns Point

### height

- get height(): number

- Implementation of IRect.height

  - Defined in classes/Box.ts:60

  #### Returns number

### left

- get left(): number

- Implementation of IBoundingBox.left

  - Defined in classes/Box.ts:62

  #### Returns number

### right

- get right(): number

- Implementation of IBoundingBox.right

  - Defined in classes/Box.ts:66

  #### Returns number

### top

- get top(): number

- Implementation of IBoundingBox.top

  - Defined in classes/Box.ts:64

  #### Returns number

### topLeft

- get topLeft(): Point

- - Defined in classes/Box.ts:72

  #### Returns Point

### topRight

- get topRight(): Point

- - Defined in classes/Box.ts:74

  #### Returns Point

### width

- get width(): number

- Implementation of IRect.width

  - Defined in classes/Box.ts:58

  #### Returns number

### x

- get x(): number

- Implementation of IRect.x

  - Defined in classes/Box.ts:54

  #### Returns number

### y

- get y(): number

- Implementation of IRect.y

  - Defined in classes/Box.ts:56

  #### Returns number

## Methods

### calibrate

- calibrate(region: Box <any>): Box <any>

- - Defined in classes/Box.ts:197

  #### Parameters

  - ##### region: Box <any>

  #### Returns Box <any>

### clipAtImageBorders

- clipAtImageBorders(imgWidth: number, imgHeight: number): Box <BoxType>

- - Defined in classes/Box.ts:136

  #### Parameters

  - ##### imgWidth: number

  - ##### imgHeight: number

  #### Returns Box <BoxType>

### floor

- floor(): Box <BoxType>

- - Defined in classes/Box.ts:88

  #### Returns Box <BoxType>

### pad

- pad(padX: number, padY: number): Box <BoxType>

- - Defined in classes/Box.ts:124

  #### Parameters

  - ##### padX: number

  - ##### padY: number

  #### Returns Box <BoxType>

### padAtBorders

- padAtBorders(imageHeight: number, imageWidth: number): { dx: number; dy: number; edx: number; edy: number; ex: number; ey: number; h: number; w: number; x: number; y: number }

- - Defined in classes/Box.ts:161

  #### Parameters

  - ##### imageHeight: number

  - ##### imageWidth: number

  #### Returns { dx: number; dy: number; edx: number; edy: number; ex: number; ey: number; h: number; w: number; x: number; y: number }

  - ##### dx: number

  - ##### dy: number

  - ##### edx: number

  - ##### edy: number

  - ##### ex: number

  - ##### ey: number

  - ##### h: number

  - ##### w: number

  - ##### x: number

  - ##### y: number

### rescale

- rescale(s: number | IDimensions ): Box <BoxType>

- - Defined in classes/Box.ts:113

  #### Parameters

  - ##### s: number | IDimensions

  #### Returns Box <BoxType>

### round

- round(): Box <BoxType>

- - Defined in classes/Box.ts:80

  #### Returns Box <BoxType>

### shift

- shift(sx: number, sy: number): Box <BoxType>

- - Defined in classes/Box.ts:151

  #### Parameters

  - ##### sx: number

  - ##### sy: number

  #### Returns Box <BoxType>

### toSquare

- toSquare(): Box <BoxType>

- - Defined in classes/Box.ts:96

  #### Returns Box <BoxType>

### Static assertIsValidBox

- assertIsValidBox(box: any, callee: string, allowNegativeDimensions?: boolean): void

- - Defined in classes/Box.ts:12

  #### Parameters

  - ##### box: any

  - ##### callee: string

  - ##### allowNegativeDimensions: boolean = false

  #### Returns void

### Static isRect

- isRect(rect: any): boolean

- - Defined in classes/Box.ts:8

  #### Parameters

  - ##### rect: any

  #### Returns boolean