1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2018-2019 Intel Corporation
9 #if !defined(GAPI_STANDALONE)
11 #include "opencv2/core.hpp"
17 //----------------------------------
19 // Fluid kernels: RGB2Gray, BGR2Gray
21 //----------------------------------
23 void run_rgb2gray_impl(uchar out[], const uchar in[], int width,
24 float coef_r, float coef_g, float coef_b);
26 //--------------------------------------
28 // Fluid kernels: RGB-to-YUV, YUV-to-RGB
30 //--------------------------------------
32 void run_rgb2yuv_impl(uchar out[], const uchar in[], int width, const float coef[5]);
34 void run_yuv2rgb_impl(uchar out[], const uchar in[], int width, const float coef[4]);
36 //-------------------------
38 // Fluid kernels: sepFilter
40 //-------------------------
42 #define RUN_SEPFILTER3X3_IMPL(DST, SRC) \
43 void run_sepfilter3x3_impl(DST out[], const SRC *in[], int width, int chan, \
44 const float kx[], const float ky[], int border, \
45 float scale, float delta, \
46 float *buf[], int y, int y0);
48 RUN_SEPFILTER3X3_IMPL(uchar , uchar )
49 RUN_SEPFILTER3X3_IMPL( short, uchar )
50 RUN_SEPFILTER3X3_IMPL( float, uchar )
51 RUN_SEPFILTER3X3_IMPL(ushort, ushort)
52 RUN_SEPFILTER3X3_IMPL( short, ushort)
53 RUN_SEPFILTER3X3_IMPL( float, ushort)
54 RUN_SEPFILTER3X3_IMPL( short, short)
55 RUN_SEPFILTER3X3_IMPL( float, short)
56 RUN_SEPFILTER3X3_IMPL( float, float)
58 #undef RUN_SEPFILTER3X3_IMPL
60 //-------------------------
62 // Fluid kernels: Filter 2D
64 //-------------------------
66 #define RUN_FILTER2D_3X3_IMPL(DST, SRC) \
67 void run_filter2d_3x3_impl(DST out[], const SRC *in[], int width, int chan, \
68 const float kernel[], float scale, float delta);
70 RUN_FILTER2D_3X3_IMPL(uchar , uchar )
71 RUN_FILTER2D_3X3_IMPL(ushort, ushort)
72 RUN_FILTER2D_3X3_IMPL( short, short)
73 RUN_FILTER2D_3X3_IMPL( float, uchar )
74 RUN_FILTER2D_3X3_IMPL( float, ushort)
75 RUN_FILTER2D_3X3_IMPL( float, short)
76 RUN_FILTER2D_3X3_IMPL( float, float)
78 #undef RUN_FILTER2D_3X3_IMPL
80 //-----------------------------
82 // Fluid kernels: Erode, Dilate
84 //-----------------------------
86 enum Morphology { M_ERODE, M_DILATE };
88 enum MorphShape { M_FULL, M_CROSS, M_UNDEF };
90 #define RUN_MORPHOLOGY3X3_IMPL(T) \
91 void run_morphology3x3_impl(T out[], const T *in[], int width, int chan, \
92 const uchar k[], MorphShape k_type, \
93 Morphology morphology);
95 RUN_MORPHOLOGY3X3_IMPL(uchar )
96 RUN_MORPHOLOGY3X3_IMPL(ushort)
97 RUN_MORPHOLOGY3X3_IMPL( short)
98 RUN_MORPHOLOGY3X3_IMPL( float)
100 #undef RUN_MORPHOLOGY3X3_IMPL
102 //---------------------------
104 // Fluid kernels: Median blur
106 //---------------------------
108 #define RUN_MEDBLUR3X3_IMPL(T) \
109 void run_medblur3x3_impl(T out[], const T *in[], int width, int chan);
111 RUN_MEDBLUR3X3_IMPL(uchar )
112 RUN_MEDBLUR3X3_IMPL(ushort)
113 RUN_MEDBLUR3X3_IMPL( short)
114 RUN_MEDBLUR3X3_IMPL( float)
116 #undef RUN_MEDBLUR3X3_IMPL
122 #endif // !defined(GAPI_STANDALONE)