Stefan Schuermans commited on 2017-05-26 18:43:33
Showing 6 changed files, with 106 additions and 2 deletions.
... | ... |
@@ -1,3 +1,20 @@ |
1 |
+# python EtherPix library |
|
2 |
+# |
|
3 |
+# Copyright 2017 Stefan Schuermans <stefan schuermans info> |
|
4 |
+# |
|
5 |
+# This program is free software: you can redistribute it and/or modify |
|
6 |
+# it under the terms of the GNU General Public License as published by |
|
7 |
+# the Free Software Foundation, version 3 of the License. |
|
8 |
+# |
|
9 |
+# |
|
10 |
+# This program is distributed in the hope that it will be useful, |
|
11 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
+# GNU General Public License for more details. |
|
14 |
+# |
|
15 |
+# You should have received a copy of the GNU Lesser General Public License |
|
16 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
+ |
|
1 | 18 |
import socket |
2 | 19 |
|
3 | 20 |
from distributor import Distributor |
... | ... |
@@ -41,7 +58,8 @@ class Display(object): |
41 | 58 |
distri.data_clear() |
42 | 59 |
|
43 | 60 |
def data_image(self, image): |
44 |
- """set image data""" |
|
61 |
+ """set image data |
|
62 |
+ image: Pillow RGB Image object""" |
|
45 | 63 |
for distri in self._distris.values(): |
46 | 64 |
distri.data_image(image) |
47 | 65 |
|
... | ... |
@@ -1,3 +1,20 @@ |
1 |
+# python EtherPix library |
|
2 |
+# |
|
3 |
+# Copyright 2017 Stefan Schuermans <stefan schuermans info> |
|
4 |
+# |
|
5 |
+# This program is free software: you can redistribute it and/or modify |
|
6 |
+# it under the terms of the GNU General Public License as published by |
|
7 |
+# the Free Software Foundation, version 3 of the License. |
|
8 |
+# |
|
9 |
+# |
|
10 |
+# This program is distributed in the hope that it will be useful, |
|
11 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
+# GNU General Public License for more details. |
|
14 |
+# |
|
15 |
+# You should have received a copy of the GNU Lesser General Public License |
|
16 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
+ |
|
1 | 18 |
import socket |
2 | 19 |
import struct |
3 | 20 |
|
... | ... |
@@ -54,7 +71,8 @@ class Distributor(object): |
54 | 71 |
self._buffer = self._udp_hdr + (clr * (self._outputs * self._pixels)) |
55 | 72 |
|
56 | 73 |
def data_image(self, image): |
57 |
- """set image data""" |
|
74 |
+ """set image data |
|
75 |
+ image: Pillow RGB Image object""" |
|
58 | 76 |
# get image size |
59 | 77 |
(width, height) = image.size |
60 | 78 |
# collect pixels from image and assemble message in buffer |
... | ... |
@@ -1,5 +1,22 @@ |
1 | 1 |
#! /usr/bin/env python |
2 | 2 |
|
3 |
+# python EtherPix library |
|
4 |
+# |
|
5 |
+# Copyright 2017 Stefan Schuermans <stefan schuermans info> |
|
6 |
+# |
|
7 |
+# This program is free software: you can redistribute it and/or modify |
|
8 |
+# it under the terms of the GNU General Public License as published by |
|
9 |
+# the Free Software Foundation, version 3 of the License. |
|
10 |
+# |
|
11 |
+# |
|
12 |
+# This program is distributed in the hope that it will be useful, |
|
13 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
+# GNU General Public License for more details. |
|
16 |
+# |
|
17 |
+# You should have received a copy of the GNU Lesser General Public License |
|
18 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
19 |
+ |
|
3 | 20 |
import sys |
4 | 21 |
import time |
5 | 22 |
|
... | ... |
@@ -1,3 +1,20 @@ |
1 |
+# python EtherPix library |
|
2 |
+# |
|
3 |
+# Copyright 2017 Stefan Schuermans <stefan schuermans info> |
|
4 |
+# |
|
5 |
+# This program is free software: you can redistribute it and/or modify |
|
6 |
+# it under the terms of the GNU General Public License as published by |
|
7 |
+# the Free Software Foundation, version 3 of the License. |
|
8 |
+# |
|
9 |
+# |
|
10 |
+# This program is distributed in the hope that it will be useful, |
|
11 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
+# GNU General Public License for more details. |
|
14 |
+# |
|
15 |
+# You should have received a copy of the GNU Lesser General Public License |
|
16 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
+ |
|
1 | 18 |
from struct import Struct |
2 | 19 |
|
3 | 20 |
|
... | ... |
@@ -1,3 +1,20 @@ |
1 |
+# python EtherPix library |
|
2 |
+# |
|
3 |
+# Copyright 2017 Stefan Schuermans <stefan schuermans info> |
|
4 |
+# |
|
5 |
+# This program is free software: you can redistribute it and/or modify |
|
6 |
+# it under the terms of the GNU General Public License as published by |
|
7 |
+# the Free Software Foundation, version 3 of the License. |
|
8 |
+# |
|
9 |
+# |
|
10 |
+# This program is distributed in the hope that it will be useful, |
|
11 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
+# GNU General Public License for more details. |
|
14 |
+# |
|
15 |
+# You should have received a copy of the GNU Lesser General Public License |
|
16 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
+ |
|
1 | 18 |
import sys |
2 | 19 |
|
3 | 20 |
|
... | ... |
@@ -1,3 +1,20 @@ |
1 |
+# python EtherPix library |
|
2 |
+# |
|
3 |
+# Copyright 2017 Stefan Schuermans <stefan schuermans info> |
|
4 |
+# |
|
5 |
+# This program is free software: you can redistribute it and/or modify |
|
6 |
+# it under the terms of the GNU General Public License as published by |
|
7 |
+# the Free Software Foundation, version 3 of the License. |
|
8 |
+# |
|
9 |
+# |
|
10 |
+# This program is distributed in the hope that it will be useful, |
|
11 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
+# GNU General Public License for more details. |
|
14 |
+# |
|
15 |
+# You should have received a copy of the GNU Lesser General Public License |
|
16 |
+# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 |
+ |
|
1 | 18 |
def parse_addr(addr_str): |
2 | 19 |
"""parse an IPv4 address, e.g. \"1.2.3.4:567\", |
3 | 20 |
return tuple of IP and port, e.g. ("1.2.3.4", 567), None on error""" |
4 | 21 |