NVIDIA Holoscan SDK v2.4.0
Holoscan v2.4.0

Function holoscan::viz::ImageComponentMapping

void holoscan::viz::ImageComponentMapping(ComponentSwizzle r, ComponentSwizzle g, ComponentSwizzle b, ComponentSwizzle a)

Specifies how the color components of an image are mapped to the color components of the output. Output components can be set to the R, G, B or A component of the input or fixed to zero or one or just identical to the input.

Default: all output components are identical to the input components (ComponentSwizzle::IDENTITY).

This can be used display an image in color formats which are not natively supported by Holoviz. For example to display a BGRA image:

Copy
Copied!
            

ImageComponentMapping(ComponentSwizzle::B, ComponentSwizzle::G, ComponentSwizzle::R, ComponentSwizzle::A); ImageHost(width, height, ImageFormat::R8G8B8A8_UNORM, bgra_data);

or to display a single component image in gray scale:

Copy
Copied!
            

ImageComponentMapping(ComponentSwizzle::R, ComponentSwizzle::R, ComponentSwizzle::R, ComponentSwizzle::ONE); ImageHost(width, height, ImageFormat::R8_UNORM, single_component_data);

Parameters

r, g, b, a – sets how the component values are placed in each component of the output

Previous Function holoscan::viz::ImageChromaLocation
Next Function holoscan::viz::ImageCudaArray
© Copyright 2022-2024, NVIDIA. Last updated on Oct 1, 2024.