diff --git a/shared-bindings/qrio/QRDecoder.c b/shared-bindings/qrio/QRDecoder.c index 5634481e9d..67fca8c3fb 100644 --- a/shared-bindings/qrio/QRDecoder.c +++ b/shared-bindings/qrio/QRDecoder.c @@ -54,8 +54,8 @@ STATIC mp_obj_t qrio_qrdecoder_make_new(const mp_obj_type_t *type, size_t n_args return self; } -//| def decode(self, buffer: ReadableBuffer) -> List[QRInfo]: -//| """Decode zero or more QR codes from the given image in L8 format""" +//| def decode(self, buffer: ReadableBuffer, pixel_policy: PixelPolicy = PixelPolicy.EVERY_BYTE) -> List[QRInfo]: +//| """Decode zero or more QR codes from the given image""" //| STATIC mp_obj_t qrio_qrdecoder_decode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); diff --git a/shared-bindings/qrio/__init__.c b/shared-bindings/qrio/__init__.c index 6dbbd926cf..719c73eb13 100644 --- a/shared-bindings/qrio/__init__.c +++ b/shared-bindings/qrio/__init__.c @@ -35,14 +35,14 @@ //| //| class PixelPolicy: -//| EVERY_BYTE: object +//| EVERY_BYTE: PixelPolicy //| """The input buffer to `QRDecoder.decode` consists of greyscale values in every byte""" //| -//| EVEN_BYTES: object -//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, ..., and ignored bytes in positions 1, 3, ...""" - -//| ODD_BYTES: object -//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, ..., and ignored bytes in positions 0, 2, ...""" +//| EVEN_BYTES: PixelPolicy +//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, …, and ignored bytes in positions 1, 3, …. This can decode directly from YUV images where the even bytes hold the Y (luminance) data.""" +//| +//| ODD_BYTES: PixelPolicy +//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, …, and ignored bytes in positions 0, 2, …. This can decode directly from YUV images where the odd bytes hold the Y (luminance) data""" //| MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVERY_BYTE, QRIO_EVERY_BYTE);