colour_visuals.VisualRGBScatter3D#

class colour_visuals.VisualRGBScatter3D(RGB: ArrayLike, colourspace: RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str] = 'sRGB', model: LiteralColourspaceModel | str = 'CIE xyY', colours: ArrayLike | None = None, opacity: float = 1, size: float = 2)[source]#

Bases: Points

Create a 3D RGB scatter visual.

Parameters:
  • RGB (ArrayLike) – RGB colourspace array.

  • colourspace (RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str]) – RGB colourspace of the RGB array. colourspace can be of any type or form supported by the colour.plotting.common.filter_RGB_colourspaces() definition.

  • model (LiteralColourspaceModel | str) – Colourspace model, see colour.COLOURSPACE_MODELS attribute for the list of supported colourspace models.

  • colours (ArrayLike | None) – Colours of the visual, if None, the colours are computed from the visual geometry.

  • opacity (float) – Opacity of the visual.

  • size (float) – Size of the visual points

Examples

>>> import os
>>> import pylinalg as la
>>> from colour.utilities import suppress_stdout
>>> from wgpu.gui.auto import WgpuCanvas
>>> with suppress_stdout():
...     canvas = WgpuCanvas(size=(960, 540))
...     scene = gfx.Scene()
...     scene.add(
...         gfx.Background(
...             None, gfx.BackgroundMaterial(np.array([0.18, 0.18, 0.18]))
...         )
...     )
...     visual = VisualRGBScatter3D(np.random.random([24, 32, 3]))
...     visual.local.rotation = la.quat_from_euler(
...         (-np.pi / 4, 0), order="XY"
...     )
...     camera = gfx.PerspectiveCamera(50, 16 / 9)
...     camera.show_object(visual, up=np.array([0, 0, 1]), scale=1.25)
...     scene.add(visual)
...     if os.environ.get("CI") is None:
...         gfx.show(scene, camera=camera, canvas=canvas)
...
visual-rgbscatter-3-d
__init__(RGB: ArrayLike, colourspace: RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str] = 'sRGB', model: LiteralColourspaceModel | str = 'CIE xyY', colours: ArrayLike | None = None, opacity: float = 1, size: float = 2)[source]#
Parameters:
  • RGB (ArrayLike) –

  • colourspace (RGB_Colourspace | str | Sequence[RGB_Colourspace | LiteralRGBColourspace | str]) –

  • model (LiteralColourspaceModel | str) –

  • colours (ArrayLike | None) –

  • opacity (float) –

  • size (float) –