Elffuss BraidHub

kikocis/ncnn public

master · 19.1 KiBRawPermalink
1/* Tencent is pleased to support the open source community by making ncnn available.
2 *
3 * Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
4 *
5 * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
6 * in compliance with the License. You may obtain a copy of the License at
7 *
8 * https://opensource.org/licenses/BSD-3-Clause
9 *
10 * Unless required by applicable law or agreed to in writing, software distributed
11 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 * specific language governing permissions and limitations under the License.
14 */
15
16#ifndef NCNN_C_API_H
17#define NCNN_C_API_H
18
19#include "platform.h"
20
21#if NCNN_C_API
22
23#include <stddef.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29NCNN_EXPORT const char* ncnn_version(void);
30
31/* allocator api */
32typedef struct __ncnn_allocator_t* ncnn_allocator_t;
33struct NCNN_EXPORT __ncnn_allocator_t
34{
35 void* pthis;
36
37 void* (*fast_malloc)(ncnn_allocator_t allocator, size_t size);
38 void (*fast_free)(ncnn_allocator_t allocator, void* ptr);
39};
40
41NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_pool_allocator(void);
42NCNN_EXPORT ncnn_allocator_t ncnn_allocator_create_unlocked_pool_allocator(void);
43NCNN_EXPORT void ncnn_allocator_destroy(ncnn_allocator_t allocator);
44
45/* option api */
46typedef struct __ncnn_option_t* ncnn_option_t;
47
48NCNN_EXPORT ncnn_option_t ncnn_option_create(void);
49NCNN_EXPORT void ncnn_option_destroy(ncnn_option_t opt);
50
51NCNN_EXPORT int ncnn_option_get_num_threads(const ncnn_option_t opt);
52NCNN_EXPORT void ncnn_option_set_num_threads(ncnn_option_t opt, int num_threads);
53
54NCNN_EXPORT int ncnn_option_get_use_local_pool_allocator(const ncnn_option_t opt);
55NCNN_EXPORT void ncnn_option_set_use_local_pool_allocator(ncnn_option_t opt, int use_local_pool_allocator);
56
57NCNN_EXPORT void ncnn_option_set_blob_allocator(ncnn_option_t opt, ncnn_allocator_t allocator);
58NCNN_EXPORT void ncnn_option_set_workspace_allocator(ncnn_option_t opt, ncnn_allocator_t allocator);
59
60NCNN_EXPORT int ncnn_option_get_use_vulkan_compute(const ncnn_option_t opt);
61NCNN_EXPORT void ncnn_option_set_use_vulkan_compute(ncnn_option_t opt, int use_vulkan_compute);
62
63/* mat api */
64typedef struct __ncnn_mat_t* ncnn_mat_t;
65
66NCNN_EXPORT ncnn_mat_t ncnn_mat_create(void);
67NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d(int w, ncnn_allocator_t allocator);
68NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d(int w, int h, ncnn_allocator_t allocator);
69NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d(int w, int h, int c, ncnn_allocator_t allocator);
70NCNN_EXPORT ncnn_mat_t ncnn_mat_create_4d(int w, int h, int d, int c, ncnn_allocator_t allocator);
71NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_1d(int w, void* data, ncnn_allocator_t allocator);
72NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_2d(int w, int h, void* data, ncnn_allocator_t allocator);
73NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_3d(int w, int h, int c, void* data, ncnn_allocator_t allocator);
74NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_4d(int w, int h, int d, int c, void* data, ncnn_allocator_t allocator);
75NCNN_EXPORT ncnn_mat_t ncnn_mat_create_1d_elem(int w, size_t elemsize, int elempack, ncnn_allocator_t allocator);
76NCNN_EXPORT ncnn_mat_t ncnn_mat_create_2d_elem(int w, int h, size_t elemsize, int elempack, ncnn_allocator_t allocator);
77NCNN_EXPORT ncnn_mat_t ncnn_mat_create_3d_elem(int w, int h, int c, size_t elemsize, int elempack, ncnn_allocator_t allocator);
78NCNN_EXPORT ncnn_mat_t ncnn_mat_create_4d_elem(int w, int h, int d, int c, size_t elemsize, int elempack, ncnn_allocator_t allocator);
79NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_1d_elem(int w, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator);
80NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_2d_elem(int w, int h, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator);
81NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_3d_elem(int w, int h, int c, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator);
82NCNN_EXPORT ncnn_mat_t ncnn_mat_create_external_4d_elem(int w, int h, int d, int c, void* data, size_t elemsize, int elempack, ncnn_allocator_t allocator);
83NCNN_EXPORT void ncnn_mat_destroy(ncnn_mat_t mat);
84
85NCNN_EXPORT void ncnn_mat_fill_float(ncnn_mat_t mat, float v);
86
87NCNN_EXPORT ncnn_mat_t ncnn_mat_clone(const ncnn_mat_t mat, ncnn_allocator_t allocator);
88NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_1d(const ncnn_mat_t mat, int w, ncnn_allocator_t allocator);
89NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_2d(const ncnn_mat_t mat, int w, int h, ncnn_allocator_t allocator);
90NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_3d(const ncnn_mat_t mat, int w, int h, int c, ncnn_allocator_t allocator);
91NCNN_EXPORT ncnn_mat_t ncnn_mat_reshape_4d(const ncnn_mat_t mat, int w, int h, int d, int c, ncnn_allocator_t allocator);
92
93NCNN_EXPORT int ncnn_mat_get_dims(const ncnn_mat_t mat);
94NCNN_EXPORT int ncnn_mat_get_w(const ncnn_mat_t mat);
95NCNN_EXPORT int ncnn_mat_get_h(const ncnn_mat_t mat);
96NCNN_EXPORT int ncnn_mat_get_d(const ncnn_mat_t mat);
97NCNN_EXPORT int ncnn_mat_get_c(const ncnn_mat_t mat);
98NCNN_EXPORT size_t ncnn_mat_get_elemsize(const ncnn_mat_t mat);
99NCNN_EXPORT int ncnn_mat_get_elempack(const ncnn_mat_t mat);
100NCNN_EXPORT size_t ncnn_mat_get_cstep(const ncnn_mat_t mat);
101NCNN_EXPORT void* ncnn_mat_get_data(const ncnn_mat_t mat);
102
103NCNN_EXPORT void* ncnn_mat_get_channel_data(const ncnn_mat_t mat, int c);
104
105#if NCNN_PIXEL
106
107/* mat pixel api */
108#define NCNN_MAT_PIXEL_RGB 1
109#define NCNN_MAT_PIXEL_BGR 2
110#define NCNN_MAT_PIXEL_GRAY 3
111#define NCNN_MAT_PIXEL_RGBA 4
112#define NCNN_MAT_PIXEL_BGRA 5
113#define NCNN_MAT_PIXEL_X2Y(X, Y) (X | (Y << 16))
114NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels(const unsigned char* pixels, int type, int w, int h, int stride, ncnn_allocator_t allocator);
115NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_resize(const unsigned char* pixels, int type, int w, int h, int stride, int target_width, int target_height, ncnn_allocator_t allocator);
116NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_roi(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, ncnn_allocator_t allocator);
117NCNN_EXPORT ncnn_mat_t ncnn_mat_from_pixels_roi_resize(const unsigned char* pixels, int type, int w, int h, int stride, int roix, int roiy, int roiw, int roih, int target_width, int target_height, ncnn_allocator_t allocator);
118NCNN_EXPORT void ncnn_mat_to_pixels(const ncnn_mat_t mat, unsigned char* pixels, int type, int stride);
119NCNN_EXPORT void ncnn_mat_to_pixels_resize(const ncnn_mat_t mat, unsigned char* pixels, int type, int target_width, int target_height, int target_stride);
120
121#endif /* NCNN_PIXEL */
122
123NCNN_EXPORT void ncnn_mat_substract_mean_normalize(ncnn_mat_t mat, const float* mean_vals, const float* norm_vals);
124
125NCNN_EXPORT void ncnn_convert_packing(const ncnn_mat_t src, ncnn_mat_t* dst, int elempack, const ncnn_option_t opt);
126NCNN_EXPORT void ncnn_flatten(const ncnn_mat_t src, ncnn_mat_t* dst, const ncnn_option_t opt);
127
128/* blob api */
129typedef struct __ncnn_blob_t* ncnn_blob_t;
130
131#if NCNN_STRING
132NCNN_EXPORT const char* ncnn_blob_get_name(const ncnn_blob_t blob);
133#endif /* NCNN_STRING */
134
135NCNN_EXPORT int ncnn_blob_get_producer(const ncnn_blob_t blob);
136NCNN_EXPORT int ncnn_blob_get_consumer(const ncnn_blob_t blob);
137
138NCNN_EXPORT void ncnn_blob_get_shape(const ncnn_blob_t blob, int* dims, int* w, int* h, int* c);
139
140/* paramdict api */
141typedef struct __ncnn_paramdict_t* ncnn_paramdict_t;
142
143NCNN_EXPORT ncnn_paramdict_t ncnn_paramdict_create(void);
144NCNN_EXPORT void ncnn_paramdict_destroy(ncnn_paramdict_t pd);
145
146NCNN_EXPORT int ncnn_paramdict_get_type(const ncnn_paramdict_t pd, int id);
147
148NCNN_EXPORT int ncnn_paramdict_get_int(const ncnn_paramdict_t pd, int id, int def);
149NCNN_EXPORT float ncnn_paramdict_get_float(const ncnn_paramdict_t pd, int id, float def);
150NCNN_EXPORT ncnn_mat_t ncnn_paramdict_get_array(const ncnn_paramdict_t pd, int id, const ncnn_mat_t def);
151
152NCNN_EXPORT void ncnn_paramdict_set_int(ncnn_paramdict_t pd, int id, int i);
153NCNN_EXPORT void ncnn_paramdict_set_float(ncnn_paramdict_t pd, int id, float f);
154NCNN_EXPORT void ncnn_paramdict_set_array(ncnn_paramdict_t pd, int id, const ncnn_mat_t v);
155
156/* datareader api */
157typedef struct __ncnn_datareader_t* ncnn_datareader_t;
158struct NCNN_EXPORT __ncnn_datareader_t
159{
160 void* pthis;
161
162#if NCNN_STRING
163 int (*scan)(ncnn_datareader_t dr, const char* format, void* p);
164#endif /* NCNN_STRING */
165 size_t (*read)(ncnn_datareader_t dr, void* buf, size_t size);
166};
167
168NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create(void);
169#if NCNN_STDIO
170NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_stdio(FILE* fp);
171#endif /* NCNN_STDIO */
172NCNN_EXPORT ncnn_datareader_t ncnn_datareader_create_from_memory(const unsigned char** mem);
173NCNN_EXPORT void ncnn_datareader_destroy(ncnn_datareader_t dr);
174
175/* modelbin api */
176typedef struct __ncnn_modelbin_t* ncnn_modelbin_t;
177struct NCNN_EXPORT __ncnn_modelbin_t
178{
179 void* pthis;
180
181 ncnn_mat_t (*load_1d)(const ncnn_modelbin_t mb, int w, int type);
182 ncnn_mat_t (*load_2d)(const ncnn_modelbin_t mb, int w, int h, int type);
183 ncnn_mat_t (*load_3d)(const ncnn_modelbin_t mb, int w, int h, int c, int type);
184};
185
186NCNN_EXPORT ncnn_modelbin_t ncnn_modelbin_create_from_datareader(const ncnn_datareader_t dr);
187NCNN_EXPORT ncnn_modelbin_t ncnn_modelbin_create_from_mat_array(const ncnn_mat_t* weights, int n);
188NCNN_EXPORT void ncnn_modelbin_destroy(ncnn_modelbin_t mb);
189
190/* layer api */
191typedef struct __ncnn_layer_t* ncnn_layer_t;
192struct NCNN_EXPORT __ncnn_layer_t
193{
194 void* pthis;
195
196 int (*load_param)(ncnn_layer_t layer, const ncnn_paramdict_t pd);
197 int (*load_model)(ncnn_layer_t layer, const ncnn_modelbin_t mb);
198
199 int (*create_pipeline)(ncnn_layer_t layer, const ncnn_option_t opt);
200 int (*destroy_pipeline)(ncnn_layer_t layer, const ncnn_option_t opt);
201
202 int (*forward_1)(const ncnn_layer_t layer, const ncnn_mat_t bottom_blob, ncnn_mat_t* top_blob, const ncnn_option_t opt);
203 int (*forward_n)(const ncnn_layer_t layer, const ncnn_mat_t* bottom_blobs, int n, ncnn_mat_t* top_blobs, int n2, const ncnn_option_t opt);
204
205 int (*forward_inplace_1)(const ncnn_layer_t layer, ncnn_mat_t bottom_top_blob, const ncnn_option_t opt);
206 int (*forward_inplace_n)(const ncnn_layer_t layer, ncnn_mat_t* bottom_top_blobs, int n, const ncnn_option_t opt);
207};
208
209NCNN_EXPORT ncnn_layer_t ncnn_layer_create(void);
210NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_typeindex(int typeindex);
211#if NCNN_STRING
212NCNN_EXPORT ncnn_layer_t ncnn_layer_create_by_type(const char* type);
213NCNN_EXPORT int ncnn_layer_type_to_index(const char* type);
214#endif /* NCNN_STRING */
215NCNN_EXPORT void ncnn_layer_destroy(ncnn_layer_t layer);
216
217#if NCNN_STRING
218NCNN_EXPORT const char* ncnn_layer_get_name(const ncnn_layer_t layer);
219#endif /* NCNN_STRING */
220
221NCNN_EXPORT int ncnn_layer_get_typeindex(const ncnn_layer_t layer);
222#if NCNN_STRING
223NCNN_EXPORT const char* ncnn_layer_get_type(const ncnn_layer_t layer);
224#endif /* NCNN_STRING */
225
226NCNN_EXPORT int ncnn_layer_get_one_blob_only(const ncnn_layer_t layer);
227NCNN_EXPORT int ncnn_layer_get_support_inplace(const ncnn_layer_t layer);
228NCNN_EXPORT int ncnn_layer_get_support_vulkan(const ncnn_layer_t layer);
229NCNN_EXPORT int ncnn_layer_get_support_packing(const ncnn_layer_t layer);
230NCNN_EXPORT int ncnn_layer_get_support_bf16_storage(const ncnn_layer_t layer);
231NCNN_EXPORT int ncnn_layer_get_support_fp16_storage(const ncnn_layer_t layer);
232NCNN_EXPORT int ncnn_layer_get_support_image_storage(const ncnn_layer_t layer);
233
234NCNN_EXPORT void ncnn_layer_set_one_blob_only(ncnn_layer_t layer, int enable);
235NCNN_EXPORT void ncnn_layer_set_support_inplace(ncnn_layer_t layer, int enable);
236NCNN_EXPORT void ncnn_layer_set_support_vulkan(ncnn_layer_t layer, int enable);
237NCNN_EXPORT void ncnn_layer_set_support_packing(ncnn_layer_t layer, int enable);
238NCNN_EXPORT void ncnn_layer_set_support_bf16_storage(ncnn_layer_t layer, int enable);
239NCNN_EXPORT void ncnn_layer_set_support_fp16_storage(ncnn_layer_t layer, int enable);
240NCNN_EXPORT void ncnn_layer_set_support_image_storage(ncnn_layer_t layer, int enable);
241
242NCNN_EXPORT int ncnn_layer_get_bottom_count(const ncnn_layer_t layer);
243NCNN_EXPORT int ncnn_layer_get_bottom(const ncnn_layer_t layer, int i);
244NCNN_EXPORT int ncnn_layer_get_top_count(const ncnn_layer_t layer);
245NCNN_EXPORT int ncnn_layer_get_top(const ncnn_layer_t layer, int i);
246
247NCNN_EXPORT void ncnn_blob_get_bottom_shape(const ncnn_layer_t layer, int i, int* dims, int* w, int* h, int* c);
248NCNN_EXPORT void ncnn_blob_get_top_shape(const ncnn_layer_t layer, int i, int* dims, int* w, int* h, int* c);
249
250/* layer factory function */
251typedef ncnn_layer_t (*ncnn_layer_creator_t)(void* userdata);
252typedef void (*ncnn_layer_destroyer_t)(ncnn_layer_t layer, void* userdata);
253
254typedef struct __ncnn_net_custom_layer_factory_t* ncnn_net_custom_layer_factory_t;
255struct __ncnn_net_custom_layer_factory_t
256{
257 ncnn_layer_creator_t creator;
258 ncnn_layer_destroyer_t destroyer;
259 void* userdata;
260 ncnn_net_custom_layer_factory_t next;
261};
262
263/* net api */
264typedef struct __ncnn_net_t* ncnn_net_t;
265struct __ncnn_net_t
266{
267 void* pthis;
268
269 ncnn_net_custom_layer_factory_t custom_layer_factory;
270};
271
272NCNN_EXPORT ncnn_net_t ncnn_net_create(void);
273NCNN_EXPORT void ncnn_net_destroy(ncnn_net_t net);
274
275NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net);
276NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt);
277
278#if NCNN_VULKAN
279NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index);
280#endif
281
282#if NCNN_STRING
283NCNN_EXPORT void ncnn_net_register_custom_layer_by_type(ncnn_net_t net, const char* type, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata);
284#endif /* NCNN_STRING */
285NCNN_EXPORT void ncnn_net_register_custom_layer_by_typeindex(ncnn_net_t net, int typeindex, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata);
286
287#if NCNN_STDIO
288#if NCNN_STRING
289NCNN_EXPORT int ncnn_net_load_param(ncnn_net_t net, const char* path);
290#endif /* NCNN_STRING */
291NCNN_EXPORT int ncnn_net_load_param_bin(ncnn_net_t net, const char* path);
292NCNN_EXPORT int ncnn_net_load_model(ncnn_net_t net, const char* path);
293#endif /* NCNN_STDIO */
294
295#if NCNN_STDIO
296#if NCNN_STRING
297NCNN_EXPORT int ncnn_net_load_param_memory(ncnn_net_t net, const char* mem);
298#endif /* NCNN_STRING */
299#endif /* NCNN_STDIO */
300NCNN_EXPORT int ncnn_net_load_param_bin_memory(ncnn_net_t net, const unsigned char* mem);
301NCNN_EXPORT int ncnn_net_load_model_memory(ncnn_net_t net, const unsigned char* mem);
302
303#if NCNN_STRING
304NCNN_EXPORT int ncnn_net_load_param_datareader(ncnn_net_t net, const ncnn_datareader_t dr);
305#endif /* NCNN_STRING */
306NCNN_EXPORT int ncnn_net_load_param_bin_datareader(ncnn_net_t net, const ncnn_datareader_t dr);
307NCNN_EXPORT int ncnn_net_load_model_datareader(ncnn_net_t net, const ncnn_datareader_t dr);
308
309NCNN_EXPORT void ncnn_net_clear(ncnn_net_t net);
310
311NCNN_EXPORT int ncnn_net_get_input_count(const ncnn_net_t net);
312NCNN_EXPORT int ncnn_net_get_output_count(const ncnn_net_t net);
313#if NCNN_STRING
314NCNN_EXPORT const char* ncnn_net_get_input_name(const ncnn_net_t net, int i);
315NCNN_EXPORT const char* ncnn_net_get_output_name(const ncnn_net_t net, int i);
316#endif /* NCNN_STRING */
317NCNN_EXPORT int ncnn_net_get_input_index(const ncnn_net_t net, int i);
318NCNN_EXPORT int ncnn_net_get_output_index(const ncnn_net_t net, int i);
319
320/* extractor api */
321typedef struct __ncnn_extractor_t* ncnn_extractor_t;
322
323NCNN_EXPORT ncnn_extractor_t ncnn_extractor_create(ncnn_net_t net);
324NCNN_EXPORT void ncnn_extractor_destroy(ncnn_extractor_t ex);
325
326NCNN_EXPORT void ncnn_extractor_set_option(ncnn_extractor_t ex, const ncnn_option_t opt);
327
328#if NCNN_STRING
329NCNN_EXPORT int ncnn_extractor_input(ncnn_extractor_t ex, const char* name, const ncnn_mat_t mat);
330NCNN_EXPORT int ncnn_extractor_extract(ncnn_extractor_t ex, const char* name, ncnn_mat_t* mat);
331#endif /* NCNN_STRING */
332NCNN_EXPORT int ncnn_extractor_input_index(ncnn_extractor_t ex, int index, const ncnn_mat_t mat);
333NCNN_EXPORT int ncnn_extractor_extract_index(ncnn_extractor_t ex, int index, ncnn_mat_t* mat);
334
335/* mat process api */
336#define NCNN_BORDER_CONSTANT 0
337#define NCNN_BORDER_REPLICATE 1
338#define NCNN_BORDER_REFLECT 2
339#define NCNN_BORDER_TRANSPARENT -233
340NCNN_EXPORT void ncnn_copy_make_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int type, float v, const ncnn_option_t opt);
341NCNN_EXPORT void ncnn_copy_make_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, int type, float v, const ncnn_option_t opt);
342NCNN_EXPORT void ncnn_copy_cut_border(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, const ncnn_option_t opt);
343NCNN_EXPORT void ncnn_copy_cut_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int bottom, int left, int right, int front, int behind, const ncnn_option_t opt);
344
345#if NCNN_PIXEL_DRAWING
346/* mat pixel drawing api*/
347NCNN_EXPORT void ncnn_draw_rectangle_c1(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
348NCNN_EXPORT void ncnn_draw_rectangle_c2(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
349NCNN_EXPORT void ncnn_draw_rectangle_c3(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
350NCNN_EXPORT void ncnn_draw_rectangle_c4(unsigned char* pixels, int w, int h, int rx, int ry, int rw, int rh, unsigned int color, int thickness);
351
352NCNN_EXPORT void ncnn_draw_text_c1(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
353NCNN_EXPORT void ncnn_draw_text_c2(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
354NCNN_EXPORT void ncnn_draw_text_c3(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
355NCNN_EXPORT void ncnn_draw_text_c4(unsigned char* pixels, int w, int h, const char* text, int x, int y, int fontpixelsize, unsigned int color);
356
357NCNN_EXPORT void ncnn_draw_circle_c1(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
358NCNN_EXPORT void ncnn_draw_circle_c2(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
359NCNN_EXPORT void ncnn_draw_circle_c3(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
360NCNN_EXPORT void ncnn_draw_circle_c4(unsigned char* pixels, int w, int h, int cx, int cy, int radius, unsigned int color, int thickness);
361
362NCNN_EXPORT void ncnn_draw_line_c1(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
363NCNN_EXPORT void ncnn_draw_line_c2(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
364NCNN_EXPORT void ncnn_draw_line_c3(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
365NCNN_EXPORT void ncnn_draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int x1, int y1, unsigned int color, int thickness);
366#endif /* NCNN_PIXEL_DRAWING */
367
368#ifdef __cplusplus
369} /* extern "C" */
370#endif
371
372#endif /* NCNN_C_API */
373
374#endif /* NCNN_C_API_H */