Skip to content

Commit c883bb7

Browse files
committed
Rearrange input parameters
1 parent cd4d55a commit c883bb7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

shared-bindings/bitmaptools/__init__.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,16 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl
111111

112112
//|
113113
//| def rotozoom(
114-
//| dest_bitmap: displayio.Bitmap, ox: int, oy: int,
115-
//| dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int],
116-
//| source_bitmap: displayio.Bitmap, px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int],
114+
//| dest_bitmap: displayio.Bitmap, source_bitmap: displayio.Bitmap,
115+
//| *,
116+
//| ox: int, oy: int, dest_clip0: Tuple[int, int], dest_clip1: Tuple[int, int],
117+
//| px: int, py: int, source_clip0: Tuple[int, int], source_clip1: Tuple[int, int],
117118
//| angle: float, scale: float, skip_index: int) -> None:
118119
//| """Inserts the source bitmap region into the destination bitmap with rotation
119120
//| (angle), scale and clipping (both on source and destination bitmaps).
120121
//|
121-
//| :param bitmap dest_bitmap: The bitmap that will be copied into
122+
//| :param bitmap dest_bitmap: Destination bitmap that will be copied into
123+
//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied
122124
//| :param int ox: Horizontal pixel location in destination bitmap where source bitmap
123125
//| point (px,py) is placed
124126
//| :param int oy: Vertical pixel location in destination bitmap where source bitmap
@@ -127,7 +129,6 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl
127129
//| region that constrains region of writing into destination bitmap
128130
//| :param Tuple[int,int] dest_clip1: Second corner of rectangular destination clipping
129131
//| region that constrains region of writing into destination bitmap
130-
//| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied
131132
//| :param int px: Horizontal pixel location in source bitmap that is placed into the
132133
//| destination bitmap at (ox,oy)
133134
//| :param int py: Vertical pixel location in source bitmap that is placed into the
@@ -143,19 +144,20 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl
143144
//| ...
144145
//|
145146
STATIC mp_obj_t bitmaptools_obj_rotozoom(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args){
146-
enum {ARG_dest_bitmap, ARG_ox, ARG_oy, ARG_dest_clip0, ARG_dest_clip1,
147-
ARG_source_bitmap, ARG_px, ARG_py,
148-
ARG_source_clip0, ARG_source_clip1,
147+
enum {ARG_dest_bitmap, ARG_source_bitmap,
148+
ARG_ox, ARG_oy, ARG_dest_clip0, ARG_dest_clip1,
149+
ARG_px, ARG_py, ARG_source_clip0, ARG_source_clip1,
149150
ARG_angle, ARG_scale, ARG_skip_index};
150151

151152
static const mp_arg_t allowed_args[] = {
152153
{MP_QSTR_dest_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ},
154+
{MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ},
155+
153156
{MP_QSTR_ox, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to destination->width / 2
154157
{MP_QSTR_oy, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to destination->height / 2
155158
{MP_QSTR_dest_clip0, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
156159
{MP_QSTR_dest_clip1, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
157160

158-
{MP_QSTR_source_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ},
159161
{MP_QSTR_px, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->width / 2
160162
{MP_QSTR_py, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, // None convert to source->height / 2
161163
{MP_QSTR_source_clip0, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },

0 commit comments

Comments
 (0)