remove comment

This commit is contained in:
JerryXiao 2023-03-10 16:22:10 +08:00
parent be5be94b48
commit 676c87e116
2 changed files with 0 additions and 33 deletions

33
a.py
View File

@ -69,10 +69,6 @@ Y=512
import socket, traceback, time
from PIL import Image
#img = Image.open(args.image)
#img = img.resize((X, Y), Image.Resampling.LANCZOS)
#img.save('out.png')
#img = img.convert('RGBA')
imgdvd = Image.open('dvd.png')
imgdvd = imgdvd.convert('RGBA')
@ -144,29 +140,6 @@ sy = random.randint(0, Y-1-Dy)
fx = random.choice((1, -1))
fy = random.choice((1, -1))
#import numpy as np
#draw_seq = np.arange(X*Y)
#np.random.shuffle(draw_seq)
#def _spr(rangex):
# maxidx = len(rangex) - 1
# ret = []
# mid = maxidx // 2
# dl = mid
# dr = mid
# ret.append(mid)
# while True:
# if dr < maxidx:
# dr += 1
# ret.append(dr)
# if dl > 0:
# dl -= 1
# ret.append(dl)
# if dl <= 0 and dr >= maxidx:
# assert len(ret) - 1 == maxidx
# return ret
#draw_seq = [(i // X, i % X) for i in range(X*Y)]
#draw_seq = [(x, y) for x in _spr(range(X)) for y in _spr(range(Y))]
draw_seq = [(x, y) for x in range(X) for y in range(Y)]
#random.shuffle(draw_seq)
start_bg_task()
@ -176,17 +149,11 @@ def draw(img):
send_icmp_q = []
start = time.time()
print('draw 1 frame in ', end='')
#for x in range(X):
for x, y in draw_seq:
#for y in range(Y):
#if x < skip:
# continue
newpix = img.getpixel((x, y))
r, g, b, a = newpix
if a and newpix != ldraw.getpixel((x, y)):
send_icmp_q.append(f"fdcf:8538:9ad5:3333:{x:x}:{y:x}:11{r:02x}:{g:02x}{b:02x}")
#print(f"fdcf:8538:9ad5:3333:{x:x}:{y:x}:11{r:02x}:{g:02x}{b:02x}")
#time.sleep(slp)
startsend = time.time()
send_icmp(send_icmp_q)
ldraw = img.copy()

BIN
dvd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB