Better Document PixelPolicy and the pixel_policy argument

This commit is contained in:
Jeff Epler 2021-08-05 12:23:28 -05:00
parent e5a57d2399
commit 0fbe56c915
2 changed files with 8 additions and 8 deletions

View File

@ -54,8 +54,8 @@ STATIC mp_obj_t qrio_qrdecoder_make_new(const mp_obj_type_t *type, size_t n_args
return self; return self;
} }
//| def decode(self, buffer: ReadableBuffer) -> List[QRInfo]: //| def decode(self, buffer: ReadableBuffer, pixel_policy: PixelPolicy = PixelPolicy.EVERY_BYTE) -> List[QRInfo]:
//| """Decode zero or more QR codes from the given image in L8 format""" //| """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) { 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]); qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);

View File

@ -35,14 +35,14 @@
//| //|
//| class PixelPolicy: //| class PixelPolicy:
//| EVERY_BYTE: object //| EVERY_BYTE: PixelPolicy
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in every byte""" //| """The input buffer to `QRDecoder.decode` consists of greyscale values in every byte"""
//| //|
//| EVEN_BYTES: object //| EVEN_BYTES: PixelPolicy
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, ..., and ignored bytes in positions 1, 3, ...""" //| """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: object //| ODD_BYTES: PixelPolicy
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, ..., and ignored bytes in positions 0, 2, ...""" //| """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); MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVERY_BYTE, QRIO_EVERY_BYTE);