L4T Multimedia API Reference

32.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 
149 typedef struct _NvOSD_LineParams {
150  unsigned int x1;
152  unsigned int y1;
154  unsigned int x2;
156  unsigned int y2;
158  unsigned int line_width;
163 
167 typedef struct _NvOSD_ArrowParams {
168  unsigned int x1;
170  unsigned int y1;
172  unsigned int x2;
174  unsigned int y2;
176  unsigned int arrow_width;
178  unsigned int start_arrow_head;
185  unsigned int reserved;
189 
190 
194 typedef struct _NvOSD_CircleParams {
195  unsigned int xc;
197  unsigned int yc;
199  unsigned int radius;
203  unsigned int reserved;
207 
211 typedef enum{
220 } NvOSD_Mode;
221 
227 void *nvosd_create_context(void);
228 
235 void nvosd_destroy_context(void *nvosd_ctx);
236 
248 void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params);
249 
250 
271 int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
272  NvOSD_TextParams *text_params_list);
273 
274 
303 int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
304  int num_rects, NvOSD_RectParams *rect_params_list);
305 
306 int nvosd_init_colors_for_hw_blend(void *nvosd_ctx, NvOSD_Color_info * color_info,
307  int num_classes);
308 
309 
310 int nvosd_draw_arrows(void *nvosd_ctx, NvOSD_Mode mode, int fd,
311  int num_arrows, NvOSD_ArrowParams *arrow_params_list);
312 
313 int nvosd_draw_circles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
314  int num_circles, NvOSD_CircleParams *circle_params_list);
315 
316 #ifdef __cplusplus
317 }
318 #endif
319 
320 #endif
unsigned int x2
Holds width of the box in pixels.
Definition: nvosd.h:154
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:183
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:199
unsigned int y_offset
Holds vertical offset w.r.t top left pixel of the frame.
Definition: nvosd.h:98
unsigned int y2
Holds height of the box in pixels.
Definition: nvosd.h:156
unsigned int line_width
Holds border_width of the box in pixels.
Definition: nvosd.h:158
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:172
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 x1
Holds left coordinate of the box in pixels.
Definition: nvosd.h:150
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:194
unsigned int x1
Holds start horizontal coordinate in pixels.
Definition: nvosd.h:168
unsigned int arrow_width
Holds arrow_width in pixels.
Definition: nvosd.h:176
void nvosd_destroy_context(void *nvosd_ctx)
Destroys NvOSD context.
unsigned int y1
Holds start vertical coordinate in pixels.
Definition: nvosd.h:170
unsigned int height
Holds height of the box in pixels.
Definition: nvosd.h:126
Holds the arrow parameters to be overlayed.
Definition: nvosd.h:167
struct _NvOSD_LineParams NvOSD_LineParams
Holds the box parameters of the line to be overlayed.
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:211
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:201
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
Holds the box parameters of the line to be overlayed.
Definition: nvosd.h:149
Selects NV HW engine for rectangle draw and mask.
Definition: nvosd.h:216
char * font_name
Holds pointer to the string containing font name.
Definition: nvosd.h:80
unsigned int start_arrow_head
Definition: nvosd.h:178
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:174
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:203
Selects CPU for OSD processing.
Definition: nvosd.h:212
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:197
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:185
unsigned int y1
Holds top coordinate of the box in pixels.
Definition: nvosd.h:152
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:214
NvOSD_ColorParams line_color
Holds color params of the border of the box.
Definition: nvosd.h:160
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:195