Jetson Inference
DNN Vision Library
cudaDraw.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __CUDA_DRAW_H__
24 #define __CUDA_DRAW_H__
25 
26 
27 #include "cudaUtility.h"
28 #include "imageFormat.h"
29 
30 
35 cudaError_t cudaDrawCircle( void* input, void* output, size_t width, size_t height, imageFormat format,
36  int cx, int cy, float radius, const float4& color );
37 
42 template<typename T>
43 cudaError_t cudaDrawCircle( T* input, T* output, size_t width, size_t height,
44  int cx, int cy, float radius, const float4& color )
45 {
46  return cudaDrawCircle(input, output, width, height, imageFormatFromType<T>(), cx, cy, radius, color);
47 }
48 
53 cudaError_t cudaDrawCircle( void* image, size_t width, size_t height, imageFormat format,
54  int cx, int cy, float radius, const float4& color )
55 {
56  return cudaDrawCircle(image, image, width, height, format, cx, cy, radius, color);
57 }
58 
63 template<typename T>
64 cudaError_t cudaDrawCircle( T* image, size_t width, size_t height,
65  int cx, int cy, float radius, const float4& color )
66 {
67  return cudaDrawCircle(image, width, height, imageFormatFromType<T>(), cx, cy, radius, color);
68 }
69 
70 
75 cudaError_t cudaDrawLine( void* input, void* output, size_t width, size_t height, imageFormat format,
76  int x1, int y1, int x2, int y2, const float4& color, float line_width=1.0 );
77 
82 template<typename T>
83 cudaError_t cudaDrawLine( T* input, T* output, size_t width, size_t height,
84  int x1, int y1, int x2, int y2, const float4& color, float line_width=1.0 )
85 {
86  return cudaDrawLine(input, output, width, height, imageFormatFromType<T>(), x1, y1, x2, y2, color, line_width);
87 }
88 
93 cudaError_t cudaDrawLine( void* image, size_t width, size_t height, imageFormat format,
94  int x1, int y1, int x2, int y2, const float4& color, float line_width=1.0 )
95 {
96  return cudaDrawLine(image, image, width, height, format, x1, y1, x2, y2, color, line_width);
97 }
98 
103 template<typename T>
104 cudaError_t cudaDrawLine( T* image, size_t width, size_t height,
105  int x1, int y1, int x2, int y2, const float4& color, float line_width=1.0 )
106 {
107  return cudaDrawLine(image, width, height, imageFormatFromType<T>(), x1, y1, x2, y2, color, line_width);
108 }
109 
110 
115 cudaError_t cudaDrawRect( void* input, void* output, size_t width, size_t height, imageFormat format,
116  int left, int top, int right, int bottom, const float4& color );
117 
122 template<typename T>
123 cudaError_t cudaDrawRect( T* input, T* output, size_t width, size_t height,
124  int left, int top, int right, int bottom, const float4& color )
125 {
126  return cudaDrawRect(input, output, width, height, imageFormatFromType<T>(), left, top, right, bottom, color);
127 }
128 
133 cudaError_t cudaDrawRect( void* image, size_t width, size_t height, imageFormat format,
134  int left, int top, int right, int bottom, const float4& color )
135 {
136  return cudaDrawRect(image, image, width, height, format, left, top, right, bottom, color);
137 }
138 
143 template<typename T>
144 cudaError_t cudaDrawRect( T* image, size_t width, size_t height,
145  int left, int top, int right, int bottom, const float4& color )
146 {
147  return cudaDrawRect(image, image, width, height, imageFormatFromType<T>(), left, top, right, bottom, color);
148 }
149 
150 #endif
cudaError_t cudaDrawLine(void *input, void *output, size_t width, size_t height, imageFormat format, int x1, int y1, int x2, int y2, const float4 &color, float line_width=1.0)
cudaDrawLine
cudaError_t cudaDrawRect(void *input, void *output, size_t width, size_t height, imageFormat format, int left, int top, int right, int bottom, const float4 &color)
cudaDrawRect
cudaError_t cudaDrawCircle(void *input, void *output, size_t width, size_t height, imageFormat format, int cx, int cy, float radius, const float4 &color)
cudaDrawCircle
uchar3 color
The RGB color of the point.
Definition: cudaPointCloud.h:91
imageFormat
The imageFormat enum is used to identify the pixel format and colorspace of an image.
Definition: imageFormat.h:49