Merge pull request #2596 from SingTown/fix-n_args
Some checks failed
🔎 Check Code Formatting / formatting-check (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled

modules: Replace uint with size_t.
This commit is contained in:
Ibrahim Abdelkader 2025-02-19 10:31:47 +02:00 committed by GitHub
commit b7c1f472ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with 181 additions and 181 deletions

View File

@ -136,7 +136,7 @@ static mp_obj_t py_omv_csi_flush() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_csi_flush_obj, py_omv_csi_flush);
static mp_obj_t py_omv_csi_snapshot(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_omv_csi_snapshot(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
#if MICROPY_PY_IMU
// +-10 degree dead-zone around pitch 90/270.
// +-35 degree active-zone around roll 0/90/180/270/360.
@ -154,7 +154,7 @@ static mp_obj_t py_omv_csi_snapshot(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_omv_csi_snapshot_obj, 0, py_omv_csi_snapshot);
static mp_obj_t py_omv_csi_skip_frames(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_omv_csi_skip_frames(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, MP_ROM_QSTR(MP_QSTR_time), MP_MAP_LOOKUP);
mp_int_t time = 300; // OV Recommended.
@ -293,7 +293,7 @@ static mp_obj_t py_omv_csi_get_framerate() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_csi_get_framerate_obj, py_omv_csi_get_framerate);
static mp_obj_t py_omv_csi_set_windowing(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_omv_csi_set_windowing(size_t n_args, const mp_obj_t *args) {
if (csi.framesize == OMV_CSI_FRAMESIZE_INVALID) {
omv_csi_raise_error(OMV_CSI_ERROR_INVALID_FRAMESIZE);
}
@ -439,7 +439,7 @@ static mp_obj_t py_omv_csi_set_colorbar(mp_obj_t enable) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_omv_csi_set_colorbar_obj, py_omv_csi_set_colorbar);
static mp_obj_t py_omv_csi_set_auto_gain(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_omv_csi_set_auto_gain(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_gain_db, ARG_gain_db_ceiling };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_gain_db, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE} },
@ -475,7 +475,7 @@ static mp_obj_t py_omv_csi_get_gain_db() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_csi_get_gain_db_obj, py_omv_csi_get_gain_db);
static mp_obj_t py_omv_csi_set_auto_exposure(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_omv_csi_set_auto_exposure(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_exposure_us };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_exposure_us, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1} },
@ -507,7 +507,7 @@ static mp_obj_t py_omv_csi_get_exposure_us() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_csi_get_exposure_us_obj, py_omv_csi_get_exposure_us);
static mp_obj_t py_omv_csi_set_auto_whitebal(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_omv_csi_set_auto_whitebal(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_rgb_gain_db };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_rgb_gain_db, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE} },
@ -546,7 +546,7 @@ static mp_obj_t py_omv_csi_get_rgb_gain_db() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_csi_get_rgb_gain_db_obj, py_omv_csi_get_rgb_gain_db);
static mp_obj_t py_omv_csi_set_auto_blc(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_omv_csi_set_auto_blc(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_enable, ARG_regs };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_enable, MP_ARG_REQUIRED | MP_ARG_INT },
@ -674,7 +674,7 @@ static mp_obj_t py_omv_csi_get_framebuffers() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_csi_get_framebuffers_obj, py_omv_csi_get_framebuffers);
static mp_obj_t py_omv_csi_disable_delays(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_omv_csi_disable_delays(size_t n_args, const mp_obj_t *args) {
if (!n_args) {
return mp_obj_new_bool(csi.disable_delays);
}
@ -684,7 +684,7 @@ static mp_obj_t py_omv_csi_disable_delays(uint n_args, const mp_obj_t *args) {
}
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(py_omv_csi_disable_delays_obj, 0, 1, py_omv_csi_disable_delays);
static mp_obj_t py_omv_csi_disable_full_flush(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_omv_csi_disable_full_flush(size_t n_args, const mp_obj_t *args) {
if (!n_args) {
return mp_obj_new_bool(csi.disable_full_flush);
}
@ -749,7 +749,7 @@ static mp_obj_t py_omv_csi_set_frame_callback(mp_obj_t frame_callback_obj) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_omv_csi_set_frame_callback_obj, py_omv_csi_set_frame_callback);
static mp_obj_t py_omv_csi_ioctl(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_omv_csi_ioctl(size_t n_args, const mp_obj_t *args) {
mp_obj_t ret_obj = mp_const_none;
int request = mp_obj_get_int(args[0]);
int error = OMV_CSI_ERROR_INVALID_ARGUMENT;

View File

@ -95,7 +95,7 @@ static mp_obj_t py_display_deinit(mp_obj_t self_in) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_display_deinit_obj, py_display_deinit);
static mp_obj_t py_display_clear(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_display_clear(size_t n_args, const mp_obj_t *args) {
py_display_obj_t *self = MP_OBJ_TO_PTR(args[0]);
bool display_off = (n_args > 1 && mp_obj_get_int(args[1]));
py_display_p_t *display_p = (py_display_p_t *) MP_OBJ_TYPE_GET_SLOT(self->base.type, protocol);
@ -106,7 +106,7 @@ static mp_obj_t py_display_clear(uint n_args, const mp_obj_t *args) {
}
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(py_display_clear_obj, 1, 2, py_display_clear);
static mp_obj_t py_display_backlight(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_display_backlight(size_t n_args, const mp_obj_t *args) {
py_display_obj_t *self = MP_OBJ_TO_PTR(args[0]);
if (n_args > 1) {
uint32_t intensity = mp_obj_get_int(args[1]);
@ -136,7 +136,7 @@ static mp_obj_t py_display_backlight(uint n_args, const mp_obj_t *args) {
}
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(py_display_backlight_obj, 1, 2, py_display_backlight);
static mp_obj_t py_display_write(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_display_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_image, ARG_x, ARG_y, ARG_x_scale, ARG_y_scale, ARG_roi,
ARG_channel, ARG_alpha, ARG_color_palette, ARG_alpha_palette, ARG_hint
@ -192,7 +192,7 @@ static mp_obj_t py_display_write(uint n_args, const mp_obj_t *pos_args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_display_write_obj, 2, py_display_write);
static mp_obj_t py_display_bus_write(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_display_bus_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_cmd, ARG_args, ARG_dcs };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_cmd, MP_ARG_INT | MP_ARG_REQUIRED },
@ -222,7 +222,7 @@ static mp_obj_t py_display_bus_write(uint n_args, const mp_obj_t *pos_args, mp_m
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_display_bus_write_obj, 1, py_display_bus_write);
static mp_obj_t py_display_bus_read(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_display_bus_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_cmd, ARG_len, ARG_args, ARG_dcs };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_cmd, MP_ARG_INT | MP_ARG_REQUIRED },

View File

@ -64,7 +64,7 @@ static void cec_extint_callback(mp_obj_t self_in) {
}
}
static mp_obj_t py_cec_send_frame(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_cec_send_frame(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_dst_addr, ARG_src_addr, ARG_data };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_dst_addr, MP_ARG_REQUIRED | MP_ARG_INT },
@ -94,7 +94,7 @@ static mp_obj_t py_cec_send_frame(uint n_args, const mp_obj_t *pos_args, mp_map_
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_cec_send_frame_obj, 4, py_cec_send_frame);
static mp_obj_t py_cec_receive_frame(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_cec_receive_frame(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_dst_addr, ARG_timeout };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_dst_addr, MP_ARG_REQUIRED | MP_ARG_INT },

View File

@ -334,7 +334,7 @@ static mp_obj_t py_fir_deinit() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_fir_deinit_obj, py_fir_deinit);
mp_obj_t py_fir_init(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_fir_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_type, ARG_refresh, ARG_resolution };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_type, MP_ARG_INT, {.u_int = -1 } },
@ -729,7 +729,7 @@ static mp_obj_t py_fir_get_frame_available() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_fir_get_frame_available_obj, py_fir_get_frame_available);
static mp_obj_t py_fir_trigger_ffc(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_fir_trigger_ffc(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_timeout };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_timeout, MP_ARG_INT, {.u_int = -1 } },
@ -812,7 +812,7 @@ mp_obj_t py_fir_read_ta() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_fir_read_ta_obj, py_fir_read_ta);
mp_obj_t py_fir_read_ir(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_fir_read_ir(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_hmirror, ARG_vflip, ARG_transpose, ARG_timeout };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_hmirror, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_bool = false } },
@ -887,7 +887,7 @@ mp_obj_t py_fir_read_ir(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_fir_read_ir_obj, 0, py_fir_read_ir);
mp_obj_t py_fir_draw_ir(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_fir_draw_ir(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_x, ARG_y, ARG_x_scale, ARG_y_scale, ARG_roi, ARG_channel, ARG_alpha,
ARG_color_palette, ARG_alpha_palette, ARG_hint, ARG_scale
@ -961,7 +961,7 @@ mp_obj_t py_fir_draw_ir(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_fir_draw_ir_obj, 2, py_fir_draw_ir);
mp_obj_t py_fir_snapshot(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_fir_snapshot(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_hmirror, ARG_vflip, ARG_transpose, ARG_x_scale, ARG_y_scale, ARG_roi, ARG_channel,
ARG_alpha, ARG_color_palette, ARG_alpha_palette, ARG_hint, ARG_scale, ARG_pixformat,

View File

@ -83,7 +83,7 @@ static mp_obj_t py_gif_loop(mp_obj_t self_in) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_gif_loop_obj, py_gif_loop);
static mp_obj_t py_gif_add_frame(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_gif_add_frame(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_delay };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_delay, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 10 } },
@ -115,7 +115,7 @@ static mp_obj_t py_gif_close(mp_obj_t self_in) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_gif_close_obj, py_gif_close);
static mp_obj_t py_gif_open(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_gif_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_width, ARG_height, ARG_color, ARG_loop };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_width, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = -1 } },

View File

@ -34,7 +34,7 @@
extern void *py_image_cobj(mp_obj_t img_obj);
mp_obj_t py_func_unavailable(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_func_unavailable(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
PY_ASSERT_TRUE_MSG(false, "This function is unavailable on your OpenMV Cam.");
return mp_const_none;
}
@ -181,7 +181,7 @@ void py_helper_arg_to_float_array(const mp_obj_t arg, float *array, size_t size)
}
}
image_t *py_helper_keyword_to_image(uint n_args, const mp_obj_t *args, uint arg_index,
image_t *py_helper_keyword_to_image(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, image_t *default_val) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -194,7 +194,7 @@ image_t *py_helper_keyword_to_image(uint n_args, const mp_obj_t *args, uint arg_
return default_val;
}
void py_helper_keyword_rectangle(image_t *img, uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_rectangle(image_t *img, size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, rectangle_t *r) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -230,12 +230,12 @@ void py_helper_keyword_rectangle(image_t *img, uint n_args, const mp_obj_t *args
rectangle_intersected(r, &temp);
}
void py_helper_keyword_rectangle_roi(image_t *img, uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_rectangle_roi(image_t *img, size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, rectangle_t *r) {
py_helper_keyword_rectangle(img, n_args, args, arg_index, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_roi), r);
}
int py_helper_keyword_int(uint n_args, const mp_obj_t *args, uint arg_index,
int py_helper_keyword_int(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, int default_val) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -248,7 +248,7 @@ int py_helper_keyword_int(uint n_args, const mp_obj_t *args, uint arg_index,
return default_val;
}
bool py_helper_keyword_int_maybe(uint n_args, const mp_obj_t *args, uint arg_index,
bool py_helper_keyword_int_maybe(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, int *value) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -261,7 +261,7 @@ bool py_helper_keyword_int_maybe(uint n_args, const mp_obj_t *args, uint arg_ind
return false;
}
float py_helper_keyword_float(uint n_args, const mp_obj_t *args, uint arg_index,
float py_helper_keyword_float(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, float default_val) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -274,7 +274,7 @@ float py_helper_keyword_float(uint n_args, const mp_obj_t *args, uint arg_index,
return default_val;
}
bool py_helper_keyword_float_maybe(uint n_args, const mp_obj_t *args, uint arg_index,
bool py_helper_keyword_float_maybe(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, float *value) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -287,7 +287,7 @@ bool py_helper_keyword_float_maybe(uint n_args, const mp_obj_t *args, uint arg_i
return false;
}
void py_helper_keyword_int_array(uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_int_array(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, int *x, int size) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -306,7 +306,7 @@ void py_helper_keyword_int_array(uint n_args, const mp_obj_t *args, uint arg_ind
}
}
float *py_helper_keyword_corner_array(uint n_args, const mp_obj_t *args, uint arg_index,
float *py_helper_keyword_corner_array(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
@ -337,7 +337,7 @@ float *py_helper_keyword_corner_array(uint n_args, const mp_obj_t *args, uint ar
return NULL;
}
uint py_helper_consume_array(uint n_args, const mp_obj_t *args, uint arg_index, size_t len, const mp_obj_t **items) {
uint py_helper_consume_array(size_t n_args, const mp_obj_t *args, size_t arg_index, size_t len, const mp_obj_t **items) {
if (MP_OBJ_IS_TYPE(args[arg_index], &mp_type_tuple) || MP_OBJ_IS_TYPE(args[arg_index], &mp_type_list)) {
mp_obj_get_array_fixed_n(args[arg_index], len, (mp_obj_t **) items);
return arg_index + 1;
@ -348,7 +348,7 @@ uint py_helper_consume_array(uint n_args, const mp_obj_t *args, uint arg_index,
}
}
int py_helper_keyword_color(image_t *img, uint n_args, const mp_obj_t *args, uint arg_index,
int py_helper_keyword_color(image_t *img, size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, int default_val) {
mp_map_elem_t *kw_arg = kw_args ? mp_map_lookup(kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_color), MP_MAP_LOOKUP) : NULL;
@ -441,7 +441,7 @@ void py_helper_arg_to_thresholds(const mp_obj_t arg, list_t *thresholds) {
}
}
void py_helper_keyword_thresholds(uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_thresholds(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, list_t *thresholds) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_thresholds), MP_MAP_LOOKUP);
@ -458,8 +458,8 @@ int py_helper_arg_to_ksize(const mp_obj_t arg) {
return ksize;
}
mp_obj_t py_helper_keyword_object(uint n_args, const mp_obj_t *args,
uint arg_index, mp_map_t *kw_args, mp_obj_t kw, mp_obj_t default_val) {
mp_obj_t py_helper_keyword_object(size_t n_args, const mp_obj_t *args,
size_t arg_index, mp_map_t *kw_args, mp_obj_t kw, mp_obj_t default_val) {
mp_map_elem_t *kw_arg = mp_map_lookup(kw_args, kw, MP_MAP_LOOKUP);
if (kw_arg) {
@ -471,8 +471,8 @@ mp_obj_t py_helper_keyword_object(uint n_args, const mp_obj_t *args,
}
}
const uint16_t *py_helper_keyword_color_palette(uint n_args, const mp_obj_t *args,
uint arg_index, mp_map_t *kw_args, const uint16_t *default_color_palette) {
const uint16_t *py_helper_keyword_color_palette(size_t n_args, const mp_obj_t *args,
size_t arg_index, mp_map_t *kw_args, const uint16_t *default_color_palette) {
int palette;
mp_map_elem_t *kw_arg =
@ -524,8 +524,8 @@ const uint16_t *py_helper_keyword_color_palette(uint n_args, const mp_obj_t *arg
return default_color_palette;
}
const uint8_t *py_helper_keyword_alpha_palette(uint n_args, const mp_obj_t *args,
uint arg_index, mp_map_t *kw_args, const uint8_t *default_alpha_palette) {
const uint8_t *py_helper_keyword_alpha_palette(size_t n_args, const mp_obj_t *args,
size_t arg_index, mp_map_t *kw_args, const uint8_t *default_alpha_palette) {
image_t *arg_alpha_palette =
py_helper_keyword_to_image(n_args, args, 9, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_alpha_palette), NULL);

View File

@ -46,39 +46,39 @@ void py_helper_arg_to_minmax(const mp_obj_t minmax, float *min, float *max,
float py_helper_arg_to_float(const mp_obj_t arg, float default_value);
void py_helper_arg_to_float_array(const mp_obj_t arg, float *array, size_t size);
image_t *py_helper_keyword_to_image(uint n_args, const mp_obj_t *args, uint arg_index,
image_t *py_helper_keyword_to_image(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, image_t *default_val);
void py_helper_keyword_rectangle(image_t *img, uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_rectangle(image_t *img, size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, rectangle_t *r);
void py_helper_keyword_rectangle_roi(image_t *img, uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_rectangle_roi(image_t *img, size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, rectangle_t *r);
int py_helper_keyword_int(uint n_args, const mp_obj_t *args, uint arg_index,
int py_helper_keyword_int(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, int default_val);
bool py_helper_keyword_int_maybe(uint n_args, const mp_obj_t *args, uint arg_index,
bool py_helper_keyword_int_maybe(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, int *value);
float py_helper_keyword_float(uint n_args, const mp_obj_t *args, uint arg_index,
float py_helper_keyword_float(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, float default_val);
bool py_helper_keyword_float_maybe(uint n_args, const mp_obj_t *args, uint arg_index,
bool py_helper_keyword_float_maybe(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, float *value);
void py_helper_keyword_int_array(uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_int_array(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, int *x, int size);
void py_helper_keyword_float_array(uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_float_array(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw, float *x, int size);
float *py_helper_keyword_corner_array(uint n_args, const mp_obj_t *args, uint arg_index,
float *py_helper_keyword_corner_array(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, mp_obj_t kw);
uint py_helper_consume_array(uint n_args, const mp_obj_t *args, uint arg_index, size_t len, const mp_obj_t **items);
int py_helper_keyword_color(image_t *img, uint n_args, const mp_obj_t *args, uint arg_index,
uint py_helper_consume_array(size_t n_args, const mp_obj_t *args, size_t arg_index, size_t len, const mp_obj_t **items);
int py_helper_keyword_color(image_t *img, size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, int default_val);
void py_helper_arg_to_thresholds(const mp_obj_t arg, list_t *thresholds);
void py_helper_keyword_thresholds(uint n_args, const mp_obj_t *args, uint arg_index,
void py_helper_keyword_thresholds(size_t n_args, const mp_obj_t *args, size_t arg_index,
mp_map_t *kw_args, list_t *thresholds);
int py_helper_arg_to_ksize(const mp_obj_t arg);
mp_obj_t py_helper_keyword_object(uint n_args, const mp_obj_t *args,
uint arg_index, mp_map_t *kw_args, mp_obj_t kw, mp_obj_t default_val);
const uint16_t *py_helper_keyword_color_palette(uint n_args, const mp_obj_t *args,
uint arg_index, mp_map_t *kw_args, const uint16_t *default_color_palette);
const uint8_t *py_helper_keyword_alpha_palette(uint n_args, const mp_obj_t *args,
uint arg_index, mp_map_t *kw_args, const uint8_t *default_alpha_palette);
mp_obj_t py_helper_keyword_object(size_t n_args, const mp_obj_t *args,
size_t arg_index, mp_map_t *kw_args, mp_obj_t kw, mp_obj_t default_val);
const uint16_t *py_helper_keyword_color_palette(size_t n_args, const mp_obj_t *args,
size_t arg_index, mp_map_t *kw_args, const uint16_t *default_color_palette);
const uint8_t *py_helper_keyword_alpha_palette(size_t n_args, const mp_obj_t *args,
size_t arg_index, mp_map_t *kw_args, const uint8_t *default_alpha_palette);
bool py_helper_is_equal_to_framebuffer(image_t *img);
void py_helper_update_framebuffer(image_t *img);
void py_helper_set_to_framebuffer(image_t *img);

View File

@ -737,7 +737,7 @@ static mp_obj_t py_image_bytearray(mp_obj_t img_obj) {
static MP_DEFINE_CONST_FUN_OBJ_1(py_image_bytearray_obj, py_image_bytearray);
#if defined(MODULE_ULAB_ENABLED) && (ULAB_MAX_DIMS == 4)
static mp_obj_t py_image_to_ndarray(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_ndarray(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_dtype, ARG_buffer };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_dtype, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_rom_obj = MP_ROM_NONE } },
@ -875,7 +875,7 @@ static mp_obj_t py_image_to_ndarray(uint n_args, const mp_obj_t *pos_args, mp_ma
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_ndarray_obj, 1, py_image_to_ndarray);
#endif
static mp_obj_t py_image_get_pixel(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_get_pixel(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_UNCOMPRESSED);
const mp_obj_t *arg_vec;
@ -954,7 +954,7 @@ static mp_obj_t py_image_get_pixel(uint n_args, const mp_obj_t *args, mp_map_t *
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_get_pixel_obj, 2, py_image_get_pixel);
static mp_obj_t py_image_set_pixel(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_set_pixel(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_UNCOMPRESSED);
const mp_obj_t *arg_vec;
@ -992,7 +992,7 @@ static mp_obj_t py_image_set_pixel(uint n_args, const mp_obj_t *args, mp_map_t *
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_set_pixel_obj, 2, py_image_set_pixel);
static mp_obj_t py_image_to(pixformat_t pixfmt, mp_rom_obj_t default_color_palette, bool default_copy,
uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_x_scale, ARG_y_scale, ARG_roi, ARG_channel, ARG_alpha, ARG_color_palette, ARG_alpha_palette, ARG_hint,
ARG_copy, ARG_copy_to_fb, ARG_quality, ARG_encode_for_ide, ARG_subsampling
@ -1181,72 +1181,72 @@ static mp_obj_t py_image_to(pixformat_t pixfmt, mp_rom_obj_t default_color_palet
return py_image_from_struct(&dst_img);
}
static mp_obj_t py_image_to_bitmap(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_bitmap(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_BINARY, MP_ROM_NONE, false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_bitmap_obj, 1, py_image_to_bitmap);
static mp_obj_t py_image_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_grayscale(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_GRAYSCALE, MP_ROM_NONE, false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_grayscale_obj, 1, py_image_to_grayscale);
static mp_obj_t py_image_to_rgb565(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_rgb565(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_RGB565, MP_ROM_NONE, false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_rgb565_obj, 1, py_image_to_rgb565);
static mp_obj_t py_image_to_rainbow(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_rainbow(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_RGB565, MP_ROM_INT(COLOR_PALETTE_RAINBOW), false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_rainbow_obj, 1, py_image_to_rainbow);
static mp_obj_t py_image_to_ironbow(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_ironbow(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_RGB565, MP_ROM_INT(COLOR_PALETTE_IRONBOW), false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_ironbow_obj, 1, py_image_to_ironbow);
#if (MICROPY_PY_TOF == 1)
static mp_obj_t py_image_to_depth(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_depth(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_RGB565, MP_ROM_INT(COLOR_PALETTE_DEPTH), false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_depth_obj, 1, py_image_to_depth);
#endif // MICROPY_PY_TOF == 1
#if (OMV_GENX320_ENABLE == 1)
static mp_obj_t py_image_to_evt_dark(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_evt_dark(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_RGB565, MP_ROM_INT(COLOR_PALETTE_EVT_DARK), false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_evt_dark_obj, 1, py_image_to_evt_dark);
static mp_obj_t py_image_to_evt_light(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_evt_light(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_RGB565, MP_ROM_INT(COLOR_PALETTE_EVT_LIGHT), false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_evt_light_obj, 1, py_image_to_evt_light);
#endif // OMV_GENX320_ENABLE == 1
static mp_obj_t py_image_to_jpeg(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_jpeg(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_JPEG, MP_ROM_NONE, false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_jpeg_obj, 1, py_image_to_jpeg);
static mp_obj_t py_image_to_png(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_to_png(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_PNG, MP_ROM_NONE, false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_to_png_obj, 1, py_image_to_png);
static mp_obj_t py_image_copy(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_copy(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_INVALID, MP_ROM_NONE, true, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_copy_obj, 1, py_image_copy);
static mp_obj_t py_image_crop(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_crop(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
return py_image_to(PIXFORMAT_INVALID, MP_ROM_NONE, false, n_args, args, kw_args);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_crop_obj, 1, py_image_crop);
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
static mp_obj_t py_image_save(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_save(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
const char *path = mp_obj_str_get_str(args[1]);
@ -1274,7 +1274,7 @@ static MP_DEFINE_CONST_FUN_OBJ_1(py_image_flush_obj, py_image_flush);
// Drawing Methods
//////////////////
static mp_obj_t py_image_clear(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_clear(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_UNCOMPRESSED);
image_t *arg_msk =
@ -1290,7 +1290,7 @@ static mp_obj_t py_image_clear(uint n_args, const mp_obj_t *args, mp_map_t *kw_a
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_clear_obj, 1, py_image_clear);
static mp_obj_t py_image_draw_line(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_line(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1310,7 +1310,7 @@ static mp_obj_t py_image_draw_line(uint n_args, const mp_obj_t *args, mp_map_t *
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_line_obj, 2, py_image_draw_line);
static mp_obj_t py_image_draw_rectangle(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_rectangle(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1332,7 +1332,7 @@ static mp_obj_t py_image_draw_rectangle(uint n_args, const mp_obj_t *args, mp_ma
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_rectangle_obj, 2, py_image_draw_rectangle);
static mp_obj_t py_image_draw_circle(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_circle(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1353,7 +1353,7 @@ static mp_obj_t py_image_draw_circle(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_circle_obj, 2, py_image_draw_circle);
static mp_obj_t py_image_draw_ellipse(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_ellipse(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1376,7 +1376,7 @@ static mp_obj_t py_image_draw_ellipse(uint n_args, const mp_obj_t *args, mp_map_
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_ellipse_obj, 2, py_image_draw_ellipse);
static mp_obj_t py_image_draw_string(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_string(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1417,7 +1417,7 @@ static mp_obj_t py_image_draw_string(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_string_obj, 2, py_image_draw_string);
static mp_obj_t py_image_draw_cross(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_cross(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1438,7 +1438,7 @@ static mp_obj_t py_image_draw_cross(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_cross_obj, 2, py_image_draw_cross);
static mp_obj_t py_image_draw_arrow(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_arrow(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1476,7 +1476,7 @@ static mp_obj_t py_image_draw_arrow(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_arrow_obj, 2, py_image_draw_arrow);
static mp_obj_t py_image_draw_edges(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_edges(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
mp_obj_t *corners, *p0, *p1, *p2, *p3;
@ -1521,7 +1521,7 @@ static mp_obj_t py_image_draw_edges(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_edges_obj, 2, py_image_draw_edges);
static mp_obj_t py_image_draw_keypoints(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_keypoints(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_c =
@ -1570,7 +1570,7 @@ static mp_obj_t py_image_draw_keypoints(uint n_args, const mp_obj_t *args, mp_ma
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_keypoints_obj, 2, py_image_draw_keypoints);
static mp_obj_t py_image_mask_rectangle(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_mask_rectangle(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_rx;
int arg_ry;
@ -1606,7 +1606,7 @@ static mp_obj_t py_image_mask_rectangle(uint n_args, const mp_obj_t *args, mp_ma
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mask_rectangle_obj, 1, py_image_mask_rectangle);
static mp_obj_t py_image_mask_circle(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_mask_circle(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_cx;
int arg_cy;
@ -1639,7 +1639,7 @@ static mp_obj_t py_image_mask_circle(uint n_args, const mp_obj_t *args, mp_map_t
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mask_circle_obj, 1, py_image_mask_circle);
static mp_obj_t py_image_mask_ellipse(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_mask_ellipse(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_cx;
int arg_cy;
@ -1679,7 +1679,7 @@ static mp_obj_t py_image_mask_ellipse(uint n_args, const mp_obj_t *args, mp_map_
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mask_ellipse_obj, 1, py_image_mask_ellipse);
#ifdef IMLIB_ENABLE_FLOOD_FILL
static mp_obj_t py_image_flood_fill(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_flood_fill(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
const mp_obj_t *arg_vec;
@ -1714,7 +1714,7 @@ static mp_obj_t py_image_flood_fill(uint n_args, const mp_obj_t *args, mp_map_t
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_flood_fill_obj, 2, py_image_flood_fill);
#endif // IMLIB_ENABLE_FLOOD_FILL
static mp_obj_t py_image_line_op(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args,
static mp_obj_t py_image_line_op(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args,
imlib_draw_row_callback_t callback) {
enum {
ARG_image, ARG_x, ARG_y, ARG_x_scale, ARG_y_scale, ARG_roi,
@ -1819,7 +1819,7 @@ static mp_obj_t py_image_line_op(uint n_args, const mp_obj_t *pos_args, mp_map_t
return pos_args[0];
}
static mp_obj_t py_image_draw_image(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_draw_image(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, NULL);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_image_obj, 1, py_image_draw_image);
@ -1829,7 +1829,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_draw_image_obj, 1, py_image_draw_imag
// ISP Methods
//////////////
static mp_obj_t py_awb(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_awb(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_max };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_max, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} },
@ -1904,7 +1904,7 @@ static mp_obj_t py_ccm(mp_obj_t img_obj, mp_obj_t ccm_obj) {
}
static MP_DEFINE_CONST_FUN_OBJ_2(py_ccm_obj, py_ccm);
static mp_obj_t py_image_gamma(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_gamma(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_gamma, ARG_contrast, ARG_brightness };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_gamma, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE } },
@ -1935,7 +1935,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_gamma_obj, 1, py_image_gamma);
// Binary Methods
/////////////////
static mp_obj_t py_image_binary(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_binary(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_thresholds, ARG_invert, ARG_zero, ARG_mask, ARG_to_bitmap, ARG_copy };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_thresholds, MP_ARG_OBJ | MP_ARG_REQUIRED, },
@ -2013,37 +2013,37 @@ static mp_obj_t py_image_invert(mp_obj_t img_obj) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_image_invert_obj, py_image_invert);
static mp_obj_t py_image_b_and(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_b_and(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_b_and_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_b_and_obj, 1, py_image_b_and);
static mp_obj_t py_image_b_nand(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_b_nand(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_b_nand_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_b_nand_obj, 1, py_image_b_nand);
static mp_obj_t py_image_b_or(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_b_or(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_b_or_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_b_or_obj, 1, py_image_b_or);
static mp_obj_t py_image_b_nor(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_b_nor(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_b_nor_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_b_nor_obj, 1, py_image_b_nor);
static mp_obj_t py_image_b_xor(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_b_xor(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_b_xor_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_b_xor_obj, 1, py_image_b_xor);
static mp_obj_t py_image_b_xnor(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_b_xnor(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_b_xnor_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_b_xnor_obj, 1, py_image_b_xnor);
static mp_obj_t py_image_binary_morph_op(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args,
static mp_obj_t py_image_binary_morph_op(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args,
binary_morph_op_t op) {
enum { ARG_threshold, ARG_mask };
static const mp_arg_t allowed_args[] = {
@ -2068,22 +2068,22 @@ static mp_obj_t py_image_binary_morph_op(uint n_args, const mp_obj_t *pos_args,
return pos_args[0];
}
static mp_obj_t py_image_erode(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_erode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_binary_morph_op(n_args, pos_args, kw_args, imlib_erode);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_erode_obj, 2, py_image_erode);
static mp_obj_t py_image_dilate(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_dilate(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_binary_morph_op(n_args, pos_args, kw_args, imlib_dilate);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_dilate_obj, 2, py_image_dilate);
static mp_obj_t py_image_open(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_binary_morph_op(n_args, pos_args, kw_args, imlib_open);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_open_obj, 2, py_image_open);
static mp_obj_t py_image_close(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_close(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_binary_morph_op(n_args, pos_args, kw_args, imlib_close);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_close_obj, 2, py_image_close);
@ -2094,44 +2094,44 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_close_obj, 2, py_image_close);
// Math Methods
///////////////
static mp_obj_t py_image_add(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_add(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_add_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_add_obj, 1, py_image_add);
static mp_obj_t py_image_sub(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_sub(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_sub_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_sub_obj, 1, py_image_sub);
static mp_obj_t py_image_rsub(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_rsub(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_rsub_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_rsub_obj, 1, py_image_rsub);
static mp_obj_t py_image_min(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_min(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_min_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_min_obj, 1, py_image_min);
static mp_obj_t py_image_max(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_max(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_max_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_max_obj, 1, py_image_max);
static mp_obj_t py_image_difference(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_difference(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_line_op(n_args, pos_args, kw_args, imlib_difference_line_op);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_difference_obj, 1, py_image_difference);
#endif // IMLIB_ENABLE_MATH_OPS
#if defined(IMLIB_ENABLE_MATH_OPS) && defined(IMLIB_ENABLE_BINARY_OPS)
static mp_obj_t py_image_top_hat(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_top_hat(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_binary_morph_op(n_args, pos_args, kw_args, imlib_top_hat);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_top_hat_obj, 2, py_image_top_hat);
static mp_obj_t py_image_black_hat(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_black_hat(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
return py_image_binary_morph_op(n_args, pos_args, kw_args, imlib_black_hat);
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_black_hat_obj, 2, py_image_black_hat);
@ -2141,7 +2141,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_black_hat_obj, 2, py_image_black_hat)
// Filtering Methods
////////////////////
static mp_obj_t py_image_histeq(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_histeq(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
bool arg_adaptive =
@ -2163,7 +2163,7 @@ static mp_obj_t py_image_histeq(uint n_args, const mp_obj_t *args, mp_map_t *kw_
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_histeq_obj, 1, py_image_histeq);
#ifdef IMLIB_ENABLE_MEAN
static mp_obj_t py_image_mean(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_mean(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_ksize =
@ -2186,7 +2186,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mean_obj, 2, py_image_mean);
#endif // IMLIB_ENABLE_MEAN
#ifdef IMLIB_ENABLE_MEDIAN
static mp_obj_t py_image_median(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_median(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_ksize =
@ -2212,7 +2212,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_median_obj, 2, py_image_median);
#endif // IMLIB_ENABLE_MEDIAN
#ifdef IMLIB_ENABLE_MODE
static mp_obj_t py_image_mode(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_mode(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_ksize =
@ -2235,7 +2235,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_mode_obj, 2, py_image_mode);
#endif // IMLIB_ENABLE_MODE
#ifdef IMLIB_ENABLE_MIDPOINT
static mp_obj_t py_image_midpoint(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_midpoint(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_ksize =
@ -2261,7 +2261,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_midpoint_obj, 2, py_image_midpoint);
#endif // IMLIB_ENABLE_MIDPOINT
#ifdef IMLIB_ENABLE_MORPH
static mp_obj_t py_image_morph(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_morph(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_mul, ARG_add, ARG_threshold, ARG_offset, ARG_invert, ARG_mask };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_mul, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE } },
@ -2338,7 +2338,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_morph_obj, 3, py_image_morph);
#endif // IMLIB_ENABLE_MORPH
#ifdef IMLIB_ENABLE_GAUSSIAN
static mp_obj_t py_image_gaussian(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_gaussian(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_unsharp, ARG_mul, ARG_add, ARG_threshold, ARG_offset, ARG_invert, ARG_mask };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_unsharp, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false } },
@ -2405,7 +2405,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_gaussian_obj, 2, py_image_gaussian);
#endif // IMLIB_ENABLE_GAUSSIAN
#ifdef IMLIB_ENABLE_LAPLACIAN
static mp_obj_t py_image_laplacian(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_laplacian(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_sharpen, ARG_mul, ARG_add, ARG_threshold, ARG_offset, ARG_invert, ARG_mask };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_sharpen, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false } },
@ -2473,7 +2473,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_laplacian_obj, 2, py_image_laplacian)
#endif // IMLIB_ENABLE_LAPLACIAN
#ifdef IMLIB_ENABLE_BILATERAL
static mp_obj_t py_image_bilateral(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_bilateral(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int arg_ksize =
@ -2505,7 +2505,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_bilateral_obj, 2, py_image_bilateral)
////////////////////
#ifdef IMLIB_ENABLE_LINPOLAR
static mp_obj_t py_image_linpolar(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_linpolar(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
PY_ASSERT_FALSE_MSG(arg_img->w % 2, "Width must be even!");
@ -2522,7 +2522,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_linpolar_obj, 1, py_image_linpolar);
#endif // IMLIB_ENABLE_LINPOLAR
#ifdef IMLIB_ENABLE_LOGPOLAR
static mp_obj_t py_image_logpolar(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_logpolar(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
PY_ASSERT_FALSE_MSG(arg_img->w % 2, "Width must be even!");
@ -2539,7 +2539,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_logpolar_obj, 1, py_image_logpolar);
#endif // IMLIB_ENABLE_LOGPOLAR
#ifdef IMLIB_ENABLE_LENS_CORR
static mp_obj_t py_image_lens_corr(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_lens_corr(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
PY_ASSERT_FALSE_MSG(arg_img->w % 2, "Width must be even!");
@ -2565,7 +2565,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_lens_corr_obj, 1, py_image_lens_corr)
#endif // IMLIB_ENABLE_LENS_CORR
#ifdef IMLIB_ENABLE_ROTATION_CORR
static mp_obj_t py_image_rotation_corr(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_rotation_corr(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img =
py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
float arg_x_rotation =
@ -2680,7 +2680,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_similarity_locals_dict
);
static mp_obj_t py_image_get_similarity(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_image_get_similarity(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_image, ARG_x, ARG_y, ARG_x_scale, ARG_y_scale, ARG_roi,
ARG_channel, ARG_alpha, ARG_color_palette, ARG_alpha_palette, ARG_hint, ARG_dssim
@ -3498,7 +3498,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_histogram_locals_dict
);
static mp_obj_t py_image_get_histogram(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_get_histogram(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
list_t thresholds;
@ -3599,7 +3599,7 @@ static mp_obj_t py_image_get_histogram(uint n_args, const mp_obj_t *args, mp_map
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_get_histogram_obj, 1, py_image_get_histogram);
static mp_obj_t py_image_get_statistics(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_get_statistics(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
list_t thresholds;
@ -3830,7 +3830,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_line_locals_dict
);
static mp_obj_t py_image_get_regression(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_get_regression(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
list_t thresholds;
@ -4428,7 +4428,7 @@ static bool py_image_find_blobs_merge_cb(void *fun_obj, find_blobs_list_lnk_data
return mp_obj_is_true(mp_call_function_2(fun_obj, py_blob_new(blob0), py_blob_new(blob1)));
}
static mp_obj_t py_image_find_blobs(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_blobs(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
list_t thresholds;
@ -4505,7 +4505,7 @@ static mp_obj_t py_image_find_blobs(uint n_args, const mp_obj_t *args, mp_map_t
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_blobs_obj, 2, py_image_find_blobs);
#ifdef IMLIB_ENABLE_FIND_LINES
static mp_obj_t py_image_find_lines(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_lines(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
rectangle_t roi;
@ -4551,7 +4551,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_lines_obj, 1, py_image_find_line
#endif // IMLIB_ENABLE_FIND_LINES
#if defined(IMLIB_ENABLE_FIND_LINE_SEGMENTS) && (!defined(OMV_NO_GPL))
static mp_obj_t py_image_find_line_segments(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_line_segments(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
rectangle_t roi;
@ -4678,7 +4678,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_circle_locals_dict
);
static mp_obj_t py_image_find_circles(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_circles(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
rectangle_t roi;
@ -4827,7 +4827,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_rect_locals_dict
);
static mp_obj_t py_image_find_rects(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_rects(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
rectangle_t roi;
@ -5042,7 +5042,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_qrcode_locals_dict
);
static mp_obj_t py_image_find_qrcodes(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_qrcodes(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
rectangle_t roi;
@ -5255,7 +5255,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
print, py_apriltag_print
);
static mp_obj_t py_image_find_apriltags(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_apriltags(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
rectangle_t roi;
@ -5473,7 +5473,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_datamatrix_locals_dict
);
static mp_obj_t py_image_find_datamatrices(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_datamatrices(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
rectangle_t roi;
@ -5654,7 +5654,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_barcode_locals_dict
);
static mp_obj_t py_image_find_barcodes(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_barcodes(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_image_cobj(args[0]);
rectangle_t roi;
@ -5790,7 +5790,7 @@ static MP_DEFINE_CONST_OBJ_TYPE(
locals_dict, &py_displacement_locals_dict
);
static mp_obj_t py_image_find_displacement(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_displacement(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
image_t *arg_template_img = py_helper_arg_to_image(args[1], ARG_IMAGE_MUTABLE);
@ -5827,7 +5827,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_displacement_obj, 2, py_image_fi
#endif // IMLIB_ENABLE_FIND_DISPLACEMENT
#ifdef IMLIB_FIND_TEMPLATE
static mp_obj_t py_image_find_template(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_template(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_GRAYSCALE);
image_t *arg_template = py_helper_arg_to_image(args[1], ARG_IMAGE_GRAYSCALE);
float arg_thresh = mp_obj_get_float(args[2]);
@ -5872,7 +5872,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_template_obj, 3, py_image_find_t
#endif // IMLIB_FIND_TEMPLATE
#ifdef IMLIB_ENABLE_FEATURES
static mp_obj_t py_image_find_features(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_features(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
cascade_t *cascade = py_cascade_cobj(args[1]);
cascade->threshold = py_helper_keyword_float(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 0.5f);
@ -5908,7 +5908,7 @@ static mp_obj_t py_image_find_features(uint n_args, const mp_obj_t *args, mp_map
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_features_obj, 2, py_image_find_features);
#endif // IMLIB_ENABLE_FEATURES
static mp_obj_t py_image_find_eye(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_eye(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_GRAYSCALE);
rectangle_t roi;
@ -5927,7 +5927,7 @@ static mp_obj_t py_image_find_eye(uint n_args, const mp_obj_t *args, mp_map_t *k
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_eye_obj, 2, py_image_find_eye);
#ifdef IMLIB_ENABLE_FIND_LBP
static mp_obj_t py_image_find_lbp(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_lbp(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_GRAYSCALE);
rectangle_t roi;
@ -5942,7 +5942,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_lbp_obj, 2, py_image_find_lbp);
#endif // IMLIB_ENABLE_FIND_LBP
#ifdef IMLIB_ENABLE_FIND_KEYPOINTS
static mp_obj_t py_image_find_keypoints(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_keypoints(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
rectangle_t roi;
@ -5983,7 +5983,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_keypoints_obj, 1, py_image_find_
#endif // IMLIB_ENABLE_FIND_KEYPOINTS
#ifdef IMLIB_ENABLE_BINARY_OPS
static mp_obj_t py_image_find_edges(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_edges(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_GRAYSCALE);
edge_detector_t edge_type = mp_obj_get_int(args[1]);
@ -6022,7 +6022,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_edges_obj, 2, py_image_find_edge
#endif
#ifdef IMLIB_ENABLE_HOG
static mp_obj_t py_image_find_hog(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_find_hog(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *arg_img = py_helper_arg_to_image(args[0], ARG_IMAGE_GRAYSCALE);
rectangle_t roi;
@ -6040,7 +6040,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_hog_obj, 1, py_image_find_hog);
#endif // IMLIB_ENABLE_HOG
#ifdef IMLIB_ENABLE_SELECTIVE_SEARCH
static mp_obj_t py_image_selective_search(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_selective_search(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *img = py_helper_arg_to_image(args[0], ARG_IMAGE_MUTABLE);
int t = py_helper_keyword_int(n_args, args, 1, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_threshold), 500);
int s = py_helper_keyword_int(n_args, args, 2, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_size), 20);
@ -6069,7 +6069,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_selective_search_obj, 1, py_image_sel
#endif // IMLIB_ENABLE_SELECTIVE_SEARCH
#ifdef IMLIB_ENABLE_STEREO_DISPARITY
static mp_obj_t py_image_stereo_disparity(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_stereo_disparity(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
image_t *img = py_helper_arg_to_image(args[0], ARG_IMAGE_GRAYSCALE);
if (img->w % 2) {
@ -6633,7 +6633,7 @@ mp_obj_t py_image_grayscale_to_yuv(mp_obj_t arg) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_image_grayscale_to_yuv_obj, py_image_grayscale_to_yuv);
mp_obj_t py_image_rgb_to_binary(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_rgb_to_binary(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
uint8_t r = mp_obj_get_int(arg_vec[0]) & 255;
@ -6644,7 +6644,7 @@ mp_obj_t py_image_rgb_to_binary(uint n_args, const mp_obj_t *args, mp_map_t *kw_
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_rgb_to_binary_obj, 1, py_image_rgb_to_binary);
mp_obj_t py_image_rgb_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_rgb_to_grayscale(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
uint8_t r = mp_obj_get_int(arg_vec[0]) & 255;
@ -6655,7 +6655,7 @@ mp_obj_t py_image_rgb_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_rgb_to_grayscale_obj, 1, py_image_rgb_to_grayscale);
mp_obj_t py_image_rgb_to_lab(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_rgb_to_lab(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
uint8_t r = mp_obj_get_int(arg_vec[0]) & 255;
@ -6669,7 +6669,7 @@ mp_obj_t py_image_rgb_to_lab(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_rgb_to_lab_obj, 1, py_image_rgb_to_lab);
mp_obj_t py_image_rgb_to_yuv(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_rgb_to_yuv(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
uint8_t r = mp_obj_get_int(arg_vec[0]) & 255;
@ -6683,7 +6683,7 @@ mp_obj_t py_image_rgb_to_yuv(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_rgb_to_yuv_obj, 1, py_image_rgb_to_yuv);
mp_obj_t py_image_lab_to_binary(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_lab_to_binary(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t l = (mp_obj_get_int(arg_vec[0]) & 255) % 100;
@ -6694,7 +6694,7 @@ mp_obj_t py_image_lab_to_binary(uint n_args, const mp_obj_t *args, mp_map_t *kw_
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_lab_to_binary_obj, 1, py_image_lab_to_binary);
mp_obj_t py_image_lab_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_lab_to_grayscale(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t l = (mp_obj_get_int(arg_vec[0]) & 255) % 100;
@ -6705,7 +6705,7 @@ mp_obj_t py_image_lab_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_lab_to_grayscale_obj, 1, py_image_lab_to_grayscale);
mp_obj_t py_image_lab_to_rgb(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_lab_to_rgb(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t l = (mp_obj_get_int(arg_vec[0]) & 255) % 100;
@ -6719,7 +6719,7 @@ mp_obj_t py_image_lab_to_rgb(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_lab_to_rgb_obj, 1, py_image_lab_to_rgb);
mp_obj_t py_image_lab_to_yuv(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_lab_to_yuv(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t l = (mp_obj_get_int(arg_vec[0]) & 255) % 100;
@ -6733,7 +6733,7 @@ mp_obj_t py_image_lab_to_yuv(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_lab_to_yuv_obj, 1, py_image_lab_to_yuv);
mp_obj_t py_image_yuv_to_binary(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_yuv_to_binary(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t y = mp_obj_get_int(arg_vec[0]) & 255;
@ -6744,7 +6744,7 @@ mp_obj_t py_image_yuv_to_binary(uint n_args, const mp_obj_t *args, mp_map_t *kw_
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_yuv_to_binary_obj, 1, py_image_yuv_to_binary);
mp_obj_t py_image_yuv_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_yuv_to_grayscale(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t y = mp_obj_get_int(arg_vec[0]) & 255;
@ -6755,7 +6755,7 @@ mp_obj_t py_image_yuv_to_grayscale(uint n_args, const mp_obj_t *args, mp_map_t *
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_yuv_to_grayscale_obj, 1, py_image_yuv_to_grayscale);
mp_obj_t py_image_yuv_to_rgb(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_yuv_to_rgb(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t y = mp_obj_get_int(arg_vec[0]) & 255;
@ -6769,7 +6769,7 @@ mp_obj_t py_image_yuv_to_rgb(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_yuv_to_rgb_obj, 1, py_image_yuv_to_rgb);
mp_obj_t py_image_yuv_to_lab(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_yuv_to_lab(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
const mp_obj_t *arg_vec;
py_helper_consume_array(n_args, args, 0, 3, &arg_vec);
int8_t y = mp_obj_get_int(arg_vec[0]) & 255;
@ -6802,7 +6802,7 @@ mp_obj_t py_image_from_struct(image_t *img) {
}
#ifdef IMLIB_ENABLE_FEATURES
mp_obj_t py_image_load_cascade(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_load_cascade(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
cascade_t cascade;
const char *path = mp_obj_str_get_str(args[0]);
@ -6836,7 +6836,7 @@ static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_load_cascade_obj, 1, py_image_load_ca
#if defined(IMLIB_ENABLE_DESCRIPTOR)
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
mp_obj_t py_image_load_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_load_descriptor(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
FIL fp;
FRESULT res = FR_OK;
@ -6898,7 +6898,7 @@ mp_obj_t py_image_load_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *k
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_load_descriptor_obj, 1, py_image_load_descriptor);
mp_obj_t py_image_save_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t py_image_save_descriptor(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
FIL fp;
FRESULT res = FR_OK;
@ -6956,7 +6956,7 @@ mp_obj_t py_image_save_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *k
static MP_DEFINE_CONST_FUN_OBJ_KW(py_image_save_descriptor_obj, 2, py_image_save_descriptor);
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
static mp_obj_t py_image_match_descriptor(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) {
static mp_obj_t py_image_match_descriptor(size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
mp_obj_t match_obj = mp_const_none;
const mp_obj_type_t *desc1_type = mp_obj_get_type(args[0]);
const mp_obj_type_t *desc2_type = mp_obj_get_type(args[1]);

View File

@ -323,7 +323,7 @@ static void int_py_imageio_read_chunk(py_imageio_obj_t *stream, image_t *image,
}
#endif
static mp_obj_t py_imageio_read(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_imageio_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_copy_to_fb, ARG_loop, ARG_pause };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_copy_to_fb, MP_ARG_INT, {.u_bool = true } },

View File

@ -93,7 +93,7 @@ static mp_obj_t py_mjpeg_size(mp_obj_t self_in) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_mjpeg_size_obj, py_mjpeg_size);
static mp_obj_t py_mjpeg_write(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_mjpeg_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_roi, ARG_channel, ARG_alpha, ARG_color_palette, ARG_alpha_palette, ARG_hint, ARG_quality };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_roi, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE} },
@ -176,7 +176,7 @@ static mp_obj_t py_mjpeg_close(mp_obj_t self_in) {
}
static MP_DEFINE_CONST_FUN_OBJ_1(py_mjpeg_close_obj, py_mjpeg_close);
static mp_obj_t py_mjpeg_open(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_mjpeg_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_width, ARG_height };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_width, MP_ARG_INT, {.u_int = -1 } },

View File

@ -242,7 +242,7 @@ static void py_ml_model_print(const mp_print_t *print, mp_obj_t self_in, mp_prin
mp_printf(print, " }");
}
static mp_obj_t py_ml_model_predict(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_ml_model_predict(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_callback };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_callback, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_NONE} },

View File

@ -76,7 +76,7 @@ static mp_obj_t py_omv_debug_mode() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_omv_debug_mode_obj, py_omv_debug_mode);
static mp_obj_t py_omv_disable_fb(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_omv_disable_fb(size_t n_args, const mp_obj_t *args) {
if (!n_args) {
return mp_obj_new_bool(!fb_get_streaming_enabled());
}

View File

@ -229,7 +229,7 @@ static mp_obj_t py_tof_deinit() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_tof_deinit_obj, py_tof_deinit);
mp_obj_t py_tof_init(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_tof_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_type };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_type, MP_ARG_INT, {.u_int = -1 } },
@ -367,7 +367,7 @@ static mp_obj_t py_tof_refresh() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_tof_refresh_obj, py_tof_refresh);
mp_obj_t py_tof_read_depth(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_tof_read_depth(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_hmirror, ARG_vflip, ARG_transpose, ARG_timeout };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_hmirror, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_bool = false } },
@ -402,7 +402,7 @@ mp_obj_t py_tof_read_depth(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_a
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_tof_read_depth_obj, 0, py_tof_read_depth);
mp_obj_t py_tof_draw_depth(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_tof_draw_depth(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_x, ARG_y, ARG_x_scale, ARG_y_scale, ARG_roi, ARG_channel, ARG_alpha,
ARG_color_palette, ARG_alpha_palette, ARG_hint, ARG_scale
@ -476,7 +476,7 @@ mp_obj_t py_tof_draw_depth(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_a
}
static MP_DEFINE_CONST_FUN_OBJ_KW(py_tof_draw_depth_obj, 2, py_tof_draw_depth);
mp_obj_t py_tof_snapshot(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
mp_obj_t py_tof_snapshot(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_hmirror, ARG_vflip, ARG_transpose, ARG_x_scale, ARG_y_scale, ARG_roi, ARG_channel,
ARG_alpha, ARG_color_palette, ARG_alpha_palette, ARG_hint, ARG_scale, ARG_pixformat,

View File

@ -778,7 +778,7 @@ static mp_obj_t py_tv_deinit() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_tv_deinit_obj, py_tv_deinit);
static mp_obj_t py_tv_init(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_tv_init(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum { ARG_type, ARG_triple_buffer };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_type, MP_ARG_INT, {.u_int = TV_SHIELD } },
@ -848,7 +848,7 @@ static mp_obj_t py_tv_refresh() {
}
static MP_DEFINE_CONST_FUN_OBJ_0(py_tv_refresh_obj, py_tv_refresh);
static mp_obj_t py_tv_channel(uint n_args, const mp_obj_t *args) {
static mp_obj_t py_tv_channel(size_t n_args, const mp_obj_t *args) {
if (tv_type == TV_NONE) {
mp_raise_msg(&mp_type_ValueError, MP_ERROR_TEXT("TV controller is not initialized"));
}
@ -883,7 +883,7 @@ static mp_obj_t py_tv_channel(uint n_args, const mp_obj_t *args) {
}
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(py_tv_channel_obj, 0, 1, py_tv_channel);
static mp_obj_t py_tv_display(uint n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
static mp_obj_t py_tv_display(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
enum {
ARG_x, ARG_y, ARG_x_scale, ARG_y_scale, ARG_roi, ARG_channel, ARG_alpha,
ARG_color_palette, ARG_alpha_palette, ARG_hint