L4T Multimedia API Reference

28.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nvosd.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in
11  * the documentation and/or other materials provided with the
12  * distribution.
13  * 3. The names of its contributors may not be used to endorse or promote
14  * products derived from this software without specific prior written
15  * permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 
47 #ifndef __NVOSD_DEFS__
48 #define __NVOSD_DEFS__
49 
50 #ifdef __cplusplus
51 extern "C"
52 {
53 #endif
54 
55 #define NVOSD_MAX_NUM_RECTS 128
56 #define MAX_BG_CLR 20
57 
61 typedef struct _NvOSD_ColorParams {
62  double red;
65  double green;
68  double blue;
71  double alpha;
74 
75 
79 typedef struct _NvOSD_FontParams {
80  char * font_name;
83  unsigned int font_size;
87 
88 
93 typedef struct _NvOSD_TextParams {
94  char * display_text;
96  unsigned int x_offset;
98  unsigned int y_offset;
108 
109 
110 typedef struct _NvOSD_Color_info {
111  int id;
114 
115 
119 typedef struct _NvOSD_RectParams {
120  unsigned int left;
122  unsigned int top;
124  unsigned int width;
126  unsigned int height;
128  unsigned int border_width;
133  unsigned int has_bg_color;
136  unsigned int reserved;
142  int color_id;
143 
145 
146 
150 typedef struct _NvOSD_ArrowParams {
151  unsigned int x1;
153  unsigned int y1;
155  unsigned int x2;
157  unsigned int y2;
159  unsigned int arrow_width;
161  unsigned int start_arrow_head;
168  unsigned int reserved;
172 
173 
177 typedef struct _NvOSD_CircleParams {
178  unsigned int xc;
180  unsigned int yc;
182  unsigned int radius;
186  unsigned int reserved;
190 
194 typedef enum{
203 } NvOSD_Mode;
204 
210 void *nvosd_create_context(void);
211 
218 void nvosd_destroy_context(void *nvosd_ctx);
219 
231 void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params);
232 
233 
254 int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
255  NvOSD_TextParams *text_params_list);
256 
257 
286 int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
287  int num_rects, NvOSD_RectParams *rect_params_list);
288 
289 int nvosd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info * color_info,
290  int num_classes);
291 
292 
293 int nvosd_draw_arrows(void *nvosd_ctx, NvOSD_Mode mode, int fd,
294  int num_arrows, NvOSD_ArrowParams *arrow_params_list);
295 
296 int nvosd_draw_circles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
297  int num_circles, NvOSD_CircleParams *circle_params_list);
298 
299 #ifdef __cplusplus
300 }
301 #endif
302 
303 #endif
struct _NvOSD_ArrowParams NvOSD_ArrowParams
Holds the arrow parameters to be overlayed.
NvOSD_ColorParams arrow_color
Holds boolean value indicating whether arrow head is at start or at end.
Definition: nvosd.h:166
struct _NvOSD_ColorParams NvOSD_ColorParams
Holds the color parameters of the box or text to be overlayed.
struct _NvOSD_Color_info NvOSD_Color_info
struct _NvOSD_CircleParams NvOSD_CircleParams
Holds the circle parameters to be overlayed.
unsigned int radius
Holds radius of circle in pixels.
Definition: nvosd.h:182
unsigned int y_offset
Holds vertical offset w.r.t top left pixel of the frame.
Definition: nvosd.h:98
int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_rects, NvOSD_RectParams *rect_params_list)
Overlays boxes at given location on a buffer.
Holds the font parameters of the text to be overlayed.
Definition: nvosd.h:79
unsigned int x2
Holds end horizontal coordinate in pixels.
Definition: nvosd.h:155
int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings, NvOSD_TextParams *text_params_list)
Overlays clock and given text at given location on a buffer.
Holds the box parameters of the box to be overlayed.
Definition: nvosd.h:119
int nvosd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info *color_info, int num_classes)
unsigned int top
Holds top coordinate of the box in pixels.
Definition: nvosd.h:122
Holds the circle parameters to be overlayed.
Definition: nvosd.h:177
unsigned int x1
Holds start horizontal coordinate in pixels.
Definition: nvosd.h:151
unsigned int arrow_width
Holds arrow_width in pixels.
Definition: nvosd.h:159
void nvosd_destroy_context(void *nvosd_ctx)
Destroys NvOSD context.
unsigned int y1
Holds start vertical coordinate in pixels.
Definition: nvosd.h:153
unsigned int height
Holds height of the box in pixels.
Definition: nvosd.h:126
Holds the arrow parameters to be overlayed.
Definition: nvosd.h:150
int nvosd_draw_arrows(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_arrows, NvOSD_ArrowParams *arrow_params_list)
NvOSD_ColorParams border_color
Holds color params of the border of the box.
Definition: nvosd.h:130
unsigned int reserved
Definition: nvosd.h:136
NvOSD_Mode
List modes used to overlay boxes and text.
Definition: nvosd.h:194
struct _NvOSD_TextParams NvOSD_TextParams
Holds the text parameters of the text to be overlayed.
unsigned int x_offset
Holds horizontal offset w.r.t top left pixel of the frame.
Definition: nvosd.h:96
void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params)
Sets clock parameters for the given context.
char * display_text
Holds the text to be overlayed.
Definition: nvosd.h:94
NvOSD_ColorParams circle_color
Holds color params of the arrow box.
Definition: nvosd.h:184
unsigned int left
Holds left coordinate of the box in pixels.
Definition: nvosd.h:120
int has_color_info
Definition: nvosd.h:141
double alpha
Holds alpha component of color.
Definition: nvosd.h:71
Selects NV HW engine for rectangle draw and mask.
Definition: nvosd.h:199
char * font_name
Holds pointer to the string containing font name.
Definition: nvosd.h:80
unsigned int start_arrow_head
Definition: nvosd.h:161
NvOSD_ColorParams font_color
Holds font color.
Definition: nvosd.h:85
struct _NvOSD_RectParams NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
int set_bg_clr
Boolean to indicate text has background color.
Definition: nvosd.h:103
NvOSD_ColorParams text_bg_clr
Background color for text.
Definition: nvosd.h:105
Holds the text parameters of the text to be overlayed.
Definition: nvosd.h:93
unsigned int y2
Holds end vertical coordinate in pixels.
Definition: nvosd.h:157
int nvosd_draw_circles(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_circles, NvOSD_CircleParams *circle_params_list)
struct _NvOSD_FontParams NvOSD_FontParams
Holds the font parameters of the text to be overlayed.
unsigned int reserved
reserved field for future usage.
Definition: nvosd.h:186
Selects CPU for OSD processing.
Definition: nvosd.h:195
unsigned int width
Holds width of the box in pixels.
Definition: nvosd.h:124
unsigned int yc
Holds start vertical coordinate in pixels.
Definition: nvosd.h:180
NvOSD_ColorParams color
Definition: nvosd.h:112
Holds the color parameters of the box or text to be overlayed.
Definition: nvosd.h:61
unsigned int has_bg_color
Holds boolean value indicating whether box has background color.
Definition: nvosd.h:133
unsigned int reserved
reserved field for future usage.
Definition: nvosd.h:168
unsigned int border_width
Holds border_width of the box in pixels.
Definition: nvosd.h:128
double blue
Holds blue component of color.
Definition: nvosd.h:68
double red
Holds red component of color.
Definition: nvosd.h:62
unsigned int font_size
Holds size of the font.
Definition: nvosd.h:83
void * nvosd_create_context(void)
Creates NvOSD context.
NvOSD_FontParams font_params
font_params.
Definition: nvosd.h:101
double green
Holds green component of color.
Definition: nvosd.h:65
Selects GPU for OSD processing.
Definition: nvosd.h:197
NvOSD_ColorParams bg_color
Reserved field for future usage.
Definition: nvosd.h:139
unsigned int xc
Holds start horizontal coordinate in pixels.
Definition: nvosd.h:178