new Size(values)
Immutable Size class. Warning: the input array is NOT cloned, modifying it will modify the index values.
Name | Type | Description |
---|---|---|
values | Array | The size values. |
- Source
Methods
canScroll(viewOrientation) → {boolean}
Check if the associated data is scrollable: either in 3D or in other directions.
Name | Type | Description |
---|---|---|
viewOrientation | dwv. | The orientation matrix. |
- Source
True if scrollable.
- Type:
- boolean
canScroll3D(viewOrientation) → {boolean}
Check if the associated data is scrollable in 3D.
Name | Type | Description |
---|---|---|
viewOrientation | dwv. | The orientation matrix. |
- Source
True if scrollable.
- Type:
- boolean
equals(rhs) → {boolean}
Check for equality.
Name | Type | Description |
---|---|---|
rhs | dwv. | The object to compare to. |
- Source
True if both objects are equal.
- Type:
- boolean
get(i) → {number}
Get the size value at the given array index.
Name | Type | Description |
---|---|---|
i | number | The index to get. |
- Source
The value.
- Type:
- number
get2D() → {object}
Get the 2D base of this size.
- Source
The 2D base [0,1] as {x,y}.
- Type:
- object
getDimSize(dimension, start) → {number}
Get the size of a given dimension.
Name | Type | Description |
---|---|---|
dimension | number | The dimension. |
start | number | Optional start dimension to start counting from. |
- Source
The size.
- Type:
- number
getTotalSize(start) → {number}
Get the total size.
Name | Type | Description |
---|---|---|
start | number | Optional start dimension to base the offset on. |
- Source
The total size.
- Type:
- number
getValues() → {Array}
Get the values of this index.
- Source
The array of values.
- Type:
- Array
indexToOffset(index, start) → {number}
Convert an index to an offset in memory.
Name | Type | Description |
---|---|---|
index | dwv. | The index to convert. |
start | number | Optional start dimension to base the offset on. |
- Source
The offset.
- Type:
- number
isInBounds(index, dirs) → {boolean}
Check that an index is within bounds.
Name | Type | Description |
---|---|---|
index | dwv. | The index to check. |
dirs | Array | Optional list of directions to check. |
- Source
True if the given coordinates are within bounds.
- Type:
- boolean
length() → {number}
Get the length of the index.
- Source
The length.
- Type:
- number
moreThanOne(dimension) → {boolean}
Check if a dimension exists and has more than one element.
Name | Type | Description |
---|---|---|
dimension | number | The dimension to check. |
- Source
True if the size is more than one.
- Type:
- boolean
offsetToIndex(offset) → {dwv.math.Index}
Convert an offset in memory to an index.
Name | Type | Description |
---|---|---|
offset | number | The offset to convert. |
- Source
The index.
- Type:
- dwv.
math. Index
toString() → {string}
Get a string representation of the size.
- Source
The Size as a string.
- Type:
- string