1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
#pragma once
#include <gpu/buffer.hpp>
#include "gpu/surface.hpp"
#include <gpu/stream.hpp>
#include <inttypes.h>
namespace VideoStitch {
namespace Render {
/**
* @brief A set of geometric primitives.
*/
/**
* Draw a line onto a buffer
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param aX Start point X.
* @param aX Start point Y.
* @param bX End point X.
* @param bX End point Y.
* @param t Line thickness.
* @param color Line color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawLine(Image& dst, int64_t width, int64_t height, float aX, float aY, float bX, float bY, float t,
uint32_t color, GPU::Stream stream);
/**
* Draw a disk onto a buffer.
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param aX Center X.
* @param aX Center Y.
* @param t Square radius.
* @param color Line color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawDisk(Image& dst, int64_t width, int64_t height, float aX, float aY, float t, uint32_t color,
GPU::Stream stream);
/**
* A kernel that overlays a circle.
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param centerX Circle center position on the x axis.
* @param centerY Circle center position on the y axis.
* @param sqrRadius Circle radius, squared.
* @param t Circle thickness.
* @param color Circle color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawCircle(Image& dst, int64_t width, int64_t height, float centerX, float centerY, float innerSqrRadius,
float outerSqrRadius, uint32_t color, GPU::Stream stream);
/**
* A kernel that overlays a circle, top only
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param centerX Circle center position on the x axis.
* @param centerY Circle center position on the y axis.
* @param sqrRadius Circle radius, squared.
* @param t Circle thickness.
* @param color Circle color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawCircleTop(Image& dst, int64_t width, int64_t height, float centerX, float centerY, float innerSqrRadius,
float outerSqrRadius, uint32_t color, GPU::Stream stream);
/**
* A kernel that overlays a circle, bottom only
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param centerX Circle center position on the x axis.
* @param centerY Circle center position on the y axis.
* @param sqrRadius Circle radius, squared.
* @param t Circle thickness.
* @param color Circle color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawCircleBottom(Image& dst, int64_t width, int64_t height, float centerX, float centerY, float innerSqrRadius,
float outerSqrRadius, uint32_t color, GPU::Stream stream);
/**
* A kernel that overlays a circle, top right quarter only
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param centerX Circle center position on the x axis.
* @param centerY Circle center position on the y axis.
* @param sqrRadius Circle radius, squared.
* @param t Circle thickness.
* @param color Circle color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawCircleTopRight(Image& dst, int64_t width, int64_t height, float centerX, float centerY, float innerSqrRadius,
float outerSqrRadius, uint32_t color, GPU::Stream stream);
/**
* A kernel that overlays a circle, top right quarter only
* @param dst Destination buffer
* @param width Destination buffer width.
* @param height Destination buffer height.
* @param centerX Circle center position on the x axis.
* @param centerY Circle center position on the y axis.
* @param sqrRadius Circle radius, squared.
* @param t Circle thickness.
* @param color Circle color.
* @param stream GPU Stream to run in.
*/
template <typename Image>
Status drawCircleBottomRight(Image& dst, int64_t width, int64_t height, float centerX, float centerY,
float innerSqrRadius, float outerSqrRadius, uint32_t color, GPU::Stream stream);
} // namespace Render
} // namespace VideoStitch