summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralejandro-colomar <colomar.6.4.3@gmail.com>2020-02-05 14:09:20 +0100
committeralejandro-colomar <colomar.6.4.3@gmail.com>2020-02-05 14:09:20 +0100
commite68248ea2038131b3ee08fe84bef97878eaeef94 (patch)
tree1048d8bc91d5437e8b25b5a85e5d059e807f0853
parent38c00170a47805319280355d48ee251e6116a76f (diff)
remove alx_ prefix
-rwxr-xr-xsrc/label.c16
-rwxr-xr-xsrc/parse.c7
2 files changed, 11 insertions, 12 deletions
diff --git a/src/label.c b/src/label.c
index a824807..9d2f2ec 100755
--- a/src/label.c
+++ b/src/label.c
@@ -14,9 +14,9 @@
#include <stdio.h>
#include <time.h>
-#include <opencv2/imgproc/types_c.h>
#include <zbar.h>
+#define ALX_NO_PREFIX
#include <libalx/base/compiler/size.h>
#include <libalx/base/errno/error.h>
#include <libalx/base/stdio/printf/sbprintf.h>
@@ -222,7 +222,7 @@ int find_label (const img_s *restrict img,
alx_cv_invert(img_tmp);
if (alx_cv_smooth(img_tmp, ALX_CV_SMOOTH_MEAN, 21))
goto err;
- if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY_INV, 2))
+ if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY_INV, 2))
goto err;
if (alx_cv_dilate_erode(img_tmp, 100))
goto err;
@@ -290,7 +290,7 @@ int find_cerdo (const img_s *restrict img,
if (alx_cv_init_rect(rect, lbl_x, lbl_y, lbl_w, lbl_h))
goto err;
alx_cv_roi_set(img_tmp, rect);
- if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY, ALX_CV_THR_OTSU))
+ if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY, ALX_CV_THR_OTSU))
goto err;
if (alx_cv_erode(img_tmp, 1))
goto err;
@@ -383,11 +383,11 @@ int read_price (const img_s *restrict img,
alx_cv_roi_set(img_tmp, rect);
if (alx_cv_smooth(img_tmp, ALX_CV_SMOOTH_MEAN, 3))
goto err;
- if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY, ALX_CV_THR_OTSU))
+ if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY, ALX_CV_THR_OTSU))
goto err;
if (alx_cv_dilate_erode(img_tmp, 1))
goto err;
- if (alx_cv_threshold(img_tmp, CV_THRESH_BINARY, 1))
+ if (alx_cv_threshold(img_tmp, ALX_CV_THRESH_BINARY, 1))
goto err;
alx_cv_extract_imgdata(img_tmp, &imgdata, NULL, NULL,
&imgdata_w, &imgdata_h,
@@ -424,13 +424,11 @@ int chk_bcode_price (const char bcode[static restrict BUFSIZ],
char bcode_price[BUFSIZ];
if (bcode[8] != '0') {
- if (alx_sbprintf(bcode_price, NULL, "%c%c.%c%c",
- bcode[8], bcode[9],
+ if (sbprintf(bcode_price, NULL, "%c%c.%c%c", bcode[8], bcode[9],
bcode[10], bcode[11]))
return -1;
} else {
- if (alx_sbprintf(bcode_price, NULL, "%c.%c%c",
- bcode[9],
+ if (sbprintf(bcode_price, NULL, "%c.%c%c", bcode[9],
bcode[10], bcode[11]))
return -1;
}
diff --git a/src/parse.c b/src/parse.c
index 4f69a06..4ee46c4 100755
--- a/src/parse.c
+++ b/src/parse.c
@@ -17,6 +17,7 @@
#include <getopt.h>
#include <sys/stat.h>
+#define ALX_NO_PREFIX
#include <libalx/base/errno/error.h>
#include <libalx/base/stdio/printf/snprintfs.h>
@@ -123,9 +124,9 @@ void parse_file (char fname[static restrict FILENAME_MAX], char *arg)
struct stat sb;
if (stat(arg, &sb) || !S_ISREG(sb.st_mode))
- alx_error(EXIT_FAILURE, arg);
- if (alx_snprintfs(fname, NULL, FILENAME_MAX, "%s", arg))
- alx_error(EXIT_FAILURE, arg);
+ errorx(EXIT_FAILURE, arg);
+ if (snprintfs(fname, NULL, FILENAME_MAX, "%s", arg))
+ errorx(EXIT_FAILURE, arg);
return;
}