Legacy example · C++ · Version 1.0.0
Holoviz sRGB
| Authors | Holoscan Team (NVIDIA) |
|---|---|
| Supported platforms | x86_64, aarch64 |
| Language | C++ |
| Version | 1.0.0 |
| Compatibility | HSDK 2.3 |
| Contribution level | Level 1 · Very high-quality code |
| Source | HoloHub |
Legacy HoloHub application
This application comes from HoloHub and was last tested with Holoscan SDK (HSDK) 2.3. It runs with the HoloHub CLI, ./holohub.
This application demonstrates the handling of the sRGB color space supported by the Holoviz operator.
The Holoviz operator can convert sRGB input images to linear color space before rendering and also can convert from linear color space to sRGB before writing to the frame buffer.
sRGB color space can be enabled for input images and for the frame buffer independently. By default, the sRGB color space is disabled for both.
By default, the Holoviz operator is auto detecting the input image format. Auto detection always assumes linear color space for input images. To change this to sRGB color space explicitly set the image_format_ member of the input spec for that input image to a format ending with SRGB:
// By default the image format is auto detected. Auto detection assumes linear color space,
// but we provide an sRGB encoded image. Create an input spec and change the image format to
// sRGB.
ops::HolovizOp::InputSpec input_spec("image", ops::HolovizOp::InputType::COLOR);
input_spec.image_format_ = ops::HolovizOp::ImageFormat::R8G8B8_SRGB;
auto holoviz = make_operator<ops::HolovizOp>(
"holoviz",
Arg("tensors", std::vector<ops::HolovizOp::InputSpec>{input_spec}));
By default, the frame buffer is using linear color space. To use the sRGB color space, set the framebuffer_srbg argument of the Holoviz operator to true:
auto holoviz = make_operator<ops::HolovizOp>(
"holoviz",
// enable the sRGB frame buffer
Arg("framebuffer_srbg", true));
Run Instructions
To build and start the application:
./holohub run holoviz_srgb