Skip to content

Commit 0fbe56c

Browse files
committed
Better Document PixelPolicy and the pixel_policy argument
1 parent e5a57d2 commit 0fbe56c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

shared-bindings/qrio/QRDecoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ STATIC mp_obj_t qrio_qrdecoder_make_new(const mp_obj_type_t *type, size_t n_args
5454
return self;
5555
}
5656

57-
//| def decode(self, buffer: ReadableBuffer) -> List[QRInfo]:
58-
//| """Decode zero or more QR codes from the given image in L8 format"""
57+
//| def decode(self, buffer: ReadableBuffer, pixel_policy: PixelPolicy = PixelPolicy.EVERY_BYTE) -> List[QRInfo]:
58+
//| """Decode zero or more QR codes from the given image"""
5959
//|
6060
STATIC mp_obj_t qrio_qrdecoder_decode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
6161
qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);

shared-bindings/qrio/__init__.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@
3535
//|
3636

3737
//| class PixelPolicy:
38-
//| EVERY_BYTE: object
38+
//| EVERY_BYTE: PixelPolicy
3939
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in every byte"""
4040
//|
41-
//| EVEN_BYTES: object
42-
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, ..., and ignored bytes in positions 1, 3, ..."""
43-
44-
//| ODD_BYTES: object
45-
//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, ..., and ignored bytes in positions 0, 2, ..."""
41+
//| EVEN_BYTES: PixelPolicy
42+
//| """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."""
43+
//|
44+
//| ODD_BYTES: PixelPolicy
45+
//| """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"""
4646
//|
4747

4848
MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVERY_BYTE, QRIO_EVERY_BYTE);

0 commit comments

Comments
 (0)