Skip to content

Commit a074832

Browse files
committed
Apply pre-commit formatting
1 parent 75214e9 commit a074832

36 files changed

+3938
-3916
lines changed

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 4
3+
TabWidth: 4
4+
UseTab: Never
5+
ColumnLimit: 100

.gitignore

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
*~
2-
*#
3-
bin
4-
lib
5-
include
6-
db
7-
dbd
8-
envPaths*
9-
*BAK.adl
10-
*/O.*
11-
*.swp
12-
.vscode/
13-
adcvTests/
14-
O.linux-x86_64/
15-
opencv/
16-
os/
17-
OLD_FILES/
18-
O.*-debug
1+
*~
2+
*#
3+
bin
4+
lib
5+
include
6+
db
7+
dbd
8+
envPaths*
9+
*BAK.adl
10+
*/O.*
11+
*.swp
12+
.vscode/
13+
adcvTests/
14+
O.linux-x86_64/
15+
opencv/
16+
os/
17+
OLD_FILES/
18+
O.*-debug

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
# General pre-commit hooks
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-merge-conflict
9+
- id: check-added-large-files
10+
- id: check-case-conflict
11+
- id: check-executables-have-shebangs
12+
- id: check-shebang-scripts-are-executable
13+
- id: check-yaml
14+
- id: check-json
15+
- id: check-xml
16+
- id: mixed-line-ending
17+
args: ['--fix=lf']
18+
19+
20+
- repo: https://github.com/pre-commit/mirrors-clang-format
21+
rev: v14.0.6
22+
hooks:
23+
- id: clang-format

CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Guide to contributing to ADCompVision
22

3-
Some pointers:
3+
Some pointers:
44
* OpenCV uses Mat objects for images. They are written as a 'smart-pointer' class, meaning that they are passed
55
by-reference by default. Because of this, make sure to pass the image into the function with (Mat &img).
66
* The plugin works by calling functions in a helper library. If you wish to add an additional function for a more specific use case that the plugin does not support, follow the steps below.
77

88
## Adding a new CV function
99

10-
There are two primary ways to add a new CV function to ADCompVision to customize the plugin.
10+
There are two primary ways to add a new CV function to ADCompVision to customize the plugin.
1111

1212
### Implementing user_function
1313

@@ -25,12 +25,12 @@ This is a more complicated process than simply implementing the user_function, a
2525
To add a new CV function there are several files you will need to edit. First, in the NDCV.template file, find the record titled "CompVisionFunctionN", where N is an integer from 1 to 3. These are the three sets of supported functions, and generally follow the rule:
2626
* Function set 1 contains basic OpenCV image processing functions
2727
* Function set 2 contains more complex functions that are still general and with many use cases
28-
* Function set 3 contains functions for specific use cases and custom implementations.
28+
* Function set 3 contains functions for specific use cases and custom implementations.
2929

30-
Decide which of these sets your new function falls under, and add it to the Input and Output records.
30+
Decide which of these sets your new function falls under, and add it to the Input and Output records.
3131

3232

33-
Next, in the `NDPluginCVHelper.h` file, change the `N_FUNC_#` value to take into account the new number of functions in the `CompVisionFunction#` PV you add your function to.
33+
Next, in the `NDPluginCVHelper.h` file, change the `N_FUNC_#` value to take into account the new number of functions in the `CompVisionFunction#` PV you add your function to.
3434
Next, you will need to edit the `NDPluginCVHelper.cpp` and `NDPluginCVHelper.h` files. In `NDPluginCVHelper.h`, find the definition of `ADCVFunction_t` and add:
3535
```
3636
// Some basic flag types
@@ -54,7 +54,7 @@ Make sure to add your function type in the appropriate position, this is importa
5454
ADCVStatus_t YOURFUNCTION(Mat &img, double* inputs, double* outputs);
5555
ADCVStatus_t get_YOURFUNCTION_description(string* inputDesc, string* outputDesc, string* description);
5656
```
57-
in the 'public' portion of the class declaration. You may follow the standard set by the other functions.
57+
in the 'public' portion of the class declaration. You may follow the standard set by the other functions.
5858
Next, in the `NDPluginCVHelper.cpp` file, add your new function definitions. They should take the following form:
5959

6060
**The Wrapper**
@@ -96,7 +96,7 @@ ADCVStatus_t NDPluginCVHelper::YOURFUNCTION(Mat &img, double* inputs, double* ou
9696
```
9797
/**
9898
* Function that sets the I/O descriptions for YOURFUNCTION
99-
*
99+
*
100100
* @params[out]: inputDesc -> array of input descriptions
101101
* @params[out]: outputDesc -> array of output descriptions
102102
* @params[out]: description -> overall function usage description
@@ -125,7 +125,7 @@ ADCVStatus_t NDPluginCVHelper::get_YOURFUNCTION_description(string* inputDesc, s
125125
```
126126
python3 createIOmanual.py
127127
```
128-
This will create a manual (in docs/manual.html) describing the inputs and outputs of each of the functions including your new custom function along with a description of each function as provided in the comments.
128+
This will create a manual (in docs/manual.html) describing the inputs and outputs of each of the functions including your new custom function along with a description of each function as provided in the comments.
129129

130130
Next, you must edit the `getFunctionDescription` function in `NDPluginCVHelper.cpp`. Add a case to the switch statement as follows:
131131
```
@@ -146,4 +146,4 @@ This will tell ADCompVision which function to process when your function is requ
146146

147147
Finally, the last remaining thing you must do, is to make sure that your function is thread safe. If it is not, you must add it to the array in `NDPluginCV.h` called `nonThreadSafeFunctions`. Note that in this case, multiple threads will not affect the performance of the plugin when such a function is selected.
148148

149-
Your function should now be implemented into ADCompVision and is ready to be tested.
149+
Your function should now be implemented into ADCompVision and is ready to be tested.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2626
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2727
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2828
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *app))
99
#DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *app))
1010

1111

12-
include $(TOP)/configure/RULES_TOP
12+
include $(TOP)/configure/RULES_TOP

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# ADCompVision
2-
3-
An [EPICS](http://www.aps.anl.gov/epics/) [areaDetector](https://github.com/areaDetector/areaDetector/blob/master/README.md) plugin that allows for general integration of OpenCV based computer vision routines with detector data.
4-
5-
Supported Functions:
6-
* Gaussian blur
7-
* Median blur
8-
* Binary thresholding
9-
* Laplacian
10-
* Sharpening filter
11-
* Canny Edge Detection
12-
* Consecutive image subtraction (ex. for dual thresholding)
13-
* Statistics calculations
14-
* Video recording
15-
* Centroid identification
16-
* Movement vector calculations
17-
* Object Identification
18-
* Distance thresholding
19-
* Logarithmic scaling
20-
* User definable extra function
21-
22-
Additional information:
23-
* [Documentation](https://areadetector.github.io/areaDetector/ADCompVision/ADCompVision.html)
24-
* [Release notes](https://github.com/areaDetector/ADCompVision/releases)
25-
26-
Author: Jakub Wlodek
1+
# ADCompVision
2+
3+
An [EPICS](http://www.aps.anl.gov/epics/) [areaDetector](https://github.com/areaDetector/areaDetector/blob/master/README.md) plugin that allows for general integration of OpenCV based computer vision routines with detector data.
4+
5+
Supported Functions:
6+
* Gaussian blur
7+
* Median blur
8+
* Binary thresholding
9+
* Laplacian
10+
* Sharpening filter
11+
* Canny Edge Detection
12+
* Consecutive image subtraction (ex. for dual thresholding)
13+
* Statistics calculations
14+
* Video recording
15+
* Centroid identification
16+
* Movement vector calculations
17+
* Object Identification
18+
* Distance thresholding
19+
* Logarithmic scaling
20+
* User definable extra function
21+
22+
Additional information:
23+
* [Documentation](https://areadetector.github.io/areaDetector/ADCompVision/ADCompVision.html)
24+
* [Release notes](https://github.com/areaDetector/ADCompVision/releases)
25+
26+
Author: Jakub Wlodek

0 commit comments

Comments
 (0)