NVIDIA Holoscan SDK v2.9.0

Program Listing for File holoviz.hpp

Return to documentation for file (modules/holoviz/src/holoviz/holoviz.hpp)

Copy
Copied!
            

/* * SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MODULES_HOLOVIZ_SRC_HOLOVIZ_HOLOVIZ_HPP #define MODULES_HOLOVIZ_SRC_HOLOVIZ_HOLOVIZ_HPP #include <cuda.h> #include <cstdint> #include "holoviz/callbacks.hpp" #include "holoviz/depth_map_render_mode.hpp" #include "holoviz/image_format.hpp" #include "holoviz/init_flags.hpp" #include "holoviz/present_mode.hpp" #include "holoviz/primitive_topology.hpp" #include "holoviz/surface_format.hpp" // forward declaration of external types typedef struct GLFWwindow GLFWwindow; struct ImGuiContext; namespace holoscan::viz { // forward declaration of internal types typedef void* InstanceHandle; InstanceHandle Create(); void SetCurrent(InstanceHandle instance); InstanceHandle GetCurrent(); void Init(GLFWwindow* window, InitFlags flags = InitFlags::NONE); void Init(uint32_t width, uint32_t height, const char* title, InitFlags flags = InitFlags::NONE, const char* display_name = nullptr); void Init(const char* displayName, uint32_t width = 0, uint32_t height = 0, uint32_t refreshRate = 0, InitFlags flags = InitFlags::NONE); void SetKeyCallback(void* user_pointer, KeyCallbackFunction callback); void SetUnicodeCharCallback(void* user_pointer, UnicodeCharCallbackFunction callback); void SetMouseButtonCallback(void* user_pointer, MouseButtonCallbackFunction callback); void SetScrollCallback(void* user_pointer, ScrollCallbackFunction callback); void SetCursorPosCallback(void* user_pointer, CursorPosCallbackFunction callback); void SetFramebufferSizeCallback(void* user_pointer, FramebufferSizeCallbackFunction callback); void SetWindowSizeCallback(void* user_pointer, WindowSizeCallbackFunction callback); void GetPresentModes(uint32_t* present_mode_count, PresentMode* present_modes); void SetPresentMode(PresentMode present_mode); void GetSurfaceFormats(uint32_t* surface_format_count, SurfaceFormat* surface_formats); void SetSurfaceFormat(SurfaceFormat surface_format); void SetFont(const char* path, float size_in_pixels); void SetCudaStream(CUstream stream); bool WindowShouldClose(); bool WindowIsMinimized(); void Shutdown(InstanceHandle instance = nullptr); void Begin(); void End(); void BeginImageLayer(); void ImageCudaDevice(uint32_t width, uint32_t height, ImageFormat fmt, CUdeviceptr device_ptr, size_t row_pitch = 0, CUdeviceptr device_ptr_plane_1 = 0, size_t row_pitch_plane_1 = 0, CUdeviceptr device_ptr_plane_2 = 0, size_t row_pitch_plane_2 = 0); void ImageCudaArray(ImageFormat fmt, CUarray array); void ImageHost(uint32_t width, uint32_t height, ImageFormat fmt, const void* data, size_t row_pitch = 0, const void* data_plane_1 = nullptr, size_t row_pitch_plane_1 = 0, const void* data_plane_2 = nullptr, size_t row_pitch_plane_2 = 0); void LUT(uint32_t size, ImageFormat fmt, size_t data_size, const void* data, bool normalized = false); void ImageComponentMapping(ComponentSwizzle r, ComponentSwizzle g, ComponentSwizzle b, ComponentSwizzle a); void ImageYuvModelConversion(YuvModelConversion yuv_model_conversion); void ImageYuvRange(YuvRange yuv_range); void ImageChromaLocation(ChromaLocation x_chroma_location, ChromaLocation y_chroma_location); void BeginImGuiLayer(); void BeginGeometryLayer(); void Color(float r, float g, float b, float a); void LineWidth(float width); void PointSize(float size); void Primitive(PrimitiveTopology topology, uint32_t primitive_count, size_t data_size, const float* data); void PrimitiveCudaDevice(PrimitiveTopology topology, uint32_t primitive_count, size_t data_size, CUdeviceptr data); void Text(float x, float y, float size, const char* text); void DepthMap(DepthMapRenderMode render_mode, uint32_t width, uint32_t height, ImageFormat depth_fmt, CUdeviceptr depth_device_ptr, ImageFormat color_fmt, CUdeviceptr color_device_ptr); void LayerOpacity(float opacity); void LayerPriority(int32_t priority); void LayerAddView(float offset_x, float offset_y, float width, float height, const float* matrix = nullptr); void EndLayer(); void ReadFramebuffer(ImageFormat fmt, uint32_t width, uint32_t height, size_t buffer_size, CUdeviceptr device_ptr, size_t row_pitch = 0); void SetCamera(float eye_x, float eye_y, float eye_z, float look_at_x, float look_at_y, float look_at_z, float up_x, float up_y, float up_z, bool anim = false); void GetCameraPose(size_t size, float* matrix); void GetCameraPose(float (&rotation)[9], float (&translation)[3]); } // namespace holoscan::viz #endif/* MODULES_HOLOVIZ_SRC_HOLOVIZ_HOLOVIZ_HPP */

© Copyright 2022-2024, NVIDIA. Last updated on Jan 27, 2025.