feat: add ability to send full frame via ws #1
@@ -562,6 +562,14 @@ def frame_ws(ws: geventwebsocket.websocket.WebSocket):
|
|||||||
if data.channels == 4 and "w" in msg:
|
if data.channels == 4 and "w" in msg:
|
||||||
data.buffer[..., 3] = msg["w"]
|
data.buffer[..., 3] = msg["w"]
|
||||||
runner.app.datasource.pushData(data)
|
runner.app.datasource.pushData(data)
|
||||||
|
elif msg["ty"] == "full":
|
||||||
|
if runner.app.name != "pixelcanvas":
|
||||||
|
startApp("pixelcanvas")
|
||||||
|
|
||||||
|
data = runner.app.datasource.getData().clone()
|
||||||
|
data.created = time.time()
|
||||||
|
data.buffer = np.reshape(msg["data"], (40,80,3))
|
||||||
|
runner.app.datasource.pushData(data)
|
||||||
|
|
||||||
|
|
||||||
@bottle.route("/save_frame")
|
@bottle.route("/save_frame")
|
||||||
|
|||||||
Reference in New Issue
Block a user