cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
xf_gammacorrection_config.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Xilinx, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
29 #ifndef _XF_GAMMACORRECTION_CONFIG_H_
30 #define _XF_GAMMACORRECTION_CONFIG_H_
31 
32 #include "hls_stream.h"
33 #include "ap_int.h"
34 #include "common/xf_common.hpp"
35 #include "common/xf_utility.hpp"
36 //#include "features/xf_gammacorrection.hpp"
37 #include "xf_config_params.h"
38 #include "../../../../../HOST/vision/gammacorrection/include/config.h"
39 
40 // # for gammacorrection
41 #include "imgproc/xf_gammacorrection.hpp"
42 #if NO
43 #define NPC1 XF_NPPC1
44 #endif
45 #if RO
46 #define NPC1 XF_NPPC8
47 #endif
48 
49 
50 #define CH_TYPE XF_GRAY
51 #define INPUT_PTR_WIDTH 64
52 #define OUTPUT_PTR_WIDTH 64
53 /*
54  * Pack pixels in and write into streams
55  */
56 
57 #if RO
58 #define NPIX XF_NPPC8
59 #endif
60 #if NO
61 #define NPIX XF_NPPC1
62 #endif
63 
64 #define WIDTH FRAME_WIDTH
65 #define HEIGHT FRAME_HEIGHT
66 
67 #define IMGSIZE FRAME_TOTAL
68 
69 #define IMG_PACKETS IMGSIZE/(INPUT_PTR_WIDTH/8)
70 
71 #define IN_TYPE XF_8UC1
72 #define OUT_TYPE XF_8UC1
73 
74 void gammacorrection_accel(xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _src,
75  xf::cv::Mat<XF_8UC1, HEIGHT, WIDTH, NPIX>& _dst,
76  unsigned short Thresh,
77  unsigned short k);
78 
79 void GammacorrectionAccelArray(ap_uint<INPUT_PTR_WIDTH>* img_inp,
80  ap_uint<OUTPUT_PTR_WIDTH>* img_out,
81  int rows, int cols, int threshold, int k);
82 
84  hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_in_axi_stream,
85  hls::stream<ap_axiu<INPUT_PTR_WIDTH, 0, 0, 0> >& img_out_axi_stream,
86  int rows, int cols, int threshold, int k);
87 
88 void gammacorrection_accel(xf::cv::Mat<IN_TYPE, HEIGHT, WIDTH, NPC1>& imgInput1,
89  xf::cv::Mat<OUT_TYPE, HEIGHT, WIDTH, NPC1>& imgOutput,
90  float gammaval);
91 
92 
93 #endif
94 
95 
void gammacorrection_accel(xf::cv::Mat< XF_8UC1, 256, 256, XF_NPPC1 > &_src, xf::cv::Mat< XF_8UC1, 256, 256, XF_NPPC1 > &_dst, unsigned short Thresh, unsigned short k)
void GammacorrectionAccelArray(ap_uint< 64 > *img_inp, ap_uint< 64 > *img_out, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Gammacorrection Application with array I/F.
void GammacorrectionAccelStream(hls::stream< ap_axiu< 64, 0, 0, 0 > > &img_in_axi_stream, hls::stream< ap_axiu< 64, 0, 0, 0 > > &img_out_axi_stream, int rows, int cols, int threshold, int k)
Top-level accelerated function of the Gammacorrection Application with array I/F.
The WarpTransform IP configuration header.