forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatures.cpp
More file actions
29 lines (26 loc) · 958 Bytes
/
features.cpp
File metadata and controls
29 lines (26 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <af/features.h>
#include <af/array.h>
#include <handle.hpp>
af_err af_destroy_features(af_features feat)
{
try {
if (feat.n > 0) {
if (feat.x != 0) AF_CHECK(af_destroy_array(feat.x));
if (feat.y != 0) AF_CHECK(af_destroy_array(feat.y));
if (feat.score != 0) AF_CHECK(af_destroy_array(feat.score));
if (feat.orientation != 0) AF_CHECK(af_destroy_array(feat.orientation));
if (feat.size != 0) AF_CHECK(af_destroy_array(feat.size));
feat.n = 0;
}
}
CATCHALL;
return AF_SUCCESS;
}