From d26a4fe9b50b411f36147e552e46825db27511dc Mon Sep 17 00:00:00 2001 From: torque Date: Sat, 26 Jun 2021 23:22:51 -0700 Subject: [PATCH] binarize: allow calling binarize from python code. There's not much of a reason to do this, and the API makes no effort not to be clunky, but there's also not really a reason to prevent it. --- deqr/binarize.pxd | 2 +- deqr/binarize.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deqr/binarize.pxd b/deqr/binarize.pxd index e3c5a6d..dda0411 100644 --- a/deqr/binarize.pxd +++ b/deqr/binarize.pxd @@ -14,4 +14,4 @@ ctypedef unsigned char uint8 -cdef void binarize(uint8[::1] image, int width, int height, bint invert) nogil +cpdef void binarize(uint8[::1] image, int width, int height, bint invert) nogil diff --git a/deqr/binarize.pyx b/deqr/binarize.pyx index 69a12ae..bb0fe7c 100644 --- a/deqr/binarize.pyx +++ b/deqr/binarize.pyx @@ -16,6 +16,6 @@ from . cimport binarize as bnz cdef extern void qr_binarize(unsigned char *_img, int _width, int _height, int invert) nogil -cdef void binarize(bnz.uint8[::1] image, int width, int height, bint invert) nogil: +cpdef void binarize(bnz.uint8[::1] image, int width, int height, bint invert) nogil: # this is in-place manipulation qr_binarize(&image[0], width, height, invert)