NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/includes/nvll_osd_api.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
39 #ifndef __NVLL_OSD_API_DEFS__
40 #define __NVLL_OSD_API_DEFS__
41 
42 #include "nvll_osd_struct.h"
43 #include "nvbufsurface.h"
44 
45 #define NVOSD_PRINT_E(f_, ...) \
46  printf("libnvosd (%d):(ERROR) : " f_, __LINE__, ##__VA_ARGS__)
47 
48 #define MAX_IN_BUF 16
49 #define MAX_BORDER_WIDTH 32
50 
51 #ifdef __cplusplus
52 extern "C"
53 {
54 #endif
55 
56 typedef void * NvOSDCtxHandle;
60 typedef struct _NvOSD_FrameTextParams
61 {
68  int num_strings;
74 
76 typedef struct _NvOSD_FrameRectParams
77 {
84  int num_rects;
92 
94 typedef struct _NvOSD_FrameSegmentMaskParams
95 {
102  int num_segments;
110 
112 typedef struct _NvOSD_FrameLineParams
113 {
120  int num_lines;
126 
128 typedef struct _NvOSD_FrameArrowParams
129 {
136  int num_arrows;
142 
144 typedef struct _NvOSD_FrameCircleParams
145 {
152  int num_circles;
158 
165 
172 
184 void nvll_osd_set_clock_params(NvOSDCtxHandle nvosd_ctx, NvOSD_TextParams *clk_params);
185 
186 
203 int nvll_osd_put_text(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameTextParams *frame_text_params);
204 
218 
231 int nvll_osd_blur_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
232 
258 int nvll_osd_draw_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
259 
275 int nvll_osd_draw_lines(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameLineParams *frame_line_params);
276 
291 int nvll_osd_draw_arrows(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params);
292 
306 int nvll_osd_draw_circles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params);
307 
317 void *nvll_osd_set_params (NvOSDCtxHandle nvosd_ctx, int width, int height);
318 
331 int nvll_osd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info * color_info, int num_classes);
332 
341 int nvll_osd_apply (NvOSDCtxHandle nvosd_ctx, NvBufSurfaceParams *buf_ptr, NvBufSurface *surf);
342 
343 #ifdef __cplusplus
344 }
345 #endif
346 
347 #endif
_NvOSD_FrameRectParams::num_rects
int num_rects
Holds the number of rectangles.
Definition: sources/includes/nvll_osd_api.h:84
_NvOSD_LineParams
Holds the box parameters of a line to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:188
_NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:145
_NvOSD_FrameTextParams::text_params_list
NvOSD_TextParams * text_params_list
Holds the strings' text parameters.
Definition: sources/includes/nvll_osd_api.h:70
nvll_osd_draw_segment_masks
int nvll_osd_draw_segment_masks(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameSegmentMaskParams *frame_mask_params)
Overlays segment masks at a given location in a buffer.
_NvOSD_MaskParams
Holds the mask parameters of the segment to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:177
NvOSD_FrameRectParams
struct _NvOSD_FrameRectParams NvOSD_FrameRectParams
Holds information about the rectangles in a frame.
_NvOSD_Color_info
Definition: sources/includes/nvll_osd_struct.h:137
NvOSD_FrameCircleParams
struct _NvOSD_FrameCircleParams NvOSD_FrameCircleParams
Holds information about the circles in a frame.
nvll_osd_draw_circles
int nvll_osd_draw_circles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params)
Overlays circles on the buffer.
_NvOSD_FrameLineParams::num_lines
int num_lines
Holds the number of lines.
Definition: sources/includes/nvll_osd_api.h:120
_NvOSD_FrameRectParams::rect_params_list
NvOSD_RectParams * rect_params_list
Holds the rectangles' parameters.
Definition: sources/includes/nvll_osd_api.h:86
_NvOSD_FrameLineParams::line_params_list
NvOSD_LineParams * line_params_list
Holds the lines' parameters.
Definition: sources/includes/nvll_osd_api.h:122
_NvOSD_FrameSegmentMaskParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:98
_NvOSD_FrameTextParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:72
_NvOSD_FrameTextParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:66
nvll_osd_set_clock_params
void nvll_osd_set_clock_params(NvOSDCtxHandle nvosd_ctx, NvOSD_TextParams *clk_params)
Sets clock parameters for a given context.
_NvOSD_CircleParams
Holds circle parameters to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:231
_NvOSD_FrameCircleParams::num_circles
int num_circles
Holds the number of circles.
Definition: sources/includes/nvll_osd_api.h:152
NvBufSurface
Holds information about batched buffers.
Definition: sources/includes/nvbufsurface.h:597
_NvOSD_FrameLineParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:118
_NvOSD_FrameCircleParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:156
_NvOSD_FrameRectParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:82
nvll_osd_draw_rectangles
int nvll_osd_draw_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
Overlays boxes at a given location in a buffer.
nvbufsurface.h
NvOSD_FrameLineParams
struct _NvOSD_FrameLineParams NvOSD_FrameLineParams
Holds information about the lines in a frame.
NvOSDCtxHandle
void * NvOSDCtxHandle
Definition: 9.1/sources/includes/nvll_osd_api.h:56
_NvOSD_FrameSegmentMaskParams::mask_params_list
NvOSD_MaskParams * mask_params_list
Holds mask parameters.
Definition: sources/includes/nvll_osd_api.h:106
NvOSD_FrameSegmentMaskParams
struct _NvOSD_FrameSegmentMaskParams NvOSD_FrameSegmentMaskParams
Holds information about the rectangles in a frame.
_NvOSD_FrameRectParams
Holds information about the rectangles in a frame.
Definition: sources/includes/nvll_osd_api.h:76
_NvOSD_FrameSegmentMaskParams::num_segments
int num_segments
Holds the number of rectangles.
Definition: sources/includes/nvll_osd_api.h:102
_NvOSD_FrameLineParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:116
_NvOSD_FrameSegmentMaskParams::rect_params_list
NvOSD_RectParams * rect_params_list
Holds the rectangles' parameters.
Definition: sources/includes/nvll_osd_api.h:104
nvll_osd_draw_lines
int nvll_osd_draw_lines(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameLineParams *frame_line_params)
Overlays lines on the buffer.
_NvOSD_FrameArrowParams::arrow_params_list
NvOSD_ArrowParams * arrow_params_list
Holds the parameters of the arrows.
Definition: sources/includes/nvll_osd_api.h:138
_NvOSD_FrameArrowParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:134
_NvOSD_ArrowParams
Holds arrow parameters to be overlaid.
Definition: sources/includes/nvll_osd_struct.h:207
nvll_osd_put_text
int nvll_osd_put_text(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameTextParams *frame_text_params)
/brief Overlays clock and given text at a given location in a buffer.
nvll_osd_draw_arrows
int nvll_osd_draw_arrows(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params)
Overlays arrows on the buffer.
nvll_osd_blur_rectangles
int nvll_osd_blur_rectangles(NvOSDCtxHandle nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
Blur boxes at a given location in a buffer.
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: sources/includes/nvbufsurface.h:562
_NvOSD_FrameCircleParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:150
_NvOSD_FrameArrowParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:140
nvll_osd_apply
int nvll_osd_apply(NvOSDCtxHandle nvosd_ctx, NvBufSurfaceParams *buf_ptr, NvBufSurface *surf)
Apply OSD to the video frame for GPU backend.
_NvOSD_FrameCircleParams
Holds information about the circles in a frame.
Definition: sources/includes/nvll_osd_api.h:144
_NvOSD_FrameCircleParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:148
NvOSD_Mode
NvOSD_Mode
Defines modes used to overlay boxes and text.
Definition: sources/includes/nvll_osd_struct.h:47
nvll_osd_set_params
void * nvll_osd_set_params(NvOSDCtxHandle nvosd_ctx, int width, int height)
Sets the resolution of the frames on which the NvOSDContext is to operate.
nvll_osd_create_context
NvOSDCtxHandle nvll_osd_create_context(void)
Creates an NvOSD context.
nvll_osd_destroy_context
void nvll_osd_destroy_context(NvOSDCtxHandle nvosd_ctx)
Destroys an NvOSD context.
_NvOSD_FrameCircleParams::circle_params_list
NvOSD_CircleParams * circle_params_list
Holds the parameters of the circles.
Definition: sources/includes/nvll_osd_api.h:154
_NvOSD_FrameArrowParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:132
_NvOSD_FrameArrowParams::num_arrows
int num_arrows
Holds the number of arrows.
Definition: sources/includes/nvll_osd_api.h:136
_NvOSD_FrameTextParams
Holds information about the text in a frame.
Definition: sources/includes/nvll_osd_api.h:60
_NvOSD_FrameArrowParams
Holds information about the arrows in a frame.
Definition: sources/includes/nvll_osd_api.h:128
_NvOSD_FrameSegmentMaskParams
Holds information about the rectangles in a frame.
Definition: sources/includes/nvll_osd_api.h:94
NvOSD_FrameArrowParams
struct _NvOSD_FrameArrowParams NvOSD_FrameArrowParams
Holds information about the arrows in a frame.
_NvOSD_TextParams
Holds parameters of text to be overlayed.
Definition: sources/includes/nvll_osd_struct.h:120
_NvOSD_FrameSegmentMaskParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:108
nvll_osd_struct.h
_NvOSD_FrameTextParams::num_strings
int num_strings
Holds the number of strings.
Definition: sources/includes/nvll_osd_api.h:68
_NvOSD_FrameRectParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to the buffer containing the frame.
Definition: sources/includes/nvll_osd_api.h:80
_NvOSD_FrameRectParams::mask_params_list
NvOSD_MaskParams * mask_params_list
Holds mask parameters.
Definition: sources/includes/nvll_osd_api.h:88
NvOSD_FrameTextParams
struct _NvOSD_FrameTextParams NvOSD_FrameTextParams
Holds information about the text in a frame.
_NvOSD_FrameLineParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:124
_NvOSD_FrameTextParams::buf_ptr
NvBufSurfaceParams * buf_ptr
Holds a pointer to a buffer containing a frame.
Definition: sources/includes/nvll_osd_api.h:64
_NvOSD_FrameRectParams::surf
NvBufSurface * surf
Holds information about batched buffers.
Definition: sources/includes/nvll_osd_api.h:90
_NvOSD_FrameSegmentMaskParams::mode
NvOSD_Mode mode
Holds the OSD mode to be used for processing.
Definition: sources/includes/nvll_osd_api.h:100
_NvOSD_FrameLineParams
Holds information about the lines in a frame.
Definition: sources/includes/nvll_osd_api.h:112
nvll_osd_init_colors_for_hw_blend
int nvll_osd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info *color_info, int num_classes)
Initializes colors for HW based blending.