Move py_image_unavailable_obj to py_helper.

This commit is contained in:
iabdalkader 2018-06-04 18:14:28 +02:00
parent 3233592c07
commit c9e4be4df3
3 changed files with 9 additions and 8 deletions

View File

@ -7,6 +7,13 @@
extern void *py_image_cobj(mp_obj_t img_obj);
mp_obj_t py_image_unavailable(uint 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 args[0];
}
MP_DEFINE_CONST_FUN_OBJ_KW(py_image_unavailable_obj, 1, py_image_unavailable);
image_t *py_helper_arg_to_image_mutable(const mp_obj_t arg)
{
image_t *arg_img = py_image_cobj(arg);

View File

@ -5,8 +5,9 @@
#ifndef __PY_HELPER_H__
#define __PY_HELPER_H__
#include "py_assert.h"
#include "imlib.h"
#include "py_assert.h"
extern const mp_obj_fun_builtin_var_t py_image_unavailable_obj;
image_t *py_helper_arg_to_image_mutable(const mp_obj_t arg);
image_t *py_helper_arg_to_image_mutable_bayer(const mp_obj_t arg);
image_t *py_helper_arg_to_image_grayscale(const mp_obj_t arg);

View File

@ -5198,13 +5198,6 @@ static mp_obj_t py_image_find_hog(uint n_args, const mp_obj_t *args, mp_map_t *k
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_find_hog_obj, 1, py_image_find_hog);
#endif // IMLIB_ENABLE_HOG
mp_obj_t py_image_unavailable(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
{
PY_ASSERT_TRUE_MSG(false, "This method is unavailable on your OpenMV Cam version.");
return args[0];
}
MP_DEFINE_CONST_FUN_OBJ_KW(py_image_unavailable_obj, 1, py_image_unavailable);
static const mp_rom_map_elem_t locals_dict_table[] = {
/* Basic Methods */
{MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&py_image_width_obj)},