yapocis.lib.graphics4
¶
Low level wrappers around the OpenCL graphics kernels.
Module Contents¶
Functions¶
|
|
|
|
|
|
|
Compute the information for compositing a set of distinct blocks |
|
Compute the information for compositing a set of reusable blocks, for graphical or repeated elements. |
|
|
|
|
|
|
|
|
|
|
|
Composite blocks of pixels into target image |
|
Composite sprites into target image |
|
|
|
-
yapocis.lib.graphics4.
setup_composite
(locations, blocks)[source]¶ Compute the information for compositing a set of distinct blocks
- Parameters
coords – list of tuples composed of a location (x,y)
blocks – list of pixel blocks, one per element of coords
- Returns
list of tuples (x,y,block_width,block_height) buffer: float32 array of intensity and opacity per point (2xN) ipixels: index of start of block in buffer
- Return type
coords
-
yapocis.lib.graphics4.
setup_sprites
(locations, sprites)[source]¶ Compute the information for compositing a set of reusable blocks, for graphical or repeated elements.
- Parameters
coords – list of tuples composed of a location (isprite, x,y) where isprite is the index into sprites
sprites – list of pixel blocks, one per element of coords
alpha – list of scalar or vector of opacity
- Returns
list of tuples (x,y,block_width,block_height) buffer: float32 array of intensity and opacity per point (2xN) ipixels: index of start of block in buffer
- Return type
coords
-
yapocis.lib.graphics4.
composite
(image, locations, blocks)[source]¶ Composite blocks of pixels into target image
- Parameters
image – 2d array of pixels
coords – a tuple composed of a location (x,y)
blocks – list of pixel blocks
alpha – list of scalar or vector of opacity
Returns: None
-
yapocis.lib.graphics4.
sprites
(image, locations, sprites)[source]¶ Composite sprites into target image
- Parameters
image – 2d array of pixels
coords – a tuple composed of a location (sprite_index, x,y)
blocks – list of sprites blocks
Returns: None