Program Listing for File holoviz.hpp
↰ Return to documentation for file (modules/holoviz/src/holoviz/holoviz.hpp
)
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 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 HOLOVIZ_SRC_HOLOVIZ_HOLOVIZ_HPP
#define 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/primitive_topology.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);
void Init(const char* displayName, uint32_t width = 0, uint32_t height = 0,
uint32_t refreshRate = 0, InitFlags flags = InitFlags::NONE);
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);
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 GetCameraPose(size_t size, float* matrix);
} // namespace holoscan::viz
#endif/* HOLOVIZ_SRC_HOLOVIZ_HOLOVIZ_HPP */