mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Rename flag.
This commit is contained in:
parent
8614b66899
commit
222d704ac3
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
//#define IMLIB_ENABLE_IMAGE_IO
|
||||
//#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
//#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
#define IMLIB_ENABLE_IMAGE_IO
|
||||
#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
#define IMLIB_ENABLE_IMAGE_IO
|
||||
#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
#define IMLIB_ENABLE_IMAGE_IO
|
||||
#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
#define IMLIB_ENABLE_IMAGE_IO
|
||||
#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
#define IMLIB_ENABLE_IMAGE_IO
|
||||
#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
#define __IMLIB_CONFIG_H__
|
||||
|
||||
// Enable Image I/O
|
||||
#define IMLIB_ENABLE_IMAGE_IO
|
||||
#define IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
// Enable LAB LUT
|
||||
//#define IMLIB_ENABLE_LAB_LUT
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
*
|
||||
*/
|
||||
#include "imlib_config.h"
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
#include <string.h>
|
||||
#include "py/runtime.h"
|
||||
@ -464,4 +464,4 @@ void write_data(FIL *fp, const void *data, UINT size)
|
||||
if (bytes != size) ff_write_fail(fp);
|
||||
}
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
@ -212,7 +212,7 @@ void usbdbg_data_out(void *buffer, int length)
|
||||
break;
|
||||
|
||||
case USBDBG_TEMPLATE_SAVE: {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
image_t image;
|
||||
framebuffer_initialize_image(&image);
|
||||
|
||||
@ -227,12 +227,12 @@ void usbdbg_data_out(void *buffer, int length)
|
||||
|
||||
// raise a flash IRQ to flush image
|
||||
//NVIC->STIR = FLASH_IRQn;
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
break;
|
||||
}
|
||||
|
||||
case USBDBG_DESCRIPTOR_SAVE: {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)\
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)\
|
||||
&& defined(IMLIB_ENABLE_KEYPOINTS)
|
||||
image_t image;
|
||||
framebuffer_initialize_image(&image);
|
||||
@ -245,7 +245,7 @@ void usbdbg_data_out(void *buffer, int length)
|
||||
char *path = (char*)buffer+sizeof(rectangle_t);
|
||||
|
||||
py_image_descriptor_from_roi(&image, path, roi);
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO && IMLIB_ENABLE_KEYPOINTS
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO && IMLIB_ENABLE_KEYPOINTS
|
||||
cmd = USBDBG_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* BMP reader/writer.
|
||||
*/
|
||||
#include "imlib.h"
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "py/obj.h"
|
||||
@ -305,4 +305,4 @@ void bmp_write_subimg(image_t *img, const char *path, rectangle_t *r)
|
||||
|
||||
file_close(&fp);
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* A simple GIF encoder.
|
||||
*/
|
||||
#include "imlib.h"
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
#include "fb_alloc.h"
|
||||
#include "ff_wrapper.h"
|
||||
@ -117,4 +117,4 @@ void gif_close(FIL *fp)
|
||||
write_byte(fp, ';');
|
||||
file_close(fp);
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
@ -165,7 +165,7 @@ array_t *imlib_detect_objects(image_t *image, cascade_t *cascade, rectangle_t *r
|
||||
return objects;
|
||||
}
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
int imlib_load_cascade_from_file(cascade_t *cascade, const char *path)
|
||||
{
|
||||
int i;
|
||||
@ -251,7 +251,7 @@ error:
|
||||
file_close(&fp);
|
||||
return res;
|
||||
}
|
||||
#endif //(IMLIB_ENABLE_IMAGE_IO)
|
||||
#endif //(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
int imlib_load_cascade(cascade_t *cascade, const char *path)
|
||||
{
|
||||
@ -281,7 +281,7 @@ int imlib_load_cascade(cascade_t *cascade, const char *path)
|
||||
cascade->weights_array = (int8_t *)eye_weights_array;
|
||||
cascade->rectangles_array = (int8_t *)eye_rectangles_array;
|
||||
} else {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
// xml cascade
|
||||
return imlib_load_cascade_from_file(cascade, path);
|
||||
#else
|
||||
|
||||
@ -937,7 +937,7 @@ void imlib_bayer_to_binary(image_t *img, int x_offset, int y_offset, int width,
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
static save_image_format_t imblib_parse_extension(image_t *img, const char *path)
|
||||
{
|
||||
size_t l = strlen(path);
|
||||
@ -1039,12 +1039,12 @@ static void imlib_read_pixels(FIL *fp, image_t *img, int n_lines, img_read_setti
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
void imlib_image_operation(image_t *img, const char *path, image_t *other, int scalar, line_op_t op, void *data)
|
||||
{
|
||||
if (path) {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
uint32_t size = fb_avail() / 2;
|
||||
void *alloc = fb_alloc(size, FB_ALLOC_NO_HINT); // We have to do this before the read.
|
||||
// This code reads a window of an image in at a time and then executes
|
||||
@ -1166,7 +1166,7 @@ void imlib_image_operation(image_t *img, const char *path, image_t *other, int s
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
void imlib_load_image(image_t *img, const char *path)
|
||||
{
|
||||
FIL fp;
|
||||
@ -1229,7 +1229,7 @@ void imlib_save_image(image_t *img, const char *path, rectangle_t *roi, int qual
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ -1290,7 +1290,7 @@ jpeg_overflow:
|
||||
}
|
||||
#endif //defined OMV_HARDWARE_JPEG
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
// This function inits the geometry values of an image.
|
||||
void jpeg_read_geometry(FIL *fp, image_t *img, const char *path, jpg_read_settings_t *rs)
|
||||
{
|
||||
@ -1377,4 +1377,4 @@ void jpeg_write(image_t *img, const char *path, int quality)
|
||||
}
|
||||
file_close(&fp);
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO)
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
* A simple MJPEG encoder.
|
||||
*/
|
||||
#include "imlib.h"
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
#include "fb_alloc.h"
|
||||
#include "ff_wrapper.h"
|
||||
@ -151,4 +151,4 @@ void mjpeg_close(FIL *fp, uint32_t *frames, uint32_t *bytes, float fps)
|
||||
write_long(fp, 4 + (*frames * 8) + *bytes);
|
||||
file_close(fp);
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
@ -704,7 +704,7 @@ int orb_filter_keypoints(array_t *kpts, rectangle_t *r, point_t *c)
|
||||
return matches;
|
||||
}
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
int orb_save_descriptor(FIL *fp, array_t *kpts)
|
||||
{
|
||||
UINT bytes;
|
||||
@ -824,7 +824,7 @@ int orb_load_descriptor(FIL *fp, array_t *kpts)
|
||||
error:
|
||||
return res;
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
float orb_cluster_dist(int cx, int cy, void *kp_in)
|
||||
{
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
#include "imlib.h"
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
|
||||
#include <stdio.h>
|
||||
#include "py/obj.h"
|
||||
@ -165,4 +165,4 @@ void ppm_write_subimg(image_t *img, const char *path, rectangle_t *r)
|
||||
|
||||
file_close(&fp);
|
||||
}
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
@ -26,7 +26,7 @@ typedef struct py_gif_obj {
|
||||
int height;
|
||||
bool color;
|
||||
bool loop;
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
FIL fp;
|
||||
#endif
|
||||
} py_gif_obj_t;
|
||||
@ -40,7 +40,7 @@ static mp_obj_t py_gif_open(uint n_args, const mp_obj_t *args, mp_map_t *kw_args
|
||||
gif->loop = py_helper_keyword_int(n_args, args, 4, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_loop), true);
|
||||
gif->base.type = &py_gif_type;
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
file_write_open(&gif->fp, mp_obj_str_get_str(args[0]));
|
||||
gif_open(&gif->fp, gif->width, gif->height, gif->color, gif->loop);
|
||||
#else
|
||||
@ -69,7 +69,7 @@ static mp_obj_t py_gif_format(mp_obj_t gif_obj)
|
||||
|
||||
static mp_obj_t py_gif_size(mp_obj_t gif_obj)
|
||||
{
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
py_gif_obj_t *arg_gif = gif_obj;
|
||||
return mp_obj_new_int(file_size_w_buf(&arg_gif->fp));
|
||||
#else
|
||||
@ -85,7 +85,7 @@ static mp_obj_t py_gif_loop(mp_obj_t gif_obj)
|
||||
|
||||
static mp_obj_t py_gif_add_frame(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||
{
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
py_gif_obj_t *arg_gif = args[0];
|
||||
image_t *arg_img = py_image_cobj(args[1]);
|
||||
PY_ASSERT_FALSE_MSG(IM_IS_JPEG(arg_img), "Operation not supported on JPEG images.");
|
||||
@ -104,7 +104,7 @@ static mp_obj_t py_gif_add_frame(uint n_args, const mp_obj_t *args, mp_map_t *kw
|
||||
|
||||
static mp_obj_t py_gif_close(mp_obj_t gif_obj)
|
||||
{
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
py_gif_obj_t *arg_gif = gif_obj;
|
||||
gif_close(&arg_gif->fp);
|
||||
#endif
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
static const mp_obj_type_t py_cascade_type;
|
||||
static const mp_obj_type_t py_image_type;
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
extern const char *ffs_strerror(FRESULT res);
|
||||
#endif
|
||||
|
||||
@ -1578,7 +1578,7 @@ static mp_obj_t py_image_crop(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_crop_obj, 1, py_image_crop);
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#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)
|
||||
{
|
||||
image_t *arg_img = py_image_cobj(args[0]);
|
||||
@ -1596,7 +1596,7 @@ static mp_obj_t py_image_save(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
|
||||
return args[0];
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_save_obj, 2, py_image_save);
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
static mp_obj_t py_image_flush(mp_obj_t img_obj)
|
||||
{
|
||||
@ -6341,7 +6341,7 @@ static const mp_rom_map_elem_t locals_dict_table[] = {
|
||||
{MP_ROM_QSTR(MP_QSTR_copy), MP_ROM_PTR(&py_image_copy_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_crop), MP_ROM_PTR(&py_image_crop_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_scale), MP_ROM_PTR(&py_image_crop_obj)},
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
{MP_ROM_QSTR(MP_QSTR_save), MP_ROM_PTR(&py_image_save_obj)},
|
||||
#else
|
||||
{MP_ROM_QSTR(MP_QSTR_save), MP_ROM_PTR(&py_func_unavailable_obj)},
|
||||
@ -6622,7 +6622,7 @@ static const mp_obj_type_t py_image_type = {
|
||||
.locals_dict = (mp_obj_t) &locals_dict
|
||||
};
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
// ImageWriter Object //
|
||||
typedef struct py_imagewriter_obj {
|
||||
mp_obj_base_t base;
|
||||
@ -6842,7 +6842,7 @@ mp_obj_t py_image_imagereader(mp_obj_t path)
|
||||
return obj;
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_image_imagereader_obj, py_image_imagereader);
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
mp_obj_t py_image_binary_to_grayscale(mp_obj_t arg)
|
||||
{
|
||||
@ -7151,7 +7151,7 @@ mp_obj_t py_image_load_image(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
fb_alloc_mark();
|
||||
FIL fp;
|
||||
img_read_settings_t rs;
|
||||
@ -7161,7 +7161,7 @@ mp_obj_t py_image_load_image(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
|
||||
#else
|
||||
(void) path;
|
||||
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "Image I/O is not supported"));
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
}
|
||||
|
||||
if (copy_to_fb) {
|
||||
@ -7176,7 +7176,7 @@ mp_obj_t py_image_load_image(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
|
||||
if (mode) {
|
||||
memset(image.data, 0, image_size(&image));
|
||||
} else {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
imlib_load_image(&image, path);
|
||||
fb_alloc_free_till_mark();
|
||||
#endif
|
||||
@ -7206,7 +7206,7 @@ mp_obj_t py_image_load_cascade(uint n_args, const mp_obj_t *args, mp_map_t *kw_a
|
||||
// Load cascade from file or flash
|
||||
int res = imlib_load_cascade(&cascade, path);
|
||||
if (res != FR_OK) {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
// cascade is not built-in and failed to load it from file.
|
||||
nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, ffs_strerror(res)));
|
||||
#else
|
||||
@ -7231,7 +7231,7 @@ mp_obj_t py_image_load_cascade(uint n_args, const mp_obj_t *args, mp_map_t *kw_a
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_load_cascade_obj, 1, py_image_load_cascade);
|
||||
|
||||
#if defined(IMLIB_ENABLE_DESCRIPTOR)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#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)
|
||||
{
|
||||
FIL fp;
|
||||
@ -7361,7 +7361,7 @@ error:
|
||||
return mp_const_true;
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_save_descriptor_obj, 2, py_image_save_descriptor);
|
||||
#endif //IMLIB_ENABLE_IMAGE_IO
|
||||
#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)
|
||||
{
|
||||
@ -7448,7 +7448,7 @@ static mp_obj_t py_image_match_descriptor(uint n_args, const mp_obj_t *args, mp_
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_match_descriptor_obj, 2, py_image_match_descriptor);
|
||||
#endif //IMLIB_ENABLE_DESCRIPTOR
|
||||
|
||||
#if defined(IMLIB_ENABLE_FIND_KEYPOINTS) && defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_FIND_KEYPOINTS) && defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
int py_image_descriptor_from_roi(image_t *img, const char *path, rectangle_t *roi)
|
||||
{
|
||||
FIL fp;
|
||||
@ -7470,7 +7470,7 @@ int py_image_descriptor_from_roi(image_t *img, const char *path, rectangle_t *ro
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif // IMLIB_ENABLE_KEYPOINTS && IMLIB_ENABLE_IMAGE_IO
|
||||
#endif // IMLIB_ENABLE_KEYPOINTS && IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
|
||||
static const mp_rom_map_elem_t globals_dict_table[] = {
|
||||
{MP_ROM_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_image)},
|
||||
@ -7521,7 +7521,7 @@ static const mp_rom_map_elem_t globals_dict_table[] = {
|
||||
{MP_ROM_QSTR(MP_QSTR_CODE93), MP_ROM_INT(BARCODE_CODE93)},
|
||||
{MP_ROM_QSTR(MP_QSTR_CODE128), MP_ROM_INT(BARCODE_CODE128)},
|
||||
#endif
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
{MP_ROM_QSTR(MP_QSTR_ImageWriter), MP_ROM_PTR(&py_image_imagewriter_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_ImageReader), MP_ROM_PTR(&py_image_imagereader_obj)},
|
||||
#else
|
||||
@ -7550,13 +7550,13 @@ static const mp_rom_map_elem_t globals_dict_table[] = {
|
||||
{MP_ROM_QSTR(MP_QSTR_yuv_to_lab), MP_ROM_PTR(&py_image_yuv_to_lab_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_Image), MP_ROM_PTR(&py_image_load_image_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_HaarCascade), MP_ROM_PTR(&py_image_load_cascade_obj)},
|
||||
#if defined(IMLIB_ENABLE_DESCRIPTOR) && defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_DESCRIPTOR) && defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
{MP_ROM_QSTR(MP_QSTR_load_descriptor), MP_ROM_PTR(&py_image_load_descriptor_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_save_descriptor), MP_ROM_PTR(&py_image_save_descriptor_obj)},
|
||||
#else
|
||||
{MP_ROM_QSTR(MP_QSTR_load_descriptor), MP_ROM_PTR(&py_func_unavailable_obj)},
|
||||
{MP_ROM_QSTR(MP_QSTR_save_descriptor), MP_ROM_PTR(&py_func_unavailable_obj)},
|
||||
#endif //IMLIB_ENABLE_DESCRIPTOR && IMLIB_ENABLE_IMAGE_IO
|
||||
#endif //IMLIB_ENABLE_DESCRIPTOR && IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
#if defined(IMLIB_ENABLE_DESCRIPTOR)
|
||||
{MP_ROM_QSTR(MP_QSTR_match_descriptor), MP_ROM_PTR(&py_image_match_descriptor_obj)}
|
||||
#else
|
||||
|
||||
@ -24,7 +24,7 @@ typedef struct py_mjpeg_obj {
|
||||
int height;
|
||||
uint32_t frames;
|
||||
uint32_t bytes;
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
FIL fp;
|
||||
#endif
|
||||
} py_mjpeg_obj_t;
|
||||
@ -38,7 +38,7 @@ static mp_obj_t py_mjpeg_open(uint n_args, const mp_obj_t *args, mp_map_t *kw_ar
|
||||
mjpeg->bytes = 0; // private
|
||||
mjpeg->base.type = &py_mjpeg_type;
|
||||
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
file_write_open(&mjpeg->fp, mp_obj_str_get_str(args[0]));
|
||||
mjpeg_open(&mjpeg->fp, mjpeg->width, mjpeg->height);
|
||||
#else
|
||||
@ -61,7 +61,7 @@ static mp_obj_t py_mjpeg_height(mp_obj_t mjpeg_obj)
|
||||
|
||||
static mp_obj_t py_mjpeg_size(mp_obj_t mjpeg_obj)
|
||||
{
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
py_mjpeg_obj_t *arg_mjpeg = mjpeg_obj;
|
||||
return mp_obj_new_int(f_size(&arg_mjpeg->fp));
|
||||
#else
|
||||
@ -71,7 +71,7 @@ static mp_obj_t py_mjpeg_size(mp_obj_t mjpeg_obj)
|
||||
|
||||
static mp_obj_t py_mjpeg_add_frame(uint n_args, const mp_obj_t *args, mp_map_t *kw_args)
|
||||
{
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
py_mjpeg_obj_t *arg_mjpeg = args[0];
|
||||
image_t *arg_img = py_image_cobj(args[1]);
|
||||
PY_ASSERT_FALSE_MSG((arg_mjpeg->width != arg_img->w)
|
||||
@ -89,7 +89,7 @@ static mp_obj_t py_mjpeg_add_frame(uint n_args, const mp_obj_t *args, mp_map_t *
|
||||
|
||||
static mp_obj_t py_mjpeg_close(mp_obj_t mjpeg_obj, mp_obj_t fps_obj)
|
||||
{
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
py_mjpeg_obj_t *arg_mjpeg = mjpeg_obj;
|
||||
mjpeg_close(&arg_mjpeg->fp, &arg_mjpeg->frames, &arg_mjpeg->bytes, mp_obj_get_float(fps_obj));
|
||||
#endif
|
||||
|
||||
@ -140,7 +140,7 @@ STATIC mp_obj_t int_py_tf_load(mp_obj_t path_obj, bool alloc_mode, bool helper_m
|
||||
tf_model->model_data = (unsigned char *) g_person_detect_model_data;
|
||||
tf_model->model_data_len = g_person_detect_model_data_len;
|
||||
} else {
|
||||
#if defined(IMLIB_ENABLE_IMAGE_IO)
|
||||
#if defined(IMLIB_ENABLE_IMAGE_FILE_IO)
|
||||
FIL fp;
|
||||
file_read_open(&fp, path);
|
||||
tf_model->model_data_len = f_size(&fp);
|
||||
|
||||
@ -502,7 +502,7 @@ soft_reset:
|
||||
sensor_init0();
|
||||
framebuffer_init0();
|
||||
fb_alloc_init0();
|
||||
#ifdef IMLIB_ENABLE_IMAGE_IO
|
||||
#ifdef IMLIB_ENABLE_IMAGE_FILE_IO
|
||||
file_buffer_init0();
|
||||
#endif
|
||||
py_lcd_init0();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user