Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rect

Hierarchy

Implements

Index

Constructors

constructor

  • new Rect(x: number, y: number, width: number, height: number): Rect
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns Rect

Accessors

area

  • get area(): number
  • Returns number

bottom

  • get bottom(): number
  • Returns number

height

  • get height(): number
  • Returns number

left

  • get left(): number
  • Returns number

right

  • get right(): number
  • Returns number

top

  • get top(): number
  • Returns number

width

  • get width(): number
  • Returns number

x

  • get x(): number
  • Returns number

y

  • get y(): number
  • Returns number

Methods

calibrate

  • calibrate(region: Box): Box<any>
  • Parameters

    Returns Box<any>

clipAtImageBorders

  • clipAtImageBorders(imgWidth: number, imgHeight: number): Box<Rect>
  • Parameters

    • imgWidth: number
    • imgHeight: number

    Returns Box<Rect>

floor

  • Returns Box<Rect>

pad

  • pad(padX: number, padY: number): Box<Rect>
  • Parameters

    • padX: number
    • padY: number

    Returns Box<Rect>

padAtBorders

  • padAtBorders(imageHeight: number, imageWidth: number): object
  • Parameters

    • imageHeight: number
    • imageWidth: number

    Returns object

rescale

  • Parameters

    Returns Box<Rect>

round

  • Returns Box<Rect>

shift

  • shift(sx: number, sy: number): Box<Rect>
  • Parameters

    • sx: number
    • sy: number

    Returns Box<Rect>

toSquare

  • Returns Box<Rect>

Static assertIsValidBox

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

    • box: any
    • callee: string
    • Default value allowNegativeDimensions: boolean = false

    Returns void

Static isRect

  • isRect(rect: any): boolean
  • Parameters

    • rect: any

    Returns boolean

Generated using TypeDoc