vispy.testing.rendered_array_tester module

Test utilities for comparing rendered arrays with expected array results.

vispy.testing.rendered_array_tester.compare_render(orig_data: numpy.ndarray, rendered_data: numpy.ndarray, previous_render: Optional[numpy.ndarray] = None, atol: Optional[float] = 1.0)[source]

Compare an expected original array with the rendered result.

Parameters
orig_data

Expected output result array. This will be converted to an RGBA array to be compared against the rendered data.

rendered_data

Actual rendered result as an RGBA 8-bit unsigned array.

previous_render

Previous instance of a render that the current render should not be equal to.

atol

Absolute tolerance to be passed to numpy.testing.assert_allclose().

vispy.testing.rendered_array_tester.make_rgba(data_in: numpy.ndarray) numpy.ndarray[source]

Convert any array to an RGBA array.

RGBA arrays have 3 dimensions where the last represents the channels. If an Alpha channel needs to be added it will be made completely opaque.

Returns
3D RGBA unsigned 8-bit array
vispy.testing.rendered_array_tester.max_for_dtype(input_dtype: Any)[source]

Get maximum value an image array should have for a specific dtype.

This is max int for each integer type or 1.0 for floating point types.