holoscan::ops::HolovizOp

Beta
View as Markdown

Operator class for data visualization.

This high-speed viewer handles compositing, blending, and visualization of RGB or RGBA images, masks, geometric primitives, text and depth maps. The operator can auto detect the format of the input tensors acquired at the receivers port. Else the input specification can be set at creation time using the tensors parameter or at runtime when passing input specifications to the input_specs port.

Depth maps and 3D geometry are rendered in 3D and support camera movement. The camera is controlled using the mouse:

  • Orbit (LMB)
  • Pan (LMB + CTRL | MMB)
  • Dolly (LMB + SHIFT | RMB | Mouse wheel)
  • Look Around (LMB + ALT | LMB + CTRL + SHIFT)
  • Zoom (Mouse wheel + SHIFT) Or by providing new values at the camera_eye_input, camera_look_at_input or camera_up_input input ports. The camera pose can be output at the camera_pose_output port when enable_camera_pose_output is set to true.

Callbacks can be used to receive updates on key presses, mouse position and buttons, and window size.

==Named Inputs==

  • receivers : multi-receiver accepting nvidia::gxf::Tensor and/or nvidia::gxf::VideoBuffer Any number of upstream ports may be connected to this receivers port. This port can accept either VideoBuffers or Tensors. These inputs can be in either host or device memory. Each tensor or video buffer will result in a layer. The operator autodetects the layer type for certain input types (e.g. a video buffer will result in an image layer). For other input types or more complex use cases, input specifications can be provided either at initialization time as a parameter or dynamically at run time (via input_specs). On each call to compute, tensors corresponding to all names specified in the tensors parameter must be found or an exception will be raised. Any extra, named tensors not present in the tensors parameter specification (or optional, dynamic input_specs input) will be ignored.
    • Any number of upstream ports may be connected to this receivers port. This port can accept either VideoBuffers or Tensors. These inputs can be in either host or device memory. Each tensor or video buffer will result in a layer. The operator autodetects the layer type for certain input types (e.g. a video buffer will result in an image layer). For other input types or more complex use cases, input specifications can be provided either at initialization time as a parameter or dynamically at run time (via input_specs). On each call to compute, tensors corresponding to all names specified in the tensors parameter must be found or an exception will be raised. Any extra, named tensors not present in the tensors parameter specification (or optional, dynamic input_specs input) will be ignored.
  • input_specs : std::vector<holoscan::ops::HolovizOp::InputSpec> (optional) A list of InputSpec objects. This port can be used to dynamically update the overlay specification at run time. No inputs are required on this port in order for the operator to compute.
    • A list of InputSpec objects. This port can be used to dynamically update the overlay specification at run time. No inputs are required on this port in order for the operator to compute.
  • render_buffer_input : nvidia::gxf::VideoBuffer (optional) An empty render buffer can optionally be provided. The video buffer must have format GXF_VIDEO_FORMAT_RGBA and be in device memory. This input port only exists if enable_render_buffer_input was set to true, in which case compute will only be called when a message arrives on this input.
    • An empty render buffer can optionally be provided. The video buffer must have format GXF_VIDEO_FORMAT_RGBA and be in device memory. This input port only exists if enable_render_buffer_input was set to true, in which case compute will only be called when a message arrives on this input.
  • depth_buffer_input : nvidia::gxf::VideoBuffer (optional) An empty depth buffer can optionally be provided. The video buffer must have format GXF_VIDEO_FORMAT_D32F and be in device memory. This input port only exists if enable_depth_buffer_input was set to true, in which case compute will only be called when a message arrives on this input.
    • An empty depth buffer can optionally be provided. The video buffer must have format GXF_VIDEO_FORMAT_D32F and be in device memory. This input port only exists if enable_depth_buffer_input was set to true, in which case compute will only be called when a message arrives on this input.
  • camera_eye_input : std::array<float, 3> (optional) Camera eye position. The camera is animated to reach the new position.
    • Camera eye position. The camera is animated to reach the new position.
  • camera_look_at_input : std::array<float, 3> (optional) Camera look at position. The camera is animated to reach the new position.
    • Camera look at position. The camera is animated to reach the new position.
  • camera_up_input : : std::array<float, 3> (optional) Camera up vector. The camera is animated to reach the new vector.
    • Camera up vector. The camera is animated to reach the new vector.

==Named Outputs==

  • render_buffer_output : nvidia::gxf::VideoBuffer (optional) Output for a filled render buffer. If an input render buffer is specified, it is using that one, else it allocates a new buffer. The video buffer will have format GXF_VIDEO_FORMAT_RGBA and will be in device memory. This output is useful for offline rendering or headless mode. This output port only exists if enable_render_buffer_output was set to true.
    • Output for a filled render buffer. If an input render buffer is specified, it is using that one, else it allocates a new buffer. The video buffer will have format GXF_VIDEO_FORMAT_RGBA and will be in device memory. This output is useful for offline rendering or headless mode. This output port only exists if enable_render_buffer_output was set to true.
  • depth_buffer_output : nvidia::gxf::VideoBuffer (optional) Output for a filled depth buffer. If an input depth buffer is specified, it is using that one, else it allocates a new buffer. The video buffer will have format GXF_VIDEO_FORMAT_D32F and will be in device memory. This output is useful for offline rendering or headless mode. This output port only exists if enable_depth_buffer_output was set to true.
    • Output for a filled depth buffer. If an input depth buffer is specified, it is using that one, else it allocates a new buffer. The video buffer will have format GXF_VIDEO_FORMAT_D32F and will be in device memory. This output is useful for offline rendering or headless mode. This output port only exists if enable_depth_buffer_output was set to true.
  • camera_pose_output : std::array<float, 16> or nvidia::gxf::Pose3D (optional) Output the camera pose. Depending on the value of camera_pose_output_type this outputs a 4x4 row major projection matrix (type std::array<float, 16>) or the camera extrinsics model (type nvidia::gxf::Pose3D). This output port only exists if enable_camera_pose_output was set to True.
    • Output the camera pose. Depending on the value of camera_pose_output_type this outputs a 4x4 row major projection matrix (type std::array<float, 16>) or the camera extrinsics model (type nvidia::gxf::Pose3D). This output port only exists if enable_camera_pose_output was set to True.

==Parameters==

  • receivers: List of input queues to component accepting gxf::Tensor or gxf::VideoBuffer. type: std::vector<gxf::Handle<gxf::Receiver>>
    • type: std::vector<gxf::Handle<gxf::Receiver>>
  • enable_render_buffer_input: Enable render_buffer_input (default: false) type: bool
    • type: bool
  • enable_render_buffer_output: Enable render_buffer_output (default: false) type: bool
    • type: bool
  • enable_depth_buffer_input: Enable depth_buffer_input (default: false) type: bool
    • type: bool
  • enable_depth_buffer_output: Enable depth_buffer_output (default: false) type: bool
    • type: bool
  • enable_camera_pose_output: Enable camera_pose_output (default: false) type: bool
    • type: bool
  • tensors: List of input tensor specifications (default: []) type: std::vector<InputSpec> name: name of the tensor containing the input data to display type: std::string

type: input type (default “unknown”) type: std::string possible values: unknown: unknown type, the operator tries to guess the type by inspecting the tensor. color: RGB or RGBA color 2d image. color_lut: single channel 2d image, color is looked up. points: point primitives, one coordinate (x, y) per primitive. lines: line primitives, two coordinates (x0, y0) and (x1, y1) per primitive. line_strip: line strip primitive, a line primitive i is defined by each coordinate (xi, yi) and the following (xi+1, yi+1). triangles: triangle primitive, three coordinates (x0, y0), (x1, y1) and (x2, y2) per primitive. crosses: cross primitive, a cross is defined by the center coordinate and the size (xi, yi, si). rectangles: axis aligned rectangle primitive, each rectangle is defined by two coordinates (xi, yi) and (xi+1, yi+1). ovals: oval primitive, an oval primitive is defined by the center coordinate and the axis sizes (xi, yi, sxi, syi). text: text is defined by the top left coordinate and the size (x, y, s) per string, text strings are defined by InputSpec member text. depth_map: single channel 2d array where each element represents a depth value. The data is rendered as a 3d object using points, lines or triangles. The color for the elements can be specified through depth_map_color. Supported formats for the depth map: 8-bit unsigned normalized format that has a single 8-bit depth component 32-bit signed float format that has a single 32-bit depth component

depth_map_color: RGBA 2d image, same size as the depth map. One color value for each element of the depth map grid. Supported format: 32-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3.

opacity: layer opacity, 1.0 is fully opaque, 0.0 is fully transparent (default: 1.0) type: float

priority: layer priority, determines the render order, layers with higher priority values are rendered on top of layers with lower priority values (default: 0) type: int32_t

image_format: color image format, used if type is color, color_lut or depth_map_color. (default: auto_detect). type: std::string

color: RGBA color of rendered geometry (default: [1.F, 1.F, 1.F, 1.F]) type: std::vector<float>

line_width: line width for geometry made of lines (default: 1.0) type: float

point_size: point size for geometry made of points (default: 1.0) type: float

text: array of text strings, used when type is text. (default: []) type: std::vector<std::string>

depth_map_render_mode: depth map render mode (default: points) type: std::string possible values: points: render as points lines: render as lines triangles: render as triangles

  • type: std::vector<InputSpec> name: name of the tensor containing the input data to display type: std::string

type: input type (default “unknown”) type: std::string possible values: unknown: unknown type, the operator tries to guess the type by inspecting the tensor. color: RGB or RGBA color 2d image. color_lut: single channel 2d image, color is looked up. points: point primitives, one coordinate (x, y) per primitive. lines: line primitives, two coordinates (x0, y0) and (x1, y1) per primitive. line_strip: line strip primitive, a line primitive i is defined by each coordinate (xi, yi) and the following (xi+1, yi+1). triangles: triangle primitive, three coordinates (x0, y0), (x1, y1) and (x2, y2) per primitive. crosses: cross primitive, a cross is defined by the center coordinate and the size (xi, yi, si). rectangles: axis aligned rectangle primitive, each rectangle is defined by two coordinates (xi, yi) and (xi+1, yi+1). ovals: oval primitive, an oval primitive is defined by the center coordinate and the axis sizes (xi, yi, sxi, syi). text: text is defined by the top left coordinate and the size (x, y, s) per string, text strings are defined by InputSpec member text. depth_map: single channel 2d array where each element represents a depth value. The data is rendered as a 3d object using points, lines or triangles. The color for the elements can be specified through depth_map_color. Supported formats for the depth map: 8-bit unsigned normalized format that has a single 8-bit depth component 32-bit signed float format that has a single 32-bit depth component

depth_map_color: RGBA 2d image, same size as the depth map. One color value for each element of the depth map grid. Supported format: 32-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3.

opacity: layer opacity, 1.0 is fully opaque, 0.0 is fully transparent (default: 1.0) type: float

priority: layer priority, determines the render order, layers with higher priority values are rendered on top of layers with lower priority values (default: 0) type: int32_t

image_format: color image format, used if type is color, color_lut or depth_map_color. (default: auto_detect). type: std::string

color: RGBA color of rendered geometry (default: [1.F, 1.F, 1.F, 1.F]) type: std::vector<float>

line_width: line width for geometry made of lines (default: 1.0) type: float

point_size: point size for geometry made of points (default: 1.0) type: float

text: array of text strings, used when type is text. (default: []) type: std::vector<std::string>

depth_map_render_mode: depth map render mode (default: points) type: std::string possible values: points: render as points lines: render as lines triangles: render as triangles

  • name: name of the tensor containing the input data to display type: std::string

    • type: std::string
  • type: input type (default "unknown") type: std::string possible values: unknown: unknown type, the operator tries to guess the type by inspecting the tensor. color: RGB or RGBA color 2d image. color_lut: single channel 2d image, color is looked up. points: point primitives, one coordinate (x, y) per primitive. lines: line primitives, two coordinates (x0, y0) and (x1, y1) per primitive. line_strip: line strip primitive, a line primitive i is defined by each coordinate (xi, yi) and the following (xi+1, yi+1). triangles: triangle primitive, three coordinates (x0, y0), (x1, y1) and (x2, y2) per primitive. crosses: cross primitive, a cross is defined by the center coordinate and the size (xi, yi, si). rectangles: axis aligned rectangle primitive, each rectangle is defined by two coordinates (xi, yi) and (xi+1, yi+1). ovals: oval primitive, an oval primitive is defined by the center coordinate and the axis sizes (xi, yi, sxi, syi). text: text is defined by the top left coordinate and the size (x, y, s) per string, text strings are defined by InputSpec member text. depth_map: single channel 2d array where each element represents a depth value. The data is rendered as a 3d object using points, lines or triangles. The color for the elements can be specified through depth_map_color. Supported formats for the depth map: 8-bit unsigned normalized format that has a single 8-bit depth component 32-bit signed float format that has a single 32-bit depth component

depth_map_color: RGBA 2d image, same size as the depth map. One color value for each element of the depth map grid. Supported format: 32-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3.

  • type: std::string

  • possible values: unknown: unknown type, the operator tries to guess the type by inspecting the tensor. color: RGB or RGBA color 2d image. color_lut: single channel 2d image, color is looked up. points: point primitives, one coordinate (x, y) per primitive. lines: line primitives, two coordinates (x0, y0) and (x1, y1) per primitive. line_strip: line strip primitive, a line primitive i is defined by each coordinate (xi, yi) and the following (xi+1, yi+1). triangles: triangle primitive, three coordinates (x0, y0), (x1, y1) and (x2, y2) per primitive. crosses: cross primitive, a cross is defined by the center coordinate and the size (xi, yi, si). rectangles: axis aligned rectangle primitive, each rectangle is defined by two coordinates (xi, yi) and (xi+1, yi+1). ovals: oval primitive, an oval primitive is defined by the center coordinate and the axis sizes (xi, yi, sxi, syi). text: text is defined by the top left coordinate and the size (x, y, s) per string, text strings are defined by InputSpec member text. depth_map: single channel 2d array where each element represents a depth value. The data is rendered as a 3d object using points, lines or triangles. The color for the elements can be specified through depth_map_color. Supported formats for the depth map: 8-bit unsigned normalized format that has a single 8-bit depth component 32-bit signed float format that has a single 32-bit depth component

depth_map_color: RGBA 2d image, same size as the depth map. One color value for each element of the depth map grid. Supported format: 32-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3.

  • unknown: unknown type, the operator tries to guess the type by inspecting the tensor.
  • color: RGB or RGBA color 2d image.
  • color_lut: single channel 2d image, color is looked up.
  • points: point primitives, one coordinate (x, y) per primitive.
  • lines: line primitives, two coordinates (x0, y0) and (x1, y1) per primitive.
  • line_strip: line strip primitive, a line primitive i is defined by each coordinate (xi, yi) and the following (xi+1, yi+1).
  • triangles: triangle primitive, three coordinates (x0, y0), (x1, y1) and (x2, y2) per primitive.
  • crosses: cross primitive, a cross is defined by the center coordinate and the size (xi, yi, si).
  • rectangles: axis aligned rectangle primitive, each rectangle is defined by two coordinates (xi, yi) and (xi+1, yi+1).
  • ovals: oval primitive, an oval primitive is defined by the center coordinate and the axis sizes (xi, yi, sxi, syi).
  • text: text is defined by the top left coordinate and the size (x, y, s) per string, text strings are defined by InputSpec member text.
  • depth_map: single channel 2d array where each element represents a depth value. The data is rendered as a 3d object using points, lines or triangles. The color for the elements can be specified through depth_map_color. Supported formats for the depth map: 8-bit unsigned normalized format that has a single 8-bit depth component 32-bit signed float format that has a single 32-bit depth component
    • 8-bit unsigned normalized format that has a single 8-bit depth component
    • 32-bit signed float format that has a single 32-bit depth component
  • depth_map_color: RGBA 2d image, same size as the depth map. One color value for each element of the depth map grid. Supported format: 32-bit unsigned normalized format that has an 8-bit R component in byte 0, an 8-bit G component in byte 1, an 8-bit B component in byte 2, and an 8-bit A component in byte 3.
  • opacity: layer opacity, 1.0 is fully opaque, 0.0 is fully transparent (default: 1.0) type: float
    • type: float
  • priority: layer priority, determines the render order, layers with higher priority values are rendered on top of layers with lower priority values (default: 0) type: int32_t
    • type: int32_t
  • image_format: color image format, used if type is color, color_lut or depth_map_color. (default: auto_detect). type: std::string
    • type: std::string
  • color: RGBA color of rendered geometry (default: [1.F, 1.F, 1.F, 1.F]) type: std::vector<float>
    • type: std::vector<float>
  • line_width: line width for geometry made of lines (default: 1.0) type: float
    • type: float
  • point_size: point size for geometry made of points (default: 1.0) type: float
    • type: float
  • text: array of text strings, used when type is text. (default: []) type: std::vector<std::string>
    • type: std::vector<std::string>
  • depth_map_render_mode: depth map render mode (default: points) type: std::string possible values: points: render as points lines: render as lines triangles: render as triangles
    • type: std::string
    • possible values: points: render as points lines: render as lines triangles: render as triangles
      • points: render as points
      • lines: render as lines
      • triangles: render as triangles
  • color_lut: Color lookup table for tensors of type ‘color_lut’, vector of four float RGBA values type: std::vector<std::vector<float>>
    • type: std::vector<std::vector<float>>
  • window_title: Title on window canvas (default: "Holoviz") type: std::string
    • type: std::string
  • display_name: In exclusive display or fullscreen mode, name of display to use as shown with xrandr or hwinfo --monitor (default: "") type: std::string
    • type: std::string
  • width: Window width or display resolution width if in exclusive display or fullscreen mode (default: 1920) type: uint32_t
    • type: uint32_t
  • height: Window height or display resolution height if in exclusive display or fullscreen mode (default: 1080) type: uint32_t
    • type: uint32_t
  • framerate: Display framerate if in exclusive display mode (default: 60) type: uint32_t
    • type: uint32_t
  • use_exclusive_display: Enable exclusive display mode (default: false) type: bool
    • type: bool
  • fullscreen: Enable fullscreen window (default: false) type: bool
    • type: bool
  • headless: Enable headless mode. No window is opened, the render buffer can be output to render_buffer_output and/or depth_buffer_output if enabled. (default: false) type: bool
    • type: bool
  • framebuffer_srgb: Enable sRGB framebuffer. If set to true, the operator will use an sRGB framebuffer for rendering. If set to false, the operator will use a linear framebuffer. (default: false) type: bool
    • type: bool
  • vsync: Enable vertical sync. If set to true the operator waits for the next vertical blanking period of the display to update the current image. (default: false) type: bool
    • type: bool
  • display_color_space: Set the display color space. Supported color spaces depend on the display setup. ‘ColorSpace::SRGB_NONLINEAR’ is always supported. In headless mode, only ‘ColorSpace::PASS_THROUGH’ is supported since there is no display. For other color spaces the display needs to be configured for HDR (default: ColorSpace::AUTO) type: std::string
    • type: std::string
  • window_close_condition.: BooleanCondition on the operator that will cause it to stop executing if the display window is closed. By default, this condition is created automatically during HolovizOp::initialize. The user may want to provide it if, for example there are multiple HolovizOp operators and you want to share the same window close condition across both. By sharing the same condition, if one of the display windows is closed it would also close the other(s).
  • window_close_scheduling_term: This is a deprecated parameter name for window_close_condition. Please use window_close_condition instead as window_close_scheduling_term will be removed in a future release. type: gxf::Handle<gxf::BooleanSchedulingTerm>
    • type: gxf::Handle<gxf::BooleanSchedulingTerm>
  • allocator: Allocator used to allocate memory for render_buffer_output and depth_buffer_output type: gxf::Handle<gxf::Allocator>
    • type: gxf::Handle<gxf::Allocator>
  • font_path: File path for the font used for rendering text (default: "") type: std::string
    • type: std::string
  • cuda_stream_pool: Instance of gxf::CudaStreamPool type: gxf::Handle<gxf::CudaStreamPool>
    • type: gxf::Handle<gxf::CudaStreamPool>
  • camera_pose_output_type: Type of data output at camera_pose_output. Supported values are projection_matrix and extrinsics_model. Default value is projection_matrix. type: std::string
    • type: std::string
  • camera_eye: Initial camera eye position. type: std::array<float, 3>
    • type: std::array<float, 3>
  • camera_look_at: Initial camera look at position. type: std::array<float, 3>
    • type: std::array<float, 3>
  • camera_up: Initial camera up vector. type: std::array<float, 3>
    • type: std::array<float, 3>
  • key_callback: The callback function is called when a key is pressed, released or repeated. type: KeyCallbackFunction
    • type: KeyCallbackFunction
  • unicode_char_callback: The callback function is called when a Unicode character is input. type: UnicodeCharCallbackFunction
    • type: UnicodeCharCallbackFunction
  • mouse_button_callback: The callback function is called when a mouse button is pressed or released. type: MouseButtonCallbackFunction
    • type: MouseButtonCallbackFunction
  • scroll_callback: The callback function is called when a scrolling device is used, such as a mouse scroll wheel or the scroll area of a touch pad. type: ScrollCallbackFunction
    • type: ScrollCallbackFunction
  • cursor_pos_callback: The callback function is called when the cursor position changes. Coordinates are provided in screen coordinates, relative to the upper left edge of the content area. type: CursorPosCallbackFunction
    • type: CursorPosCallbackFunction
  • framebuffer_size_callback: The callback function is called when the framebuffer is resized. type: FramebufferSizeCallbackFunction
    • type: FramebufferSizeCallbackFunction
  • window_size_callback: The callback function is called when the window is resized. type: WindowSizeCallbackFunction
    • type: WindowSizeCallbackFunction
  • window_close_callback: The callback function is called when the window is closed. type: WindowCloseCallbackFunction
    • type: WindowCloseCallbackFunction
  • interrupt_app_on_window_close: When false (default): on window close, the operator is placed in a NEVER state and the fragment will shutdown once deadlock is detected by the scheduler. If true, the local fragment executor is explicitly interrupted when the window is closed causing immediate shutdown. If window_close_callback is set, the execution interrupt occurs after that callback returns. This option is ignored for distributed applications. If true, interrupts the local fragment executor when the window is closed after window_close_callback completes. This is useful for prompt shutdown in single-fragment event-driven applications where background transport activity could otherwise keep the scheduler alive after the Holoviz operator itself enters NEVER. Ignored for distributed applications. (default: false) type: bool
    • type: bool
  • layer_callback: The callback function is called when HolovizOp processed all layers defined by the input specification. It can be used to add extra layers. type: LayerCallbackFunction
    • type: LayerCallbackFunction

==Device Memory Requirements==

If render_buffer_input or depth_buffer_input is enabled, the provided buffer is used and no memory block will be allocated. Otherwise, when using this operator with a BlockMemoryPool, a single device memory block is needed (storage_type = 1). The size of this memory block can be determined by rounding the width and height up to the nearest even size and then padding the rows as needed so that the row stride is a multiple of 256 bytes. C++ code to calculate the block size is as follows:

==Notes==

  1. Displaying Color Images Image data can either be on host or device (GPU). Multiple image formats are supported R 8 bit unsigned R 16 bit unsigned R 16 bit float R 32 bit unsigned R 32 bit float RGB 8 bit unsigned BGR 8 bit unsigned RGBA 8 bit unsigned BGRA 8 bit unsigned RGBA 16 bit unsigned RGBA 16 bit float RGBA 32 bit float
    • R 8 bit unsigned
    • R 16 bit unsigned
    • R 16 bit float
    • R 32 bit unsigned
    • R 32 bit float
    • RGB 8 bit unsigned
    • BGR 8 bit unsigned
    • RGBA 8 bit unsigned
    • BGRA 8 bit unsigned
    • RGBA 16 bit unsigned
    • RGBA 16 bit float
    • RGBA 32 bit float When the type parameter is set to color_lut the final color is looked up using the values from the color_lut parameter. For color lookups these image formats are supported R 8 bit unsigned R 16 bit unsigned R 32 bit unsigned
    • R 8 bit unsigned
    • R 16 bit unsigned
    • R 32 bit unsigned
  2. Drawing Geometry In all cases, x and y are normalized coordinates in the range [0, 1]. The x and y correspond to the horizontal and vertical axes of the display, respectively. The origin (0, 0) is at the top left of the display. Geometric primitives outside of the visible area are clipped. Coordinate arrays are expected to have the shape (N, C) where N is the coordinate count and C is the component count for each coordinate. Points are defined by a (x, y) coordinate pair. Lines are defined by a set of two (x, y) coordinate pairs. Lines strips are defined by a sequence of (x, y) coordinate pairs. The first two coordinates define the first line, each additional coordinate adds a line connecting to the previous coordinate. Triangles are defined by a set of three (x, y) coordinate pairs. Crosses are defined by (x, y, size) tuples. size specifies the size of the cross in the x direction and is optional, if omitted it’s set to 0.05. The size in the y direction is calculated using the aspect ratio of the window to make the crosses square. Rectangles (bounding boxes) are defined by a pair of 2-tuples defining the upper-left and lower-right coordinates of a box: (x1, y1), (x2, y2). Ovals are defined by (x, y, size_x, size_y) tuples. size_x and size_y are optional, if omitted they are set to 0.05. Texts are defined by (x, y, size) tuples. size specifies the size of the text in y direction and is optional, if omitted it’s set to 0.05. The size in the x direction is calculated using the aspect ratio of the window. The index of each coordinate references a text string from the text parameter and the index is clamped to the size of the text array. For example, if there is one item set for the text parameter, e.g. text=[“my_text”] and three coordinates, then my_text is rendered three times. If text=[“first text”, “second text”] and three coordinates are specified, then first text is rendered at the first coordinate, second text at the second coordinate and then second text again at the third coordinate. The text string array is fixed and can’t be changed after initialization. To hide text which should not be displayed, specify coordinates greater than (1.0, 1.0) for the text item, the text is then clipped away. 3D Points are defined by a (x, y, z) coordinate tuple. 3D Lines are defined by a set of two (x, y, z) coordinate tuples. 3D Lines strips are defined by a sequence of (x, y, z) coordinate tuples. The first two coordinates define the first line, each additional coordinate adds a line connecting to the previous coordinate. 3D Triangles are defined by a set of three (x, y, z) coordinate tuples.
    • Points are defined by a (x, y) coordinate pair.
    • Lines are defined by a set of two (x, y) coordinate pairs.
    • Lines strips are defined by a sequence of (x, y) coordinate pairs. The first two coordinates define the first line, each additional coordinate adds a line connecting to the previous coordinate.
    • Triangles are defined by a set of three (x, y) coordinate pairs.
    • Crosses are defined by (x, y, size) tuples. size specifies the size of the cross in the x direction and is optional, if omitted it’s set to 0.05. The size in the y direction is calculated using the aspect ratio of the window to make the crosses square.
    • Rectangles (bounding boxes) are defined by a pair of 2-tuples defining the upper-left and lower-right coordinates of a box: (x1, y1), (x2, y2).
    • Ovals are defined by (x, y, size_x, size_y) tuples. size_x and size_y are optional, if omitted they are set to 0.05.
    • Texts are defined by (x, y, size) tuples. size specifies the size of the text in y direction and is optional, if omitted it’s set to 0.05. The size in the x direction is calculated using the aspect ratio of the window. The index of each coordinate references a text string from the text parameter and the index is clamped to the size of the text array. For example, if there is one item set for the text parameter, e.g. text=["my_text"] and three coordinates, then my_text is rendered three times. If text=["first text", "second text"] and three coordinates are specified, then first text is rendered at the first coordinate, second text at the second coordinate and then second text again at the third coordinate. The text string array is fixed and can’t be changed after initialization. To hide text which should not be displayed, specify coordinates greater than (1.0, 1.0) for the text item, the text is then clipped away.
    • 3D Points are defined by a (x, y, z) coordinate tuple.
    • 3D Lines are defined by a set of two (x, y, z) coordinate tuples.
    • 3D Lines strips are defined by a sequence of (x, y, z) coordinate tuples. The first two coordinates define the first line, each additional coordinate adds a line connecting to the previous coordinate.
    • 3D Triangles are defined by a set of three (x, y, z) coordinate tuples.
  3. Displaying Depth Maps When type is depth_map the provided data is interpreted as a rectangular array of depth values. Additionally a 2d array with a color value for each point in the grid can be specified by setting type to depth_map_color. The type of geometry drawn can be selected by setting depth_map_render_mode. Depth maps are rendered in 3D and support camera movement.
  4. Output By default a window is opened to display the rendering, but the extension can also be run in headless mode with the headless parameter. Using a display in exclusive mode is also supported with the use_exclusive_display parameter. This reduces the latency by avoiding the desktop compositor. The rendered framebuffer can be output to render_buffer_output or depth_buffer_output if enabled.

==Notes==

When render_buffer_output or depth_buffer_output are enabled, this operator may launch CUDA kernels that execute asynchronously on a CUDA stream. As a result, the compute method may return before all GPU work has completed. Downstream operators that receive data from this operator should either:

  • Call op_input.receive_cuda_stream(<port_name>) (after calling receive for that port) to synchronize the CUDA stream with the downstream operator’s dedicated internal stream before accessing the data.
  • Add a CudaStreamCondition to delay scheduling until upstream GPU work has completed.

For more details on CUDA stream handling in Holoscan, see: https://docs.nvidia.com/holoscan/sdk-user-guide/holoscan_cuda_stream_handling.html

#include <holoscan/ops/holoviz.hpp>

Example

#include <cstdint>
int64_t get_block_size(int32_t height, int32_t width) {
int32_t height_even = height + (height & 1);
int32_t width_even = width + (width & 1);
int64_t row_bytes = width_even * 4; // 4 bytes per pixel for 8-bit RGBA or 32-bit depth
int64_t row_stride = (row_bytes % 256 == 0) ? row_bytes : ((row_bytes / 256 + 1) * 256);
return height_even * row_stride;
}

Inherits from: holoscan::Operator (public)


Constructors

HolovizOp

holoscan::ops::HolovizOp::HolovizOp() = default

Destructor

~HolovizOp

holoscan::ops::HolovizOp::~HolovizOp() override

Methods

setup

void holoscan::ops::HolovizOp::setup(
OperatorSpec &spec
) override

Define the operator specification.

Parameters

spec
OperatorSpec &

The reference to the operator specification.

initialize

void holoscan::ops::HolovizOp::initialize() override

Initialize the component.

This method is called only once when the component is created for the first time, and use of light-weight initialization.

start

void holoscan::ops::HolovizOp::start() override

Implement the startup logic of the operator.

This method is called multiple times over the lifecycle of the operator according to the order defined in the lifecycle, and used for heavy initialization tasks such as allocating memory resources.

compute

void holoscan::ops::HolovizOp::compute(
InputContext &op_input,
OutputContext &op_output,
ExecutionContext &context
) override

Implement the compute method.

This method is called by the runtime multiple times. The runtime calls this method until the operator is stopped.

Parameters

op_input
InputContext &

The input context of the operator.

op_output
OutputContext &

The output context of the operator.

context
ExecutionContext &

The execution context of the operator.

stop

void holoscan::ops::HolovizOp::stop() override

Implement the shutdown logic of the operator.

This method is called multiple times over the lifecycle of the operator according to the order defined in the lifecycle, and used for heavy deinitialization tasks such as deallocation of all resources previously assigned in start.

default_window_close_callback

void holoscan::ops::HolovizOp::default_window_close_callback()

Default window-close behavior executed by Holoviz.

This helper performs Holoviz’s built-in window-close handling. When the Holoviz window is requested to close:

  • If the application is running in a distributed configuration, this method initiates a distributed application shutdown via Application::initiate_distributed_app_shutdown().
  • Otherwise, it performs no-op (normal single-fragment shutdown proceeds via the associated window_close_condition).

This method is also exposed to Python so user-provided callbacks can easily preserve the default shutdown semantics by calling HolovizOp.default_window_close_callback() inside their custom window_close_callback.

operator_type

OperatorType holoscan::ops::HolovizOp::operator_type() const

Get the operator type.

Returns: The operator type.

id

Operator & holoscan::ops::HolovizOp::id(
int64_t id
)

Set the Operator ID.

Returns: The reference to this operator.

Parameters

id
int64_t

The ID of the operator.

name

Operator & holoscan::ops::HolovizOp::name(
const std::string &name
)

Set the name of the operator.

Returns: The reference to this operator.

Parameters

name
const std::string &

The name of the operator.

fragment

Operator & holoscan::ops::HolovizOp::fragment(
Fragment *fragment
)

Set the fragment of the operator.

Returns: The reference to this operator.

Parameters

fragment
Fragment *

The pointer to the fragment of the operator.

spec

Operator & holoscan::ops::HolovizOp::spec(
const std::shared_ptr<OperatorSpec> &spec
)

Set the operator spec.

Returns: The reference to this operator.

Parameters

spec
const std::shared_ptr<OperatorSpec> &

The operator spec.

spec_shared

std::shared_ptr<OperatorSpec> holoscan::ops::HolovizOp::spec_shared()

Get the shared pointer to the operator spec.

Returns: The shared pointer to the operator spec.

condition

template <typename ConditionT>
std::shared_ptr<ConditionT> holoscan::ops::HolovizOp::condition(
const std::string &name
)

Get a shared pointer to the Condition object.

Returns: The reference to the Condition object. If the condition does not exist, return the nullptr.

Parameters

name
const std::string &

The name of the condition.

conditions

std::unordered_map<std::string, std::shared_ptr<Condition>> & holoscan::ops::HolovizOp::conditions()

Get the conditions of the operator.

Returns: The conditions of the operator.

resource

template <typename ResourceT>
std::shared_ptr<ResourceT> holoscan::ops::HolovizOp::resource(
const std::string &name
)

Get a shared pointer to the Resource object.

Returns: The reference to the Resource object. If the resource does not exist, returns the nullptr.

Parameters

name
const std::string &

The name of the resource.

resources

std::unordered_map<std::string, std::shared_ptr<Resource>> & holoscan::ops::HolovizOp::resources()

Get the resources of the operator.

Returns: The resources of the operator.

add_arg

void holoscan::ops::HolovizOp::add_arg(
const std::shared_ptr<Condition> &arg
)

Add a condition to the operator.

Parameters

arg
const std::shared_ptr<Condition> &

The condition to add.

is_root

bool holoscan::ops::HolovizOp::is_root()

Returns whether the operator is a root operator based on its fragment’s graph.

Returns: True, if the operator is a root operator; false, otherwise

is_user_defined_root

bool holoscan::ops::HolovizOp::is_user_defined_root()

Returns whether the operator is a user-defined root operator i.e., the first operator added to the graph.

Returns: True, if the operator is a user-defined root operator; false, otherwise

is_leaf

bool holoscan::ops::HolovizOp::is_leaf()

Returns whether the operator is a leaf operator based on its fragment’s graph.

Returns: True, if the operator is a leaf operator; false, otherwise

qualified_name

std::string holoscan::ops::HolovizOp::qualified_name() const

Returns the fully qualified name of the operator including the name of the fragment.

Returns: std::string fully qualified name of the operator in the format: “<fragment_name>.<operator_name>“

to_yaml_node

YAML::Node holoscan::ops::HolovizOp::to_yaml_node() const override

Get a YAML representation of the operator.

Returns: YAML node including type, specs, conditions and resources of the operator in addition to the base component properties.

graph_entity

std::shared_ptr<nvidia::gxf::GraphEntity> holoscan::ops::HolovizOp::graph_entity()

Get the GXF GraphEntity object corresponding to this operator.

Returns: graph entity corresponding to the operator

get_data_flow_tracking_label

MessageLabel holoscan::ops::HolovizOp::get_data_flow_tracking_label(
const std::string &input_port_name
)

Get the current message label for a given input port.

This method retrieves the MessageLabel associated with data received on the specified input port. The MessageLabel contains timing and path information for data flow tracking.

This method should ideally be called after receiving data on the input port.

If the input_port_name is invalid (not found in the operator’s input ports), an error is logged and an empty MessageLabel is returned.

Returns: MessageLabel The current message label for the input port. Returns an empty MessageLabel if the port does not have a message label or if the port does not exist (logs an error in the latter case as well).

Throws: std::runtime_error If the operator backend is not GXF-compatible.

Throws: std::runtime_error If fragment is not set.

Throws: std::runtime_error If operator spec is not set.

Throws: std::runtime_error If fragment flow tracking is not enabled.

Parameters

input_port_name
const std::string &

The name of the input port.

metadata

std::shared_ptr<MetadataDictionary> holoscan::ops::HolovizOp::metadata()

Get a shared pointer to the dynamic metadata of this operator.

Note: currently this metadata dictionary is only active if explicitly enabled for the application by setting Fragment::is_metadata_enabled(true). When metadata is disabled the dictionary will not be populated by receive calls and will not be emitted on emit calls.

This metadata dictionary is always empty at the start of each compute call. It is populated by metadata received on input ports during InputContext::receive() calls and can be modified as desired by the operator during the compute call. Any metadata corresponding to this object will be sent on the output ports by any OutputContext::emit() calls.

Returns: The metadata dictionary for this operator.

is_metadata_enabled

bool holoscan::ops::HolovizOp::is_metadata_enabled() const

Determine if metadata is enabled for this operator.

Returns: Boolean indicating if metadata is enabled (returns fragment()``->``is_metadata_enabled() if enable_metadata was not explicitly called for the operator.

enable_metadata

void holoscan::ops::HolovizOp::enable_metadata(
bool enable
)

Enable or disable metadata for this operator.

If this method has not been used to explicitly enable or disable metadata, the value for is_metadata_enabled() will be determined by Fragment::is_metadata_enabled() when the operator is initialized.

Parameters

enable
bool

Boolean indicating if metadata should be enabled.

metadata_policy

void holoscan::ops::HolovizOp::metadata_policy(
MetadataPolicy policy
)

Set the metadata update policy used by this operator.

The metadata policy determines how metadata is merged across multiple receive calls:

  • MetadataPolicy::kUpdate: Update the existing value when a key already exists.
  • MetadataPolicy::kInplaceUpdate: Update the existing MetadataObject’s value in-place when a key already exists.
  • MetadataPolicy::kReject: Do not modify the existing value if a key already exists.
  • MetadataPolicy::kRaise: Raise an exception if a key already exists (default).

Parameters

policy
MetadataPolicy

The metadata update policy to be used by this operator.

receiver

std::optional<std::shared_ptr<Receiver>> holoscan::ops::HolovizOp::receiver(
const std::string &port_name
)

If no CudaStreamPool parameter or argument already exists, add a default one.

This method is available to be called by derived classes to add a default CudaStreamPool in This method is available to be called by derived classes to add a default CudaStreamPool inthe case that the user did not pass one in as an argument tomake_operator`.

This function will not add an additional CUDA stream pool if one was already passed in as an argument to make_operator (i.e. it is in resources_) or if a “cuda_stream_pool” parameter already exists in the operator spec.

/** Return the Receiver corresponding to a specific input port.

Returns: The Receiver corresponding to the input port, if it exists. Otherwise, return nullopt.

Parameters

port_name
const std::string &

The name of the input port.

transmitter

std::optional<std::shared_ptr<Transmitter>> holoscan::ops::HolovizOp::transmitter(
const std::string &port_name
)

Return the Transmitter corresponding to a specific output port.

Returns: The Transmitter corresponding to the output port, if it exists. Otherwise, return nullopt.

Parameters

port_name
const std::string &

The name of the output port.

bind_input_topic

void holoscan::ops::HolovizOp::bind_input_topic(
const std::string &port_name,
const std::string &topic,
const std::optional<nvidia::gxf::QoSProfile> &qos = std::nullopt,
bool replace_connector = false
)

Bind an input port to a Pub/Sub topic.

This is the programmatic override path for topic-mapped ports and takes precedence over any lower-priority IOSpec::topic() default configured in setup().

Parameters

port_name
const std::string &

The input port to bind.

topic
const std::string &

The topic name to subscribe to.

qos
const std::optional<nvidia::gxf::QoSProfile> &Defaults to std::nullopt

Optional QoS profile override. When nullopt, any QoS already configured on the port (e.g. in setup()) is preserved.

replace_connector
boolDefaults to false

If true, replace an explicitly non-PubSub connector on this port with a Pub/Sub connector.

bind_output_topic

void holoscan::ops::HolovizOp::bind_output_topic(
const std::string &port_name,
const std::string &topic,
const std::optional<nvidia::gxf::QoSProfile> &qos = std::nullopt,
bool replace_connector = false
)

Bind an output port to a Pub/Sub topic.

This is the programmatic override path for topic-mapped ports and takes precedence over any lower-priority IOSpec::topic() default configured in setup().

Parameters

port_name
const std::string &

The output port to bind.

topic
const std::string &

The topic name to publish to.

qos
const std::optional<nvidia::gxf::QoSProfile> &Defaults to std::nullopt

Optional QoS profile override. When nullopt, any QoS already configured on the port (e.g. in setup()) is preserved.

replace_connector
boolDefaults to false

If true, replace an explicitly non-PubSub connector on this port with a Pub/Sub connector.

input_topic

std::optional<std::string> holoscan::ops::HolovizOp::input_topic(
const std::string &port_name
) const

Get the configured topic name for an input port, if any.

output_topic

std::optional<std::string> holoscan::ops::HolovizOp::output_topic(
const std::string &port_name
) const

Get the configured topic name for an output port, if any.

input_qos

std::optional<nvidia::gxf::QoSProfile> holoscan::ops::HolovizOp::input_qos(
const std::string &port_name
) const

Get the effective QoS profile for an input port, if it is topic-mapped.

output_qos

std::optional<nvidia::gxf::QoSProfile> holoscan::ops::HolovizOp::output_qos(
const std::string &port_name
) const

Get the effective QoS profile for an output port, if it is topic-mapped.

queue_policy

void holoscan::ops::HolovizOp::queue_policy(
const std::string &port_name,
IOSpec::IOType port_type = IOSpec::IOType::kInput,
IOSpec::QueuePolicy policy = IOSpec::QueuePolicy::kFault
)

Set the queue policy to be used by an input or output port.

The following IOSpec::QueuePolicy values are supported:

  • QueuePolicy::kPop - If the queue is full, pop the oldest item, then add the new one.
  • QueuePolicy::kReject - If the queue is full, reject (discard) the new item.
  • QueuePolicy::kFault - If the queue is full, log a warning and reject the new item.

Parameters

port_name
const std::string &

The name of the port.

port_type
IOSpec::IOTypeDefaults to IOSpec::IOType::kInput

Enum flag indicating whether port_name specifies an input or output port.

policy
IOSpec::QueuePolicyDefaults to IOSpec::QueuePolicy::kFault

The queue policy to set for the port.

input_exec_spec

const std::shared_ptr<IOSpec> & holoscan::ops::HolovizOp::input_exec_spec()

output_exec_spec

const std::shared_ptr<IOSpec> & holoscan::ops::HolovizOp::output_exec_spec()

dynamic_flow_func

const std::function<void(
const std::shared_ptr<Operator> &
)

self_shared

std::shared_ptr<Operator> holoscan::ops::HolovizOp::self_shared()

next_flows

const std::vector<std::shared_ptr<FlowInfo>> & holoscan::ops::HolovizOp::next_flows()

Get the list of next flows connected to this operator.

Returns: A vector of FlowInfo objects representing the flows to downstream operators.

add_dynamic_flow

void holoscan::ops::HolovizOp::add_dynamic_flow(
const std::shared_ptr<FlowInfo> &flow
)

Add a dynamic flow from this operator to another operator using a FlowInfo object.

Parameters

flow
const std::shared_ptr<FlowInfo> &

The flow information object describing the connection between operators.

dynamic_flows

const std::shared_ptr<std::vector<std::shared_ptr<FlowInfo>>> & holoscan::ops::HolovizOp::dynamic_flows()

Get the list of dynamic flows that have been added to this operator.

Returns: A shared pointer to a vector of FlowInfo objects representing the dynamic flows.

find_flow_info

const std::shared_ptr<Operator::FlowInfo> & holoscan::ops::HolovizOp::find_flow_info(
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &predicate
)

Locate a flow info in the operator’s next flows based on a given predicate.

Returns: Shared pointer to the matching FlowInfo, or nullptr if not found.

Parameters

predicate
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &

Lambda function that takes a FlowInfo shared pointer and returns a boolean.

find_all_flow_info

std::vector<std::shared_ptr<Operator::FlowInfo>> holoscan::ops::HolovizOp::find_all_flow_info(
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &predicate
)

Find all FlowInfo objects in the operator’s next flows that match a given condition.

Returns: A vector of shared pointers to the matching FlowInfo objects.

Parameters

predicate
const std::function<bool(const std::shared_ptr<Operator::FlowInfo> &)> &

A lambda function that takes a shared pointer to a FlowInfo object and returns a boolean.

async_condition

std::shared_ptr<holoscan::AsynchronousCondition> holoscan::ops::HolovizOp::async_condition()

Get the internal asynchronous condition for the operator.

Note: This object is only accessible after the executor has called Operator::initialize() via run() or run_async(). If accessed during Application::compose(), it will return nullptr.

Returns: A shared pointer to the internal asynchronous condition.

stop_execution

void holoscan::ops::HolovizOp::stop_execution()

Stop the execution of the operator.

This method is used to stop the execution of the operator by setting the internal async condition to EVENT_NEVER state, which sets the scheduling condition to NEVER. Once stopped, the operator will not be scheduled for execution (the compute() method will not be called).

Note that executing this method does not trigger the operator’s stop() method. The stop() method is called only when the scheduler deactivates all operators together.

execution_context

virtual std::shared_ptr<holoscan::ExecutionContext> holoscan::ops::HolovizOp::execution_context() const

Get the ExecutionContext object.

Returns: The shared pointer to the ExecutionContext object.

ensure_contexts

void holoscan::ops::HolovizOp::ensure_contexts()

Ensure the contexts (input/output/execution) for the operator.

This method is called by the GXFExecutor when the operator is initialized.

release_internal_resources

virtual void holoscan::ops::HolovizOp::release_internal_resources()

Internal method to clean up operator resources and prevent circular references.

This is an internal method called automatically by the GXFWrapper during operator shutdown (in GXFWrapper::stop() method). It resets std::shared_ptr fields and std::function objects such as input_exec_spec_, output_exec_spec_, next_flows_, dynamic_flows_, and dynamic_flow_func_ to break potential circular references between connected Operator objects.

This is an internal method that should never be called directly by user code. Improper use can lead to undefined behavior.

operator

*List of restricted substrings that cannot be used in holoscan::ops::HolovizOp::operator(
e.g. GXF GraphEntity
) override

defaults

*Set the parameters based on holoscan::ops::HolovizOp::defaults(
sets GXF parameters for GXF operators
)

is_gxf_compatible_operator_type

bool holoscan::ops::HolovizOp::is_gxf_compatible_operator_type() const

Check if the operator is a GXF compatible operator type.

This checks the OperatorType and returns true if it is one of {kNative, kGXF, kVirtual}.

Returns: True if the operator is a GXF compatible operator type, false otherwise.

operator std::shared_ptr< Executor > executor

*Get the executor of the holoscan::ops::HolovizOp::operator std::shared_ptr<Executor> executor()

has_pubsub_connector

*name Connector type queries *bool holoscan::ops::HolovizOp::has_pubsub_connector()

Check if the operator has any UCX connectors.

Check if the operator has any PubSub connectors.

has_network_connector

bool holoscan::ops::HolovizOp::has_network_connector()

Check if the operator has any network (UCX or PubSub) connectors.

args

std::vector<Arg> & holoscan::ComponentBase::args()

Get the list of arguments.

Returns: The vector of arguments.

description

std::string holoscan::ComponentBase::description() const

Get a description of the component.

Returns: YAML string.

See also: to_yaml_node()

service

template <typename ServiceT = DefaultFragmentService>
std::shared_ptr<ServiceT> holoscan::ComponentBase::service(
std::string_view id = ""
) const

Retrieve a registered fragment service or resource.

Retrieves a previously registered fragment service or resource by its type and optional identifier. Returns nullptr if no service/resource is found with the specified type and identifier.

Note that any changes to the service retrieval logic in this method should be synchronized with the implementation in Fragment::service() method to maintain consistency.

Returns: The shared pointer to the service/resource, or nullptr if not found or if type casting fails.

Template parameters

ServiceT
typename

The type of the service/resource to retrieve. Must inherit from either Resource or FragmentService. Defaults to DefaultFragmentService if not specified.

Parameters

id
std::string_viewDefaults to ""

The identifier of the service/resource. If empty, retrieves by type only.

get_service_by_type_info

std::shared_ptr<FragmentService> holoscan::ComponentBase::get_service_by_type_info(
const std::type_info &service_type,
std::string_view id = ""
) const

Retrieve a registered fragment service or resource for Python bindings.

This is a helper method for Python bindings to retrieve a service by its C++ type info.

Returns: The shared pointer to the base service, or nullptr if not found.

Parameters

service_type
const std::type_info &

The type info of the service/resource to retrieve.

id
std::string_viewDefaults to ""

The identifier of the service/resource. If empty, retrieves by type only.

reset_backend_objects

virtual void holoscan::ComponentBase::reset_backend_objects()

Reset any backend-specific objects (e.g. GXF GraphEntity).

disable_via_window_close

void holoscan::ops::HolovizOp::disable_via_window_close()

initialize_graph_entity

gxf_uid_t holoscan::ops::HolovizOp::initialize_graph_entity(
void *context,
const std::string &entity_prefix = ""
)

This function creates a GraphEntity corresponding to the operator.

Returns: The GXF entity eid corresponding to the graph entity.

Parameters

context
void *

The GXF context.

entity_prefix
const std::string &Defaults to ""

Prefix to add to the operator’s name when creating the GraphEntity.

initialize_async_condition

void holoscan::ops::HolovizOp::initialize_async_condition()

Initialize the internal asynchronous condition to control the operator execution.

This method is called by the GXFExecutor when the operator is initialized.

add_codelet_to_graph_entity

virtual gxf_uid_t holoscan::ops::HolovizOp::add_codelet_to_graph_entity()

Add this operator as the codelet in the GXF GraphEntity.

Returns: The codelet component id corresponding to GXF codelet.

initialize_conditions

*Initialize conditions and add GXF conditions to graph_entity_ void holoscan::ops::HolovizOp::initialize_conditions()

initialize_resources

*Initialize resources and add GXF resources to graph_entity_ void holoscan::ops::HolovizOp::initialize_resources()

update_params_from_args

*Update parameters based on the specified arguments void holoscan::ops::HolovizOp::update_params_from_args()

update_connector_arguments

void holoscan::ops::HolovizOp::update_connector_arguments()

Replace any “receiver” supplied as a string with the actual receiver of that name.

Can only be called after GXFExecutor::create_input_port so the input ports (receivers) exist.

find_ports_used_by_condition_args

void holoscan::ops::HolovizOp::find_ports_used_by_condition_args()

Determine ports whose transmitter or receiver are associated with an Arg for a Condition.

Should be called before GXFExecutor::create_input_port or GXFExecutor::create_output_port.

get_consolidated_input_label

MessageLabel holoscan::ops::HolovizOp::get_consolidated_input_label()

This function returns a consolidated MessageLabel for all the input ports of an Operator.

If there is no input port (root Operator), then a new MessageLabel with the current Operator and default receive timestamp is returned.

Returns: The consolidated MessageLabel

update_input_message_label

void holoscan::ops::HolovizOp::update_input_message_label(
std::string input_name,
MessageLabel m
)

Update the input_message_labels map with the given MessageLabel a corresponding input_name.

Parameters

input_name
std::string

The input port name for which the MessageLabel is updated

m
MessageLabel

The new MessageLabel that will be set for the input port

delete_input_message_label

void holoscan::ops::HolovizOp::delete_input_message_label(
const std::string &input_name
)

Delete the input_message_labels map entry for the given input_name.

Parameters

input_name
const std::string &

The input port name for which the MessageLabel is deleted

reset_input_message_labels

void holoscan::ops::HolovizOp::reset_input_message_labels()

Reset the input message labels to clear all its contents.

This is done for a leaf operator when it finishes its execution as it is assumed that all its inputs are processed.

has_input_message_labels

bool holoscan::ops::HolovizOp::has_input_message_labels()

Check if the operator has any input message labels.

num_published_messages_map

std::map<std::string, uint64_t> holoscan::ops::HolovizOp::num_published_messages_map()

Get the number of published messages for each output port indexed by the output port name.

The function is utilized by the DFFTCollector to update the DataFlowTracker with the number of published messages for root operators.

Returns: The map of the number of published messages for every output name.

update_published_messages

void holoscan::ops::HolovizOp::update_published_messages(
const std::string &output_name
)

This function updates the number of published messages for a given output port.

Parameters

output_name
const std::string &

The name of the output port

operator.void initialize_next_flows

*Initialize the next flows for the holoscan::ops::HolovizOp::operator.void initialize_next_flows()

non_default_input_ports

std::vector<std::string> & holoscan::ops::HolovizOp::non_default_input_ports()

non_default_output_ports

std::vector<std::string> & holoscan::ops::HolovizOp::non_default_output_ports()

set_input_exec_spec

void holoscan::ops::HolovizOp::set_input_exec_spec(
const std::shared_ptr<IOSpec> &input_exec_spec
)

set_output_exec_spec

void holoscan::ops::HolovizOp::set_output_exec_spec(
const std::shared_ptr<IOSpec> &output_exec_spec
)

set_dynamic_flows

void holoscan::ops::HolovizOp::set_dynamic_flows(
const std::function<void(const std::shared_ptr<Operator> &)> &dynamic_flow_func
)

set_self_shared

void holoscan::ops::HolovizOp::set_self_shared(
const std::shared_ptr<Operator> &this_op
)

initialize_execution_context

virtual std::shared_ptr<ExecutionContext> holoscan::ops::HolovizOp::initialize_execution_context()

service_provider

void holoscan::ComponentBase::service_provider(
FragmentServiceProvider *provider
)

Set the service provider that owns this component.

enable_conditional_port

bool holoscan::ops::HolovizOp::enable_conditional_port(
const std::string &name,
bool set_none_condition_on_disabled = false
)

set_input_spec

void holoscan::ops::HolovizOp::set_input_spec(
const InputSpec &input_spec
)

set_input_spec_geometry

void holoscan::ops::HolovizOp::set_input_spec_geometry(
const InputSpec &input_spec
)

read_frame_buffer

void holoscan::ops::HolovizOp::read_frame_buffer(
InputContext &op_input,
OutputContext &op_output,
ExecutionContext &context,
bool buffer_input_enabled,
const std::string &buffer_name,
nvidia::gxf::VideoFormat video_format
)

render_color_image

void holoscan::ops::HolovizOp::render_color_image(
const InputSpec &input_spec,
BufferInfo &buffer_info
)

render_geometry

void holoscan::ops::HolovizOp::render_geometry(
const InputSpec &input_spec,
BufferInfo &buffer_info,
cudaStream_t stream
)

render_depth_map

void holoscan::ops::HolovizOp::render_depth_map(
InputSpec *const input_spec_depth_map,
const BufferInfo &buffer_info_depth_map,
InputSpec *const input_spec_depth_map_color,
const BufferInfo &buffer_info_depth_map_color
)

wait_for_present

bool holoscan::ops::HolovizOp::wait_for_present(
uint64_t present_id,
uint64_t timeout_ns
)

Block until either the present_id is greater than or equal to the presentation index, or timeout_ns nanoseconds passes.

The present ID is initially zero and increments after each present.

This function is thread-safe and can be called asynchronously to the operator execution.

Returns: true if the present_id is greater than or equal to the presentation index, false if timeout_ns nanoseconds passes

Parameters

present_id
uint64_t

The presentation presentId to wait for

timeout_ns
uint64_t

Timeout in nanoseconds

wait_for_first_pixel_out

bool holoscan::ops::HolovizOp::wait_for_first_pixel_out(
uint64_t timeout_ns
)

Block until either the first pixel of the next display refresh cycle leaves the display engine for the display or timeout_ns nanoseconds passes.

This function is thread-safe and can be called asynchronously to the operator execution.

Returns: true if the first pixel out event is detected, false if timeout_ns nanoseconds passes

Parameters

timeout_ns
uint64_t

Timeout in nanoseconds


Static methods

inputTypeFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::InputType> holoscan::ops::HolovizOp::inputTypeFromString(
const std::string &string
)

Convert a string to a input type enum.

Returns: input type enum

Parameters

string
const std::string &

Input type string

inputTypeToString

static std::string holoscan::ops::HolovizOp::inputTypeToString(
holoscan::ops::HolovizOp::InputType input_type
)

Convert a input type enum to a string.

Returns: input type string

Parameters

input_type
holoscan::ops::HolovizOp::InputType

Input type enum

imageFormatFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::ImageFormat> holoscan::ops::HolovizOp::imageFormatFromString(
const std::string &string
)

Convert a string to a image format enum.

Returns: image format enum

Parameters

string
const std::string &

Image format string

imageFormatToString

static std::string holoscan::ops::HolovizOp::imageFormatToString(
holoscan::ops::HolovizOp::ImageFormat image_format
)

Convert a image format enum to a string.

Returns: image format string

Parameters

image_format
holoscan::ops::HolovizOp::ImageFormat

Image format enum

depthMapRenderModeFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::DepthMapRenderMode> holoscan::ops::HolovizOp::depthMapRenderModeFromString(
const std::string &string
)

Convert a string to a depth map render mode enum.

Returns: depth map render mode enum

Parameters

string
const std::string &

Depth map render mode string

depthMapRenderModeToString

static std::string holoscan::ops::HolovizOp::depthMapRenderModeToString(
holoscan::ops::HolovizOp::DepthMapRenderMode depth_map_render_mode
)

Convert a depth map render mode enum to a string.

Returns: depth map render mode string

Parameters

depth_map_render_mode
holoscan::ops::HolovizOp::DepthMapRenderMode

Depth map render mode enum

yuvModelConversionFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::YuvModelConversion> holoscan::ops::HolovizOp::yuvModelConversionFromString(
const std::string &string
)

Convert a string to a yuv model conversion enum.

Returns: yuv model conversion enum

Parameters

string
const std::string &

Yuv model conversion string

yuvModelConversionToString

static std::string holoscan::ops::HolovizOp::yuvModelConversionToString(
holoscan::ops::HolovizOp::YuvModelConversion yuv_model_conversion
)

Convert a yuv model conversion enum to a string.

Returns: depth map render mode string

Parameters

yuv_model_conversion
holoscan::ops::HolovizOp::YuvModelConversion

Yuv model conversion enum

yuvRangeFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::YuvRange> holoscan::ops::HolovizOp::yuvRangeFromString(
const std::string &string
)

Convert a string to a yuv range enum.

Returns: yuv range enum

Parameters

string
const std::string &

Yuv range string

yuvRangeToString

static std::string holoscan::ops::HolovizOp::yuvRangeToString(
holoscan::ops::HolovizOp::YuvRange yuv_range
)

Convert a yuv range enum to a string.

Returns: yuv range string

Parameters

yuv_range
holoscan::ops::HolovizOp::YuvRange

Yuv range enum

chromaLocationFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::ChromaLocation> holoscan::ops::HolovizOp::chromaLocationFromString(
const std::string &string
)

Convert a string to a chroma location enum.

Returns: chroma location enum

Parameters

string
const std::string &

Chroma location string

chromaLocationToString

static std::string holoscan::ops::HolovizOp::chromaLocationToString(
holoscan::ops::HolovizOp::ChromaLocation chroma_location
)

Convert a chroma location enum to a string.

Returns: chroma location string

Parameters

chroma_location
holoscan::ops::HolovizOp::ChromaLocation

Chroma location enum

colorSpaceFromString

static nvidia::gxf::Expected<holoscan::ops::HolovizOp::ColorSpace> holoscan::ops::HolovizOp::colorSpaceFromString(
const std::string &string
)

Convert a string to a color space enum.

Returns: color space enum

Parameters

string
const std::string &

Color space string

colorSpaceToString

static std::string holoscan::ops::HolovizOp::colorSpaceToString(
holoscan::ops::HolovizOp::ColorSpace color_space
)

Convert a color space enum to a string.

Returns: color space string

Parameters

color_space
holoscan::ops::HolovizOp::ColorSpace

Color space enum

is_all_operator_successor_virtual

static bool holoscan::ops::HolovizOp::is_all_operator_successor_virtual(
const OperatorNodeType &op,
OperatorFlowGraph &graph
)

Returns whether all the successors of an operator are virtual operators.

Returns: true if the operator has all virtual operator successors, false otherwise

Parameters

op
const OperatorNodeType &

The shared_ptr to the operator for which the check is to be performed

graph
OperatorFlowGraph &

The graph of operators. fragment()->graph() can usually be used to get this graph.

is_all_operator_predecessor_virtual

static bool holoscan::ops::HolovizOp::is_all_operator_predecessor_virtual(
const OperatorNodeType &op,
OperatorFlowGraph &graph
)

Returns whether all the predecessors of an operator are virtual operators.

Returns: true if the operator has all virtual operator predecessors, false otherwise

Parameters

op
const OperatorNodeType &

The shared_ptr to the operator for which the check is to be performed

graph
OperatorFlowGraph &

The graph of operators. fragment()->graph() can usually be used to get this graph.

parse_port_name

static std::pair<std::string, std::string> holoscan::ops::HolovizOp::parse_port_name(
const std::string &op_port_name
)

Return operator name and port name from a string in the format of “<op_name>[.<port_name>]“.

parse_operator_port_key

static std::pair<std::string, std::string> holoscan::ops::HolovizOp::parse_operator_port_key(
const std::string &operator_port_key
)

Return operator name and port name from a string in the format of “<op_name>-<port_name>“.

register_codec

template <typename typeT>
static void holoscan::ops::HolovizOp::register_codec(
const std::string &codec_name,
bool overwrite = true
)

Register the codec for serialization/deserialization of a custom type.

validate_operator_name

static void holoscan::ops::HolovizOp::validate_operator_name(
const std::string &name
)

Validate operator name against restricted keywords and patterns.

Throws: std::invalid_argument if the name contains restricted patterns.

Parameters

name
const std::string &

The name to validate.

register_converter

template <typename typeT>
static void holoscan::ComponentBase::register_converter()

Register the argument setter for the given type.

If an operator or resource has an argument with a custom type, the argument setter must be registered using this method.

The argument setter is used to set the value of the argument from the YAML configuration.

This method can be called in the initialization phase of the operator/resource (e.g., initialize()). The example below shows how to register the argument setter for the custom type (Vec3):

It is assumed that YAML::convert<T>::encode and YAML::convert<T>::decode are implemented for the given type. You need to specialize the YAML::convert<> template class.

For example, suppose that you had a Vec3 class with the following members:

You can define the YAML::convert<Vec3> as follows in a ‘.cpp’ file:

Please refer to the yaml-cpp documentation for more details.

Template parameters

typeT
typename

The type of the argument to register.

Example

void MyOp::initialize() {
register_converter<Vec3>();
}

Example

struct Vec3 {
// make sure you have overloaded operator==() for the comparison
double x, y, z;
};

Example

namespace YAML {
template<>
struct convert<Vec3> {
static Node encode(const Vec3& rhs) {
Node node;
node.push_back(rhs.x);
node.push_back(rhs.y);
node.push_back(rhs.z);
return node;
}
static bool decode(const Node& node, Vec3& rhs) {
if(!node.IsSequence() || node.size() != 3) {
return false;
}
rhs.x = node[0].as<double>();
rhs.y = node[1].as<double>();
rhs.z = node[2].as<double>();
return true;
}
};
}

register_argument_setter

template <typename typeT>
void holoscan::ComponentBase::register_argument_setter()

Register the argument setter for the given type.

Please refer to the documentation of register_converter() for more details.

Template parameters

typeT
typename

The type of the argument to register.


Types

Typedefs

NameDefinitionDescription
Keyviz::Keyexport the types used by the callbacks directly from Holoviz module
KeyAndButtonActionviz::KeyAndButtonAction
KeyModifiersviz::KeyModifiers
MouseButtonviz::MouseButton
KeyCallbackFunctionstd::function< void(Key key, KeyAndButtonAction action, KeyModifiers modifiers)>Function pointer type for key callbacks.
UnicodeCharCallbackFunctionstd::function< void(uint32_t code_point)>Function pointer type for Unicode character callbacks.
MouseButtonCallbackFunctionstd::function< void(MouseButton button, KeyAndButtonAction action, KeyModifiers modifiers)>Function pointer type for mouse button callbacks.
ScrollCallbackFunctionstd::function< void(double x_offset, double y_offset)>Function pointer type for scroll callbacks.
CursorPosCallbackFunctionstd::function< void(double x_pos, double y_pos)>Function pointer type for cursor position callbacks.
FramebufferSizeCallbackFunctionstd::function< void(int width, int height)>Function pointer type for framebuffer size callbacks.
WindowSizeCallbackFunctionstd::function< void(int width, int height)>Function pointer type for window size callbacks.
WindowCloseCallbackFunctionstd::function< void()>Function pointer type for window close callbacks.
LayerCallbackFunctionstd::function< void(const std::vector< holoscan::gxf::Entity > &inputs)>Function pointer type for layer callbacks.

InputType

Input type.

NameValueDescription
UNKNOWNunknown type, the operator tries to guess the type by inspecting the tensor
COLORGRAY, RGB or RGBA 2d color image.
COLOR_LUTsingle channel 2d image, color is looked up
POINTSpoint primitives, one coordinate (x, y) per primitive
LINESline primitives, two coordinates (x0, y0) and (x1, y1) per primitive
LINE_STRIPline strip primitive, a line primitive i is defined by each coordinate (xi, yi) and the following (xi+1, yi+1)
TRIANGLEStriangle primitive, three coordinates (x0, y0), (x1, y1) and (x2, y2) per primitive
CROSSEScross primitive, a cross is defined by the center coordinate and the size (xi, yi, si)
RECTANGLESaxis aligned rectangle primitive, each rectangle is defined by two coordinates (xi, yi) and (xi+1, yi+1)
OVALSoval primitive, an oval primitive is defined by the center coordinate and the axis sizes (xi, yi, sxi, syi)
TEXTtext is defined by the top left coordinate and the size (x, y, s) per string, text strings are define by InputSpec::text_
DEPTH_MAPsingle channel 2d array where each element represents a depth value.
DEPTH_MAP_COLORRGBA 2d image, same size as the depth map.
POINTS_3D3D point primitives, one coordinate (x, y, z) per primitive
LINES_3D3D line primitives, two coordinates (x0, y0, z0) and (x1, y1, z1) per primitive
LINE_STRIP_3D3D line strip primitive, a line primitive i is defined by each coordinate (xi, yi, zi) and the following (xi+1, yi+1, zi+1)
TRIANGLES_3D3D triangle primitive, three coordinates (x0, y0, z0), (x1, y1, z1) and (x2, y2, z2) per primitive

ImageFormat

Image formats.

NameValueDescription
R8_UINTspecifies a one-component, 8-bit unsigned integer format that has a single 8-bit R component
R8_SINTspecifies a one-component, 8-bit signed integer format that has a single 8-bit R component
R8_UNORMspecifies a one-component, 8-bit unsigned normalized format that has a single 8-bit R component
R8_SNORMspecifies a one-component, 8-bit signed normalized format that has a single 8-bit R component
R8_SRGBspecifies a one-component, 8-bit unsigned normalized format that has a single 8-bit R component stored with sRGB nonlinear encoding
R16_UINTspecifies a one-component, 16-bit unsigned integer format that has a single 16-bit R component
R16_SINTspecifies a one-component, 16-bit signed integer format that has a single 16-bit R component
R16_UNORMspecifies a one-component, 16-bit unsigned normalized format that has a single 16-bit R component
R16_SNORMspecifies a one-component, 16-bit signed normalized format that has a single 16-bit R component
R16_SFLOATspecifies a one-component, 16-bit signed floating-point format that has a single 16-bit R component
R32_UINTspecifies a one-component, 16-bit unsigned integer format that has a single 16-bit R component
R32_SINTspecifies a one-component, 16-bit signed integer format that has a single 16-bit R component
R32_SFLOATspecifies a one-component, 32-bit signed floating-point format that has a single 32-bit R component
R8G8B8_UNORMspecifies a three-component, 24-bit unsigned normalized format that has a 8-bit R component in byte 0, a 8-bit G component in byte 1, and a 8-bit B component in byte 2
R8G8B8_SNORMspecifies a three-component, 24-bit signed normalized format that has a 8-bit R component in byte 0, a 8-bit G component in byte 1, and a 8-bit B component in byte 2
R8G8B8_SRGBspecifies a three-component, 24-bit unsigned normalized format that has a 8-bit R component stored with sRGB nonlinear encoding in byte 0, a 8-bit G component stored with sRGB nonlinear encoding in byte 1, and a 8-bit B component stored with sRGB nonlinear encoding in byte 2
R8G8B8A8_UNORMspecifies a four-component, 32-bit unsigned normalized format that has a 8-bit R component in byte 0, a 8-bit G component in byte 1, a 8-bit B component in byte 2, and a 8-bit A component in byte 3
R8G8B8A8_SNORMspecifies a four-component, 32-bit signed normalized format that has a 8-bit R component in byte 0, a 8-bit G component in byte 1, a 8-bit B component in byte 2, and a 8-bit A component in byte 3
R8G8B8A8_SRGBspecifies a four-component, 32-bit unsigned normalized format that has a 8-bit R component stored with sRGB nonlinear encoding in byte 0, a 8-bit G component stored with sRGB nonlinear encoding in byte 1, a 8-bit B component stored with sRGB nonlinear encoding in byte 2, and a 8-bit A component in byte 3
R16G16B16A16_UNORMspecifies a four-component, 64-bit unsigned normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7
R16G16B16A16_SNORMspecifies a four-component, 64-bit signed normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7
R16G16B16A16_SFLOATspecifies a four-component, 64-bit signed floating-point format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, a 16-bit B component in bytes 4..5, and a 16-bit A component in bytes 6..7
R32G32B32A32_SFLOATspecifies a four-component, 128-bit signed floating-point format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, a 32-bit B component in bytes 8..11, and a 32-bit A component in bytes 12..15
D16_UNORMspecifies a one-component, 16-bit unsigned normalized format that has a single 16-bit depth component
X8_D24_UNORMspecifies a two-component, 32-bit format that has 24 unsigned normalized bits in the depth component, and, optionally, 8 bits that are unused
D32_SFLOATspecifies a one-component, 32-bit signed floating-point format that has 32 bits in the depth component
A2B10G10R10_UNORM_PACK32specifies a four-component, 32-bit packed unsigned normalized format that has a 2-bit A component in bits 30..31, a 10-bit B component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit R component in bits 0..9.
A2R10G10B10_UNORM_PACK32specifies a four-component, 32-bit packed unsigned normalized format that has a 2-bit A component in bits 30..31, a 10-bit R component in bits 20..29, a 10-bit G component in bits 10..19, and a 10-bit B component in bits 0..9.
B8G8R8A8_UNORMspecifies a four-component, 32-bit unsigned normalized format that has a 8-bit B component in byte 0, a 8-bit G component in byte 1, a 8-bit R component in byte 2, and a 8-bit A component in byte 3
B8G8R8A8_SRGBspecifies a four-component, 32-bit unsigned normalized format that has a 8-bit B component stored with sRGB nonlinear encoding in byte 0, a 8-bit G component stored with sRGB nonlinear encoding in byte 1, a 8-bit R component stored with sRGB nonlinear encoding in byte 2, and a 8-bit A component in byte 3
A8B8G8R8_UNORM_PACK32specifies a four-component, 32-bit packed unsigned normalized format that has an 8-bit A component in bits 24..31, an 8-bit B component in bits 16..23, an 8-bit G component in bits 8..15, and an 8-bit R component in bits 0..7.
A8B8G8R8_SRGB_PACK32specifies a four-component, 32-bit packed unsigned normalized format that has an 8-bit A component in bits 24..31, an 8-bit B component stored with sRGB nonlinear encoding in bits 16..23, an 8-bit G component stored with sRGB nonlinear encoding in bits 8..15, and an 8-bit R component stored with sRGB nonlinear encoding in bits 0..7.
Y8U8Y8V8_422_UNORMspecifies a four-component, 32-bit format containing a pair of Y components, a V component, and a U component, collectively encoding a 2×1 rectangle of unsigned normalized RGB texel data.
U8Y8V8Y8_422_UNORMspecifies a four-component, 32-bit format containing a pair of Y components, a V component, and a U component, collectively encoding a 2×1 rectangle of unsigned normalized RGB texel data.
Y8_U8V8_2PLANE_420_UNORMspecifies an unsigned normalized multi-planar format that has an 8-bit Y component in plane 0, and a two-component, 16-bit UV plane 1 consisting of an 8-bit U component in byte 0 and an 8-bit V component in byte 1.
Y8_U8V8_2PLANE_422_UNORMspecifies an unsigned normalized multi-planar format that has an 8-bit Y component in plane 0, and a two-component, 16-bit UV plane 1 consisting of an 8-bit U component in byte 0 and an 8-bit V component in byte 1.
Y8_U8_V8_3PLANE_420_UNORMspecifies an unsigned normalized multi-planar format that has an 8-bit Y component in plane 0, an 8-bit U component in plane 1, and an 8-bit V component in plane 2.
Y8_U8_V8_3PLANE_422_UNORMspecifies an unsigned normalized multi-planar format that has an 8-bit Y component in plane 0, an 8-bit U component in plane 1, and an 8-bit V component in plane 2.
Y16_U16V16_2PLANE_420_UNORMspecifies an unsigned normalized multi-planar format that has a 16-bit Y component in each 16-bit word of plane 0, and a two-component, 32-bit UV plane 1 consisting of a 16-bit U component in the word in bytes 0..1, and a 16-bit V component in the word in bytes 2..3.
Y16_U16V16_2PLANE_422_UNORMspecifies an unsigned normalized multi-planar format that has a 16-bit Y component in each 16-bit word of plane 0, and a two-component, 32-bit UV plane 1 consisting of a 16-bit U component in the word in bytes 0..1, and a 16-bit V component in the word in bytes 2..3.
Y16_U16_V16_3PLANE_420_UNORMspecifies an unsigned normalized multi-planar format that has a 16-bit Y component in each 16-bit word of plane 0, a 16-bit U component in each 16-bit word of plane 1, and a 16-bit V component in each 16-bit word of plane 2.
Y16_U16_V16_3PLANE_422_UNORMspecifies an unsigned normalized multi-planar format that has a 16-bit Y component in each 16-bit word of plane 0, a 16-bit U component in each 16-bit word of plane 1, and a 16-bit V component in each 16-bit word of plane 2.
R16G16B16_UNORMspecifies a three-component, 48-bit unsigned normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5
R16G16B16_SNORMspecifies a three-component, 48-bit signed normalized format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5
R16G16B16_SFLOATspecifies a three-component, 48-bit signed floating-point format that has a 16-bit R component in bytes 0..1, a 16-bit G component in bytes 2..3, and a 16-bit B component in bytes 4..5
R32G32B32_SFLOATspecifies a three-component, 96-bit signed floating-point format that has a 32-bit R component in bytes 0..3, a 32-bit G component in bytes 4..7, and a 32-bit B component in bytes 8..11
AUTO_DETECT= -1Auto detect the image format.

YuvModelConversion

Defines the conversion from the source color model to the shader color model.

NameValueDescription
YUV_601specifies the color model conversion from YUV to RGB defined in BT.601
YUV_709specifies the color model conversion from YUV to RGB defined in BT.709
YUV_2020specifies the color model conversion from YUV to RGB defined in BT.2020

YuvRange

Specifies the YUV range.

NameValueDescription
ITU_FULLspecifies that the full range of the encoded values are valid and interpreted according to the ITU “full range” quantization rules
ITU_NARROWspecifies that headroom and foot room are reserved in the numerical range of encoded values, and the remaining values are expanded according to the ITU “narrow range” quantization rules

ChromaLocation

Defines the location of downsampled chroma component samples relative to the luma samples.

NameValueDescription
COSITED_EVENspecifies that downsampled chroma samples are aligned with luma samples with even coordinates
MIDPOINTspecifies that downsampled chroma samples are located half way between each even luma sample and the nearest higher odd luma sample.

DepthMapRenderMode

Depth map render mode.

NameValueDescription
POINTSrender points
LINESrender lines
TRIANGLESrender triangles

ColorSpace

The color space specifies how the surface data is interpreted when presented on screen.

NameValueDescription
SRGB_NONLINEARsRGB color space
EXTENDED_SRGB_LINEARextended sRGB color space to be displayed using a linear EOTF
BT2020_LINEARBT2020 color space to be displayed using a linear EOTF.
HDR10_ST2084HDR10 (BT2020 color) space to be displayed using the SMPTE ST2084 Perceptual Quantizer (PQ) EOTF.
PASS_THROUGHcolor components are used “as is”
BT709_LINEARBT709 color space to be displayed using a linear EOTF.
AUTO= -1Auto select the color format.

OperatorType

Operator type used by the executor.

NameValueDescription
kNativeNative operator.
kGXFGXF operator.
kVirtualVirtual operator.
kGPUResidentGPU-resident operator.
kUnknownPlaceholder for unknown operator type.

RunningState

NameValueDescription
NOT_STARTED
STARTED
STOPPED

Member variables

NameTypeDescription
kInputTypeToStr staticconst std::array< std::pair< InputType, std::string >, 17 >table to convert input type to string
kImageFormatToStr staticconst std::array< std::pair< holoscan::ops::HolovizOp::ImageFormat, std::string >, 45 >table to convert image format to string
kDepthMapRenderModeToStr staticconst std::array< std::pair< holoscan::ops::HolovizOp::DepthMapRenderMode, std::string >, 3 >table to convert depth map render mode to string
kYuvModelConversionToStr staticconst std::array< std::pair< holoscan::ops::HolovizOp::YuvModelConversion, std::string >, 3 >table to convert yuv model conversion enum to string
kYuvRangeToStr staticconst std::array< std::pair< holoscan::ops::HolovizOp::YuvRange, std::string >, 2 >table to convert yuv range enum to string
kChromaLoactionToStr staticconst std::array< std::pair< holoscan::ops::HolovizOp::ChromaLocation, std::string >, 2 >table to convert chroma location enum to string
kColorSpaceToStr staticconst std::array< std::pair< holoscan::ops::HolovizOp::ColorSpace, std::string >, 7 >table to convert color space enum to string
kInputExecPortName static constexprconst char *Default input execution port name.
kOutputExecPortName static constexprconst char *Default output execution port name.
render_buffer_input_Parameter< holoscan::IOSpec * >
render_buffer_output_Parameter< holoscan::IOSpec * >
depth_buffer_input_Parameter< holoscan::IOSpec * >
depth_buffer_output_Parameter< holoscan::IOSpec * >
camera_pose_output_Parameter< holoscan::IOSpec * >
tensors_Parameter< std::vector< InputSpec > >
color_lut_Parameter< std::vector< std::vector< float > > >
window_title_Parameter< std::string >
display_name_Parameter< std::string >
width_Parameter< uint32_t >
height_Parameter< uint32_t >
framerate_Parameter< float >
use_exclusive_display_Parameter< bool >
fullscreen_Parameter< bool >
headless_Parameter< bool >
framebuffer_srgb_Parameter< bool >
vsync_Parameter< bool >
multiprocess_framedrop_waittime_ms_Parameter< uint32_t >
holoviz_multiprocess_mutex_path_Parameter< std::string >
display_color_space_Parameter< ColorSpace >
window_close_condition_Parameter< std::shared_ptr< BooleanCondition > >
window_close_scheduling_term_Parameter< std::shared_ptr< BooleanCondition > >
allocator_Parameter< std::shared_ptr< Allocator > >
cuda_stream_pool_Parameter< std::shared_ptr< CudaStreamPool > >
font_path_Parameter< std::string >
camera_pose_output_type_Parameter< std::string >
camera_eye_Parameter< std::array< float, 3 > >
camera_look_at_Parameter< std::array< float, 3 > >
camera_up_Parameter< std::array< float, 3 > >
supported_image_formats_std::vector< ImageFormat >
key_callback_holoscan::Parameter< KeyCallbackFunction >
unicode_char_callback_holoscan::Parameter< UnicodeCharCallbackFunction >
mouse_button_callback_holoscan::Parameter< MouseButtonCallbackFunction >
scroll_callback_holoscan::Parameter< ScrollCallbackFunction >
cursor_pos_callback_holoscan::Parameter< CursorPosCallbackFunction >
framebuffer_size_callback_holoscan::Parameter< FramebufferSizeCallbackFunction >
window_size_callback_holoscan::Parameter< WindowSizeCallbackFunction >
window_close_callback_holoscan::Parameter< WindowCloseCallbackFunction >
interrupt_app_on_window_close_holoscan::Parameter< bool >
layer_callback_holoscan::Parameter< LayerCallbackFunction >
instance_viz::InstanceHandle
running_state_mutex_std::shared_mutex
running_state_std::atomic< RunningState >
lut_std::vector< float >
initial_input_spec_std::vector< InputSpec >
interrupt_thread_std::threadThread used to dispatch executor interrupt asynchronously.
render_buffer_input_enabled_bool
render_buffer_output_enabled_bool
depth_buffer_input_enabled_bool
depth_buffer_output_enabled_bool
camera_pose_output_enabled_bool
is_first_tick_bool
is_holoviz_multiprocess_mutex_enabled_bool
holoviz_multiprocess_mutex_std::shared_ptr< holoscan::FileFIFOMutex >
dropped_frame_count_unsigned long long
camera_eye_cur_std::array< float, 3 >
camera_look_at_cur_std::array< float, 3 >
camera_up_cur_std::array< float, 3 >
key_callback_handler staticstd::remove_pointer_t< viz::KeyCallbackFunction >
unicode_char_callback_handler staticstd::remove_pointer_t< viz::UnicodeCharCallbackFunction >
mouse_button_callback_handler staticstd::remove_pointer_t< viz::MouseButtonCallbackFunction >
scroll_callback_handler staticstd::remove_pointer_t< viz::ScrollCallbackFunction >
cursor_pos_callback_handler staticstd::remove_pointer_t< viz::CursorPosCallbackFunction >
framebuffer_size_callback_handler staticstd::remove_pointer_t< viz::FramebufferSizeCallbackFunction >
window_size_callback_handler staticstd::remove_pointer_t< viz::WindowSizeCallbackFunction >
is_initialized_boolWhether the operator is initialized.
operator_type_OperatorTypeThe type of the operator.
spec_std::shared_ptr< OperatorSpec >The operator spec of the operator.
conditions_std::unordered_map< std::string, std::shared_ptr< Condition > >The conditions of the operator.
resources_std::unordered_map< std::string, std::shared_ptr< Resource > >The resources used by the operator.
graph_entity_std::shared_ptr< nvidia::gxf::GraphEntity >GXF graph entity corresponding to.
internal_async_condition_*< the Operator *The asynchronous condition to control the operator execution. std::shared_ptr< holoscan::AsynchronousCondition >
dynamic_metadata_std::shared_ptr< MetadataDictionary >The metadata dictionary for the operator.
is_metadata_enabled_std::optional< bool >Flag to enable or disable metadata for the operator.
input_exec_spec_*< If not set, the value from the Fragment is used. std::shared_ptr< IOSpec >The input execution port specification.
output_exec_spec_std::shared_ptr< IOSpec >The output execution port specification.
dynamic_flow_func_std::function< void(const std::shared_ptr< Operator > &)>
self_shared_std::weak_ptr< Operator >
next_flows_std::shared_ptr< std::vector< std::shared_ptr< FlowInfo > > >
dynamic_flows_std::shared_ptr< std::vector< std::shared_ptr< FlowInfo > > >
id_int64_tThe ID of the component.
name_std::stringName of the component.
fragment_Fragment *Pointer to the fragment that owns this component.
args_std::vector< Arg >List of arguments.
service_provider_FragmentServiceProvider *Pointer to the service provider.

Inner classes

InputSpec

struct holoscan::ops::HolovizOp::InputSpec

Input specification.

NameTypeDescription
tensor_name_std::stringname of the tensor/video buffer containing the input data
type_InputTypeinput type
opacity_floatlayer opacity, 1.0 is fully opaque, 0.0 is fully transparent
priority_int32_tlayer priority, determines the render order, layers with higher priority values are rendered on top of layers with lower priority values
image_format_ImageFormatimage format
yuv_model_conversion_YuvModelConversionYUV model conversion.
yuv_range_YuvRangeYUV range.
x_chroma_location_ChromaLocationchroma location in x direction for formats which are chroma downsampled in width (420 and 422)
y_chroma_location_ChromaLocationchroma location in y direction for formats which are chroma downsampled in height (420)
color_std::vector< float >color of rendered geometry
line_width_floatline width for geometry made of lines
point_size_floatpoint size for geometry made of points
text_std::vector< std::string >array of text strings, used when type_ is TEXT.
depth_map_render_mode_DepthMapRenderModedepth map render mode, used if type_ is DEPTH_MAP or DEPTH_MAP_COLOR.
views_std::vector< View >