NVIDIA Holoscan SDK v2.3.0
Holoscan v2.3.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/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 GetPresentModes(uint32_t* present_mode_count, PresentMode* present_modes); 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 SetPresentMode(PresentMode present_mode); 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); void ImageCudaArray(ImageFormat fmt, CUarray array); void ImageHost(uint32_t width, uint32_t height, ImageFormat fmt, const void* data, size_t row_pitch = 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 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 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 Sep 6, 2024.