Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / src / backends / fluid / gfluidimgproc_func.hpp
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.
4 //
5 // Copyright (C) 2018-2019 Intel Corporation
6
7 #pragma once
8
9 #if !defined(GAPI_STANDALONE)
10
11 #include "opencv2/core.hpp"
12
13 namespace cv {
14 namespace gapi {
15 namespace fluid {
16
17 //----------------------------------
18 //
19 // Fluid kernels: RGB2Gray, BGR2Gray
20 //
21 //----------------------------------
22
23 void run_rgb2gray_impl(uchar out[], const uchar in[], int width,
24                        float coef_r, float coef_g, float coef_b);
25
26 //--------------------------------------
27 //
28 // Fluid kernels: RGB-to-YUV, YUV-to-RGB
29 //
30 //--------------------------------------
31
32 void run_rgb2yuv_impl(uchar out[], const uchar in[], int width, const float coef[5]);
33
34 void run_yuv2rgb_impl(uchar out[], const uchar in[], int width, const float coef[4]);
35
36 //-------------------------
37 //
38 // Fluid kernels: sepFilter
39 //
40 //-------------------------
41
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);
47
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)
57
58 #undef RUN_SEPFILTER3X3_IMPL
59
60 //-------------------------
61 //
62 // Fluid kernels: Filter 2D
63 //
64 //-------------------------
65
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);
69
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)
77
78 #undef RUN_FILTER2D_3X3_IMPL
79
80 //-----------------------------
81 //
82 // Fluid kernels: Erode, Dilate
83 //
84 //-----------------------------
85
86 enum Morphology { M_ERODE, M_DILATE };
87
88 enum MorphShape { M_FULL, M_CROSS, M_UNDEF };
89
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);
94
95 RUN_MORPHOLOGY3X3_IMPL(uchar )
96 RUN_MORPHOLOGY3X3_IMPL(ushort)
97 RUN_MORPHOLOGY3X3_IMPL( short)
98 RUN_MORPHOLOGY3X3_IMPL( float)
99
100 #undef RUN_MORPHOLOGY3X3_IMPL
101
102 //---------------------------
103 //
104 // Fluid kernels: Median blur
105 //
106 //---------------------------
107
108 #define RUN_MEDBLUR3X3_IMPL(T) \
109 void run_medblur3x3_impl(T out[], const T *in[], int width, int chan);
110
111 RUN_MEDBLUR3X3_IMPL(uchar )
112 RUN_MEDBLUR3X3_IMPL(ushort)
113 RUN_MEDBLUR3X3_IMPL( short)
114 RUN_MEDBLUR3X3_IMPL( float)
115
116 #undef RUN_MEDBLUR3X3_IMPL
117
118 }  // namespace fluid
119 }  // namespace gapi
120 }  // namespace cv
121
122 #endif // !defined(GAPI_STANDALONE)