Constructor
new GratingStim(options)
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Extends
- VisualStim
Methods
(protected) _estimateBoundingBox()
- Source:
Estimate the bounding box.
(protected) _getDisplaySize() → {Array.<number>}
- Source:
Get the size of the display image, which is either that of the GratingStim or that of the image it contains.
Returns:
the size of the displayed image
- Type
- Array.<number>
(protected) _getPixiMeshFromPredefinedShaders(shaderName, uniforms) → {Pixi.Mesh}
- Source:
Generate PIXI.Mesh object based on provided shader function name and uniforms.
Parameters:
Name | Type | Description |
---|---|---|
shaderName |
String | name of the shader. Must be one of the SHADERS |
uniforms |
Object | a set of uniforms to supply to the shader. Mixed together with default uniform values. |
Returns:
Pixi.Mesh object that represents shader and later added to the scene.
- Type
- Pixi.Mesh
(protected) _updateIfNeeded()
- Source:
Update the stimulus, if necessary.
setBlendmode(blendMode, logopt)
- Source:
Set blend mode of the grating stimulus.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
blendMode |
String |
avg
|
blend mode, can be one of the following: ["avg", "add", "mul", "screen"]. |
|
log |
boolean |
<optional> |
false
|
whether or not to log |
setColor(colorVal, logopt)
- Source:
Set foreground color value for the grating stimulus.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
colorVal |
Color |
white
|
color value, can be String like "red" or "#ff0000" or Number like 0xff0000. |
|
log |
boolean |
<optional> |
false
|
whether of not to log |
setColorSpace(colorSpaceVal, logopt)
- Source:
Set color space value for the grating stimulus.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
colorSpaceVal |
String |
RGB
|
color space value |
|
log |
boolean |
<optional> |
false
|
whether of not to log |
setInterpolate(interpolate, logopt)
- Source:
Whether to interpolate (linearly) the texture in the stimulus.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
interpolate |
boolean |
false
|
interpolate or not. |
|
log |
boolean |
<optional> |
false
|
whether or not to log |
setMask(mask, logopt)
- Source:
Setter for the mask attribute.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mask |
HTMLImageElement | string | the name of the mask resource or HTMLImageElement corresponding to the mask |
||
log |
boolean |
<optional> |
false
|
whether of not to log |
setOpacity(opacityopt, logopt)
- Source:
Determines how visible the stimulus is relative to background.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
opacity |
number |
<optional> |
1
|
opacity - The value should be a single float ranging 1.0 (opaque) to 0.0 (transparent). |
log |
boolean |
<optional> |
false
|
whether of not to log |
setPhase(phase, logopt)
- Source:
Set phase value for the function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
phase |
number | phase value |
||
log |
boolean |
<optional> |
false
|
whether of not to log |
setSF(sf, logopt)
- Source:
Set spatial frequency value for the function.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
sf |
number | spatial frequency value |
||
log |
boolean |
<optional> |
false
|
whether or not to log |
setTex(tex, logopt)
- Source:
Setter for the tex attribute.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tex |
HTMLImageElement | string | the name of built in shader function or name of the image resource or HTMLImageElement corresponding to the image |
||
log |
boolean |
<optional> |
false
|
whether of not to log |