NVIDIA DeepStream SDK API Reference

8.0 Release
includes/nvll_osd_int.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <pango/pangocairo.h>
17 #include <math.h>
18 #include "nvll_osd.h"
19 
20 inline bool CHECK_(int e, int iLine, const char *szFile) {
21  if (e != cudaSuccess) {
22  //cout << "CUDA runtime error " << e << " at line " << iLine << " in file " << szFile;
23  exit (-1);
24  return false;
25  }
26  return true;
27 }
28 
29 #define clip_rect(ctx, left, top, right, bottom) \
30 { \
31  if(left < 0) \
32  { \
33  left = 0; \
34  } \
35  if(top < 0) \
36  { \
37  top = 0; \
38  } \
39  if(right > ctx->frame_width) \
40  { \
41  right = ctx->frame_width; \
42  } \
43  if(bottom > ctx->frame_height) \
44  { \
45  bottom = ctx->frame_height; \
46  } \
47 }
48 
49 #define ck(call) CHECK_(call, __LINE__, __FILE__)
50 
51 void nvll_osd_resize_segment_masks_bg(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params, NvOSD_MaskParams *mask_params, void** mask_argb32);
52 void nvll_osd_draw_segment_masks_bg(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params, NvOSD_MaskParams *mask_params, void* mask_argb32);
53 void nvll_osd_draw_bounding_rectangles(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params);
54 void nvll_osd_draw_mask_regions(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params);
55 void nvll_osd_rect_with_border_bg(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params);
56 
58  NvOSD_ArrowParams *arrow_params_list);
59 
60 int nvll_osd_draw_segment_masks_cpu(void *nvosd_ctx, NvOSD_FrameSegmentMaskParams *frame_mask_params);
61 int nvll_osd_draw_segment_masks_gpu(void *nvosd_ctx, NvOSD_FrameSegmentMaskParams *frame_mask_params);
62 
63 int nvll_osd_blur_rectangles_gpu(void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
64 int nvll_osd_draw_rectangles_cpu(void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
65 int nvll_osd_draw_rectangles_gpu(void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params);
66 
67 int nvll_osd_draw_arrows_cpu(void *nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params);
68 int nvll_osd_draw_arrows_gpu(void *nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params);
69 
70 int nvll_osd_draw_circles_cpu(void *nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params);
71 int nvll_osd_draw_circles_gpu(void *nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params);
72 
73 int nvll_osd_draw_lines_cpu(void *nvosd_ctx, NvOSD_FrameLineParams *frame_line_params);
74 int nvll_osd_draw_lines_gpu(void *nvosd_ctx, NvOSD_FrameLineParams *frame_line_params);
75 
76 int nvll_osd_put_text_cpu(void *nvosd_ctx, NvOSD_FrameTextParams *frame_text_params);
77 int nvll_osd_put_text_gpu(void *nvosd_ctx, NvOSD_FrameTextParams *frame_text_params);
78 int nvll_osd_gpu_apply(void *nvosd_ctx, NvBufSurfaceParams *buf_ptr, NvBufSurface *surf);
nvll_osd.h
nvll_osd_draw_rectangles_gpu
int nvll_osd_draw_rectangles_gpu(void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
_NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Definition: nvll_osd_struct.h:140
_NvOSD_MaskParams
Holds the mask parameters of the segment to be overlayed.
Definition: nvll_osd_struct.h:170
nvll_osd_rect_with_border_bg
void nvll_osd_rect_with_border_bg(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params)
nvll_osd_draw_segment_masks_cpu
int nvll_osd_draw_segment_masks_cpu(void *nvosd_ctx, NvOSD_FrameSegmentMaskParams *frame_mask_params)
nvll_osd_resize_segment_masks_bg
void nvll_osd_resize_segment_masks_bg(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params, NvOSD_MaskParams *mask_params, void **mask_argb32)
NvBufSurface
Holds information about batched buffers.
Definition: nvbufsurface.h:577
_NvOSD_FrameRectParams
Holds information about the rectangles in a frame.
Definition: nvll_osd_api.h:71
_NvOSD_Ctx
Definition: includes/nvll_osd.h:40
_NvOSDFdMap
Definition: includes/nvll_osd.h:30
nvll_osd_draw_circles_gpu
int nvll_osd_draw_circles_gpu(void *nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params)
_NvOSD_ArrowParams
Holds arrow parameters to be overlaid.
Definition: nvll_osd_struct.h:200
nvll_osd_construct_draw_arrows_cpu
void nvll_osd_construct_draw_arrows_cpu(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_ArrowParams *arrow_params_list)
nvll_osd_draw_lines_cpu
int nvll_osd_draw_lines_cpu(void *nvosd_ctx, NvOSD_FrameLineParams *frame_line_params)
NvBufSurfaceParams
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:542
nvll_osd_put_text_cpu
int nvll_osd_put_text_cpu(void *nvosd_ctx, NvOSD_FrameTextParams *frame_text_params)
nvll_osd_gpu_apply
int nvll_osd_gpu_apply(void *nvosd_ctx, NvBufSurfaceParams *buf_ptr, NvBufSurface *surf)
nvll_osd_draw_rectangles_cpu
int nvll_osd_draw_rectangles_cpu(void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
nvll_osd_draw_segment_masks_bg
void nvll_osd_draw_segment_masks_bg(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params, NvOSD_MaskParams *mask_params, void *mask_argb32)
_NvOSD_FrameCircleParams
Holds information about the circles in a frame.
Definition: nvll_osd_api.h:137
nvll_osd_draw_arrows_gpu
int nvll_osd_draw_arrows_gpu(void *nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params)
nvll_osd_draw_bounding_rectangles
void nvll_osd_draw_bounding_rectangles(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params)
nvll_osd_put_text_gpu
int nvll_osd_put_text_gpu(void *nvosd_ctx, NvOSD_FrameTextParams *frame_text_params)
nvll_osd_draw_arrows_cpu
int nvll_osd_draw_arrows_cpu(void *nvosd_ctx, NvOSD_FrameArrowParams *frame_arrow_params)
nvll_osd_draw_mask_regions
void nvll_osd_draw_mask_regions(NvOSD_Ctx *ctx, NvOSDFdMap *nvosd_map, NvOSD_RectParams *rect_params)
_NvOSD_FrameTextParams
Holds information about the text in a frame.
Definition: nvll_osd_api.h:55
nvll_osd_draw_segment_masks_gpu
int nvll_osd_draw_segment_masks_gpu(void *nvosd_ctx, NvOSD_FrameSegmentMaskParams *frame_mask_params)
_NvOSD_FrameArrowParams
Holds information about the arrows in a frame.
Definition: nvll_osd_api.h:121
_NvOSD_FrameSegmentMaskParams
Holds information about the rectangles in a frame.
Definition: nvll_osd_api.h:87
CHECK_
bool CHECK_(int e, int iLine, const char *szFile)
Definition: includes/nvll_osd_int.h:20
nvll_osd_blur_rectangles_gpu
int nvll_osd_blur_rectangles_gpu(void *nvosd_ctx, NvOSD_FrameRectParams *frame_rect_params)
nvll_osd_draw_circles_cpu
int nvll_osd_draw_circles_cpu(void *nvosd_ctx, NvOSD_FrameCircleParams *frame_circle_params)
_NvOSD_FrameLineParams
Holds information about the lines in a frame.
Definition: nvll_osd_api.h:105
nvll_osd_draw_lines_gpu
int nvll_osd_draw_lines_gpu(void *nvosd_ctx, NvOSD_FrameLineParams *frame_line_params)