This mixin implements various unit-handling measurement methods.
Note: (a) this is the equivalent of PsychoPY's WindowMixin. (b) it will most probably be made obsolete by a fully-integrated unit approach.
- Source:
Methods
(protected) _getHorLengthPix(length_px) → {number}
Convert the given length from pixel units to the stimulus units
Parameters:
Name | Type | Description |
---|---|---|
length_px |
number | the length in pixel units |
- Source:
Returns:
- the length in stimulus units
- Type
- number
(protected) _getLengthPix(length) → {number}
Convert the given length from stimulus unit to pixel units.
Parameters:
Name | Type | Description |
---|---|---|
length |
number | the length in stimulus units |
- Source:
Returns:
- the length in pixel units
- Type
- number
(protected) _getLengthUnits(length_px) → {number}
Convert the given length from pixel units to the stimulus units
Parameters:
Name | Type | Description |
---|---|---|
length_px |
number | the length in pixel units |
- Source:
Returns:
- the length in stimulus units
- Type
- number
(protected) _getVerLengthPix(length_px) → {number}
Convert the given length from pixel units to the stimulus units
Parameters:
Name | Type | Description |
---|---|---|
length_px |
number | the length in pixel units |
- Source:
Returns:
- the length in stimulus units
- Type
- number
setUnits(unitsopt, logopt)
Setter for units attribute.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
units |
String |
<optional> |
this.win.units | the units |
log |
boolean |
<optional> |
false | whether or not to log |
- Source: