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

local3-int tuple.

local size of the compute node.

imgShape4-int tuple.

Image shape in (depth, height, width, channels) format.

Returns

grid3-int tuple.

(X, Y, Z) grid size.

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

Load GLSL and Lua nodes into a session.

Parameters

sessionSession.

Session where the nodes will be loaded.

glslPathstr.

Path where the SPIR-V files can be found.

luaPathstd.

Path where the Lua files can be found.

lluvia.util.readRGBA(path)

Reads an image and converts it to RGBA.

Parameters

pathstr.

Image path.

Returns

RGBAnp.ndarray.

RGBA image.

lluvia.util.readSampleImage(name)

Reads a sample image packed with Lluvia.

The available images are:

  • mouse

  • koala

Parameters

namestr

The name of the image

Returns

RGBAnp.ndarray

RGBA image