lluvia.util

copyright

2018, Juan David Adarve Bermudez. See AUTHORS for more details.

license

Apache-2 license, see LICENSE for more details.

lluvia.util.calculateGridSize(local, imgShape)

Calculates the grid size of a compute node given its local size and an image parameter.

Parameters
  • local (3-int tuple.) – local size of the compute node.

  • imgShape (4-int tuple.) – Image shape in (depth, height, width, channels) format.

Returns

grid – (X, Y, Z) grid size.

Return type

3-int tuple.

lluvia.util.loadNodes(session, glslPath, luaPath)

Load GLSL and Lua nodes into a session.

Parameters
  • session (Session.) – Session where the nodes will be loaded.

  • glslPath (str.) – Path where the SPIR-V files can be found.

  • luaPath (std.) – Path where the Lua files can be found.

lluvia.util.readRGBA(path)

Reads an image and converts it to RGBA.

Parameters

path (str.) – Image path.

Returns

RGBA – RGBA image.

Return type

np.ndarray.