Merge pull request #978 from openmv/copy_to_fb_fix

Update JPEG frame buffer after loading/creating images.
This commit is contained in:
Ibrahim Abd Elkader 2020-11-16 13:54:56 +02:00 committed by GitHub
commit 1eed1ec402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 12 deletions

View File

@ -17,11 +17,5 @@ sensor.set_pixformat(sensor.GRAYSCALE)
# Load image
img = image.Image("/example.bmp", copy_to_fb=True)
# Add drawing code here.
# img.draw_line(...)
# Flush FB
sensor.flush()
# Add a small delay to allow the IDE to read the flushed image.
time.sleep(100)
# Add a small delay to allow the IDE to read the loaded image.
time.sleep(500)

View File

@ -7128,10 +7128,6 @@ mp_obj_t py_image_load_image(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
}
}
if (copy_to_fb) {
fb_update_jpeg_buffer();
}
image_t image = {0};
if (mode) {
@ -7190,6 +7186,10 @@ mp_obj_t py_image_load_image(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg
arg_other->bpp = image.bpp;
}
if (copy_to_fb) {
fb_update_jpeg_buffer();
}
return py_image_from_struct(&image);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_load_image_obj, 1, py_image_load_image);