Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cv.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015
3  *
4  * This file is part of Paparazzi.
5  *
6  * Paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * Paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  *
20  */
21 
28 #include "cv.h"
29 
30 #define MAX_CV_FUNC 10
31 
32 int cv_func_cnt = 0;
34 
35 void cv_add(cvFunction func)
36 {
37  if (cv_func_cnt < (MAX_CV_FUNC - 1)) {
38  cv_func[cv_func_cnt] = func;
39  cv_func_cnt++;
40  }
41 }
42 
43 void cv_run(struct image_t *img)
44 {
45  for (int i = 0; i < cv_func_cnt; i++) {
46  cv_func[i](img);
47  }
48 }
#define MAX_CV_FUNC
Definition: cv.c:30
Definition: image.h:42
bool_t(* cvFunction)(struct image_t *img)
Definition: cv.h:35
Computer vision framework for onboard processing.
void cv_add(cvFunction func)
Definition: cv.c:35
int cv_func_cnt
Definition: cv.c:32
void cv_run(struct image_t *img)
Definition: cv.c:43
cvFunction cv_func[MAX_CV_FUNC]
Definition: cv.c:33