r-cute / rcute-cozmars-server

firmware for Cozmars robot
44 stars 19 forks source link

add clear method for screen #1

Closed hyansuper closed 4 years ago

hyansuper commented 4 years ago

clear(x,y, w, h) is like fill((0,0,0), x, y , w, h) but I think we can make it faster, but I am not sure. ref: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/master/adafruit_rgb_display/rgb.py#L220 the for loop in fill_rectangle() can be optimized:

black_color_array=...
def clear(self,x,y,w, h):
    self._block(x, y, x + width - 1, y + height - 1, black_color_array[:w*h])
hyansuper commented 4 years ago

The noticable delay between clear and next frame is more likely to be caused by network. So we should combine clear & display into one rpc method