L4T Multimedia API Reference

27.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, 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 
62 typedef struct _NvOSD_ColorParams {
63  double red;
66  double green;
69  double blue;
72  double alpha;
75 
76 
80 typedef struct _NvOSD_FontParams {
81  char * font_name;
84  unsigned int font_size;
88 
89 
94 typedef struct _NvOSD_TextParams {
95  char * display_text;
97  unsigned int x_offset;
99  unsigned int y_offset;
104 
105 
109 typedef struct _NvOSD_RectParams {
110  unsigned int left;
112  unsigned int top;
114  unsigned int width;
116  unsigned int height;
118  unsigned int border_width;
123  unsigned int has_bg_color;
126  unsigned int reserved;
131 
135 typedef enum{
144 } NvOSD_Mode;
145 
151 void *nvosd_create_context(void);
152 
159 void nvosd_destroy_context(void *nvosd_ctx);
160 
172 void nvosd_set_clock_params(void *nvosd_ctx, NvOSD_TextParams *clk_params);
173 
174 
195 int nvosd_put_text(void *nvosd_ctx, NvOSD_Mode mode, int fd, int num_strings,
196  NvOSD_TextParams *text_params_list);
197 
198 
227 int nvosd_draw_rectangles(void *nvosd_ctx, NvOSD_Mode mode, int fd,
228  int num_rects, NvOSD_RectParams *rect_params_list);
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
234 #endif
struct _NvOSD_ColorParams NvOSD_ColorParams
Holds the color parameters of the box or text to be overlayed.
unsigned int y_offset
Holds vertical offset w.r.t top left pixel of the frame.
Definition: nvosd.h:99
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:80
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:109
unsigned int top
Holds top coordinate of the box in pixels.
Definition: nvosd.h:112
void nvosd_destroy_context(void *nvosd_ctx)
Destroys NvOSD context.
unsigned int height
Holds height of the box in pixels.
Definition: nvosd.h:116
NvOSD_ColorParams border_color
Holds color params of the border of the box.
Definition: nvosd.h:120
unsigned int reserved
Definition: nvosd.h:126
NvOSD_Mode
List modes used to overlay boxes and text.
Definition: nvosd.h:135
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:97
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:95
unsigned int left
Holds left coordinate of the box in pixels.
Definition: nvosd.h:110
double alpha
Holds alpha component of color.
Definition: nvosd.h:72
Selects NV HW engine for rectangle draw and mask.
Definition: nvosd.h:140
char * font_name
Holds pointer to the string containing font name.
Definition: nvosd.h:81
NvOSD_ColorParams font_color
Holds font color.
Definition: nvosd.h:86
struct _NvOSD_RectParams NvOSD_RectParams
Holds the box parameters of the box to be overlayed.
Holds the text parameters of the text to be overlayed.
Definition: nvosd.h:94
struct _NvOSD_FontParams NvOSD_FontParams
Holds the font parameters of the text to be overlayed.
Selects CPU for OSD processing.
Definition: nvosd.h:136
unsigned int width
Holds width of the box in pixels.
Definition: nvosd.h:114
Holds the color parameters of the box or text to be overlayed.
Definition: nvosd.h:62
unsigned int has_bg_color
Holds boolean value indicating whether box has background color.
Definition: nvosd.h:123
unsigned int border_width
Holds border_width of the box in pixels.
Definition: nvosd.h:118
double blue
Holds blue component of color.
Definition: nvosd.h:69
double red
Holds red component of color.
Definition: nvosd.h:63
unsigned int font_size
Holds size of the font.
Definition: nvosd.h:84
void * nvosd_create_context(void)
Creates NvOSD context.
NvOSD_FontParams font_params
font_params.
Definition: nvosd.h:102
double green
Holds green component of color.
Definition: nvosd.h:66
Selects GPU for OSD processing.
Definition: nvosd.h:138
NvOSD_ColorParams bg_color
Reserved field for future usage.
Definition: nvosd.h:129