Class: DisplayRect

OpenSeadragon.DisplayRect

A display rectangle is very similar to OpenSeadragon.Rect but adds two fields, 'minLevel' and 'maxLevel' which denote the supported zoom levels for this rectangle.

Constructor

new DisplayRect(x, y, width, height, minLevel, maxLevel)

Parameters:
Name Type Description
x Number The vector component 'x'.
y Number The vector component 'y'.
width Number The vector component 'height'.
height Number The vector component 'width'.
minLevel Number The lowest zoom level supported.
maxLevel Number The highest zoom level supported.
Source:

Extends

Members

degrees :Number

The rotation of the rectangle, in degrees.
Type:
  • Number
Inherited From:
Source:

height :Number

The vector component 'height'.
Type:
  • Number
Inherited From:
Source:

maxLevel :Number

The highest zoom level supported.
Type:
  • Number
Source:

minLevel :Number

The lowest zoom level supported.
Type:
  • Number
Source:

width :Number

The vector component 'width'.
Type:
  • Number
Inherited From:
Source:

x :Number

The vector component 'x'.
Type:
  • Number
Inherited From:
Source:

y :Number

The vector component 'y'.
Type:
  • Number
Inherited From:
Source:

Methods

clone() → {OpenSeadragon.Rect}

Inherited From:
Source:
Returns:
a duplicate of this Rect
Type
OpenSeadragon.Rect

containsPoint(point, epsilonopt) → {Boolean}

Determines whether a point is inside this rectangle (edge included).
Parameters:
Name Type Attributes Default Description
point OpenSeadragon.Point
epsilon Number <optional>
0 the margin of error allowed
Inherited From:
Source:
Returns:
true if the point is inside this rectangle, false otherwise.
Type
Boolean

equals(rectangle) → {Boolean}

Determines if two Rectangles have equivalent components.
Parameters:
Name Type Description
rectangle OpenSeadragon.Rect The Rectangle to compare to.
Inherited From:
Source:
Returns:
'true' if all components are equal, otherwise 'false'.
Type
Boolean

getAspectRatio() → {Number}

The aspect ratio is simply the ratio of width to height.
Inherited From:
Source:
Returns:
The ratio of width to height.
Type
Number

getBottomLeft() → {OpenSeadragon.Point}

Provides the coordinates of the bottom-left corner of the rectangle as a point.
Inherited From:
Source:
Returns:
The coordinate of the bottom-left corner of the rectangle.
Type
OpenSeadragon.Point

getBottomRight() → {OpenSeadragon.Point}

Provides the coordinates of the bottom-right corner of the rectangle as a point.
Inherited From:
Source:
Returns:
The coordinate of the bottom-right corner of the rectangle.
Type
OpenSeadragon.Point

getBoundingBox() → {OpenSeadragon.Rect}

Retrieves the smallest horizontal (degrees=0) rectangle which contains this rectangle.
Inherited From:
Source:
Returns:
Type
OpenSeadragon.Rect

getCenter() → {OpenSeadragon.Point}

Computes the center of the rectangle.
Inherited From:
Source:
Returns:
The center of the rectangle as represented as represented by a 2-dimensional vector (x,y)
Type
OpenSeadragon.Point

getIntegerBoundingBox() → {OpenSeadragon.Rect}

Retrieves the smallest horizontal (degrees=0) rectangle which contains this rectangle and has integers x, y, width and height
Inherited From:
Source:
Returns:
Type
OpenSeadragon.Rect

getSize() → {OpenSeadragon.Point}

Returns the width and height component as a vector OpenSeadragon.Point
Inherited From:
Source:
Returns:
The 2 dimensional vector representing the width and height of the rectangle.
Type
OpenSeadragon.Point

getTopLeft() → {OpenSeadragon.Point}

Provides the coordinates of the upper-left corner of the rectangle as a point.
Inherited From:
Source:
Returns:
The coordinate of the upper-left corner of the rectangle.
Type
OpenSeadragon.Point

getTopRight() → {OpenSeadragon.Point}

Provides the coordinates of the top-right corner of the rectangle as a point.
Inherited From:
Source:
Returns:
The coordinate of the top-right corner of the rectangle.
Type
OpenSeadragon.Point

intersection(rect) → {OpenSeadragon.Rect}

Returns the bounding box of the intersection of this rectangle with the given rectangle.
Parameters:
Name Type Description
rect OpenSeadragon.Rect
Inherited From:
Source:
Returns:
the bounding box of the intersection or null if the rectangles don't intersect.
Type
OpenSeadragon.Rect

rotate(degrees, pivotopt) → {OpenSeadragon.Rect}

Rotates a rectangle around a point.
Parameters:
Name Type Attributes Description
degrees Number The angle in degrees to rotate.
pivot OpenSeadragon.Point <optional>
The point about which to rotate. Defaults to the center of the rectangle.
Inherited From:
Source:
Returns:
Type
OpenSeadragon.Rect

times(factor) → {OpenSeadragon.Rect}

Multiply all dimensions (except degrees) in this Rect by a factor and return a new Rect.
Parameters:
Name Type Description
factor Number The factor to multiply vector components.
Inherited From:
Source:
Returns:
A new rect representing the multiplication of the vector components by the factor
Type
OpenSeadragon.Rect

toString() → {String}

Provides a string representation of the rectangle which is useful for debugging.
Inherited From:
Source:
Returns:
A string representation of the rectangle.
Type
String

translate(delta) → {OpenSeadragon.Rect}

Translate/move this Rect by a vector and return new Rect.
Parameters:
Name Type Description
delta OpenSeadragon.Point The translation vector.
Inherited From:
Source:
Returns:
A new rect with altered position
Type
OpenSeadragon.Rect

union(rect) → {OpenSeadragon.Rect}

Returns the smallest rectangle that will contain this and the given rectangle bounding boxes.
Parameters:
Name Type Description
rect OpenSeadragon.Rect
Inherited From:
Source:
Returns:
The new rectangle.
Type
OpenSeadragon.Rect