Fixed alpha handling, added noise
This commit is contained in:
parent
97a0b8b171
commit
6503863333
2 changed files with 9 additions and 2 deletions
|
|
@ -39,6 +39,6 @@ def sendframe(framedata):
|
|||
# just use the first Mate Light available
|
||||
rgba = len(framedata) == DISPLAY_WIDTH*DISPLAY_HEIGHT*4
|
||||
global dbuf
|
||||
np.copyto(dbuf, np.frombuffer(framedata, dtype=np.uint8))
|
||||
np.copyto(dbuf[:640*(3+rgba)], np.frombuffer(framedata, dtype=np.uint8))
|
||||
ml.matelight_send_frame(matelights, dbuf.ctypes.data_as(POINTER(c_uint8)), c_size_t(CRATES_X), c_size_t(CRATES_Y), c_float(BRIGHTNESS), rgba)
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from collections import namedtuple, deque
|
|||
import itertools
|
||||
import threading
|
||||
import random
|
||||
import os
|
||||
|
||||
from ctypes import *
|
||||
|
||||
|
|
@ -160,7 +161,13 @@ if __name__ == '__main__':
|
|||
elif userver.frame_da():
|
||||
renderer = userver
|
||||
else:
|
||||
sendframe(next(defaulttexts))
|
||||
static_noise = time() % 300 < 60
|
||||
if static_noise:
|
||||
foo = os.urandom(640)
|
||||
frame = bytes([v for c in zip(list(foo), list(foo), list(foo)) for v in c ])
|
||||
else:
|
||||
frame = next(defaulttexts)
|
||||
sendframe(frame)
|
||||
#printframe(next(defaulttexts))
|
||||
continue
|
||||
for frame in renderer:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue