-
Notifications
You must be signed in to change notification settings - Fork 0
/
paint.py
57 lines (45 loc) · 1.52 KB
/
paint.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"""
~ Latent sound painting // Pompidou center ~
paint.py : Main class for paint handling
This file defines the overall behavior of the latent control through painitng
behavior.
Author : Philippe Esling
All authors contributed equally to the project.
"""
import numpy as np
from multiprocessing import Event
from dataclasses import dataclass
from typing import Array
@dataclass
class Line():
color: np.ndarray
points: np.ndarray
class Paint():
'''
The Button class implements interaction with GPIO push buttons.
It configures GPIO pins with a callback and asynchronous signal
to wake up some external processes
'''
lines: Array[Line]
def __init__(self,
callback: callable,
):
'''
Constructor - Creates a new instance of the Navigation class.
Parameters:
callback: [callable]
Outside function to call on button push
port: [int], optional
Specify the camera port [default: 0]
debounce: [int], optional
Debounce time to prevent multiple firings [default: 250ms]
'''
# Setup callback
self._callback = callback
# Create our own event signal
self._signal = Event()
# Create structures
self._signal = Event()
def create_image(self):
return