mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #978 from openmv/copy_to_fb_fix
Update JPEG frame buffer after loading/creating images.
This commit is contained in:
commit
1eed1ec402
@ -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)
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user