From ddd17dd90779fa5138a500a6ed5178a79a71c42b Mon Sep 17 00:00:00 2001 From: Shatyuka <958182453@qq.com> Date: Sat, 24 Feb 2024 11:52:50 +0800 Subject: [PATCH] Fix build error with NCNN_PIXEL_DRAWING off (#5346) --- src/c_api.cpp | 2 ++ src/c_api.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/c_api.cpp b/src/c_api.cpp index 7b40042d692..5662d1b5155 100644 --- a/src/c_api.cpp +++ b/src/c_api.cpp @@ -1458,6 +1458,7 @@ void ncnn_copy_cut_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, int top, int copy_cut_border_3d(*(const Mat*)src, *(Mat*)dst, top, bottom, left, right, front, behind, _opt); } +#if NCNN_PIXEL_DRAWING 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) { ncnn::draw_rectangle_c1(pixels, w, h, w, rx, ry, rw, rh, color, thickness); @@ -1537,6 +1538,7 @@ void ncnn_draw_line_c4(unsigned char* pixels, int w, int h, int x0, int y0, int { ncnn::draw_line_c4(pixels, w, h, w * 4, x0, y0, x1, y1, color, thickness); } +#endif /* NCNN_PIXEL_DRAWING */ #ifdef __cplusplus } /* extern "C" */ diff --git a/src/c_api.h b/src/c_api.h index 28949083265..ddd8bfff20c 100644 --- a/src/c_api.h +++ b/src/c_api.h @@ -338,6 +338,7 @@ NCNN_EXPORT void ncnn_copy_make_border_3d(const ncnn_mat_t src, ncnn_mat_t dst, NCNN_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); NCNN_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); +#if NCNN_PIXEL_DRAWING /* mat pixel drawing api*/ NCNN_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); NCNN_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); @@ -358,6 +359,7 @@ NCNN_EXPORT void ncnn_draw_line_c1(unsigned char* pixels, int w, int h, int x0, NCNN_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); NCNN_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); NCNN_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); +#endif /* NCNN_PIXEL_DRAWING */ #ifdef __cplusplus } /* extern "C" */