def set_image_RGB(g, imgs, x=None, y=None, m=0, addr=None): if x == None: x = 4 - imgs[0].width() // 2 if y == None: y = 4 - imgs[0].height() // 2 cmd = b'seIC%c' % g + _ % (x, y, m) for i in imgs: cmd += b'%s\x00' % (repr(i)[7:-3]) C(S(addr, 15), cmd, 1)
def set_pixel_range(g,pos,cs,addr=None): i,X=0,len(cs) while i<X: css=cs[i:i+8] cmd=b'setL'+_%(g,pos,len(css)) for c in css: cmd+=_%c C(S(addr,15),cmd,1) i+=8;pos+=8
def set_pixel(g,pos,c,addr=None): C(S(addr,15),b'setP%c%c'%(g,pos)+_%c,1)
def fill(g,c,addr=None): C(S(addr,15),b'fill%c'%g+_%c,1)
def setup(grps,addr=None): cmd=b'init%c'%len(grps) for t in grps: cmd+=b'%c'%t C(S(addr,15),cmd,1)
def set_xy(g,x,y,c,addr=None): C(S(addr,15),b'setX%c%c%c'%(g,x,y)+_%c,1)
def set_rainbow(g, t, x, n, addr=None): C(S(addr, 15), b'rnbl%c%c%c%c ' % (g, t, x, n), 1)
def shift(g, x, y=0, addr=None): C(S(addr, 15), b'shft' + _ % (g, P(x), P(y)), 1)
def set_image(g, img, x=None, y=None, m=0, addr=None): if x == None: x = 4 - img.width() // 2 if y == None: y = 4 - img.height() // 2 C(S(addr, 15), b'setI%c%c%c%c%s\x00' % (g, x, y, m, repr(img)[7:-3]), 1)