L4T Multimedia API Reference

28.1 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 
49 #ifndef __NVOSD_DEFS__
50 #define __NVOSD_DEFS__
51 
52 #ifdef __cplusplus
53 extern "C"
54 {
55 #endif
56 
57 #define NVOSD_MAX_NUM_RECTS 128
58 #define MAX_BG_CLR 8
59 
63 typedef struct _NvOSD_ColorParams {
64  double red;
67  double green;
70  double blue;
73  double alpha;
76 
77 
81 typedef struct _NvOSD_FontParams {
82  char * font_name;
85  unsigned int font_size;
89 
90 
95 typedef struct _NvOSD_TextParams {
96  char * display_text;
98  unsigned int x_offset;
100  unsigned int y_offset;
110 
111 
112 typedef struct _NvOSD_Class_info {
113  int id;
116 
117 
121 typedef struct _NvOSD_RectParams {
122  unsigned int left;
124  unsigned int top;
126  unsigned int width;
128  unsigned int height;
130  unsigned int border_width;
135  unsigned int has_bg_color;
138  unsigned int reserved;
144  int class_id;
145 
147 
148 
152 typedef struct _NvOSD_ArrowParams {
153  unsigned int x1;
155  unsigned int y1;
157  unsigned int x2;
159  unsigned int y2;
161  unsigned int arrow_width;
163  unsigned int start_arrow_head;
170  unsigned int reserved;
174 
175 
179 typedef struct _NvOSD_CircleParams {
180  unsigned int xc;
182  unsigned int yc;
184  unsigned int radius;
188  unsigned int reserved;
192 
196 typedef enum{
205 } NvOSD_Mode;
206 
212 void *nvosd_create_context(void);
213 
220 void nvosd_destroy_context(void *nvosd_ctx);
221 
233 void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params);
234 
235 
256 int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
257  NvOSD_TextParams *text_params_list);
258 
259 
288 int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
289  int num_rects, NvOSD_RectParams *rect_params_list);
290 
291 int nvosd_init_class_clrs(void *nvosd_ctx, NvOSD_Class_info * class_info,
292  int num_classes);
293 
294 
295 int nvosd_draw_arrows(void *nvosd_ctx, NvOSD_Mode mode, int fd,
296  int num_arrows, NvOSD_ArrowParams *arrow_params_list);
297 
298 int nvosd_draw_circles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
299  int num_circles, NvOSD_CircleParams *circle_params_list);
300 
301 #ifdef __cplusplus
302 }
303 #endif
304 
305 #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:168
struct _NvOSD_ColorParams NvOSD_ColorParams
Holds the color parameters of the box or text to be overlayed.
struct _NvOSD_CircleParams NvOSD_CircleParams
Holds the circle parameters to be overlayed.
struct _NvOSD_Class_info NvOSD_Class_info
unsigned int radius
Holds radius of circle in pixels.
Definition: nvosd.h:184
unsigned int y_offset
Holds vertical offset w.r.t top left pixel of the frame.
Definition: nvosd.h:100
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:81
unsigned int x2
Holds end horizontal coordinate in pixels.
Definition: nvosd.h:157
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:121
unsigned int top
Holds top coordinate of the box in pixels.
Definition: nvosd.h:124
Holds the circle parameters to be overlayed.
Definition: nvosd.h:179
unsigned int x1
Holds start horizontal coordinate in pixels.
Definition: nvosd.h:153
unsigned int arrow_width
Holds arrow_width in pixels.
Definition: nvosd.h:161
void nvosd_destroy_context(void *nvosd_ctx)
Destroys NvOSD context.
unsigned int y1
Holds start vertical coordinate in pixels.
Definition: nvosd.h:155
unsigned int height
Holds height of the box in pixels.
Definition: nvosd.h:128
NvOSD_ColorParams class_clr
Definition: nvosd.h:114
Holds the arrow parameters to be overlayed.
Definition: nvosd.h:152
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:132
unsigned int reserved
Definition: nvosd.h:138
NvOSD_Mode
List modes used to overlay boxes and text.
Definition: nvosd.h:196
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:98
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:96
NvOSD_ColorParams circle_color
Holds color params of the arrow box.
Definition: nvosd.h:186
unsigned int left
Holds left coordinate of the box in pixels.
Definition: nvosd.h:122
double alpha
Holds alpha component of color.
Definition: nvosd.h:73
Selects NV HW engine for rectangle draw and mask.
Definition: nvosd.h:201
char * font_name
Holds pointer to the string containing font name.
Definition: nvosd.h:82
unsigned int start_arrow_head
Definition: nvosd.h:163
int nvosd_init_class_clrs(void *nvosd_ctx, NvOSD_Class_info *class_info, int num_classes)
NvOSD_ColorParams font_color
Holds font color.
Definition: nvosd.h:87
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:105
NvOSD_ColorParams text_bg_clr
Background color for text.
Definition: nvosd.h:107
Holds the text parameters of the text to be overlayed.
Definition: nvosd.h:95
unsigned int y2
Holds end vertical coordinate in pixels.
Definition: nvosd.h:159
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:188
Selects CPU for OSD processing.
Definition: nvosd.h:197
unsigned int width
Holds width of the box in pixels.
Definition: nvosd.h:126
unsigned int yc
Holds start vertical coordinate in pixels.
Definition: nvosd.h:182
Holds the color parameters of the box or text to be overlayed.
Definition: nvosd.h:63
unsigned int has_bg_color
Holds boolean value indicating whether box has background color.
Definition: nvosd.h:135
unsigned int reserved
reserved field for future usage.
Definition: nvosd.h:170
unsigned int border_width
Holds border_width of the box in pixels.
Definition: nvosd.h:130
double blue
Holds blue component of color.
Definition: nvosd.h:70
double red
Holds red component of color.
Definition: nvosd.h:64
int has_class_info
Definition: nvosd.h:143
unsigned int font_size
Holds size of the font.
Definition: nvosd.h:85
void * nvosd_create_context(void)
Creates NvOSD context.
NvOSD_FontParams font_params
font_params.
Definition: nvosd.h:103
double green
Holds green component of color.
Definition: nvosd.h:67
Selects GPU for OSD processing.
Definition: nvosd.h:199
NvOSD_ColorParams bg_color
Reserved field for future usage.
Definition: nvosd.h:141
unsigned int xc
Holds start horizontal coordinate in pixels.
Definition: nvosd.h:180