Browse Source

various adjustments

Thomas Buck 1 year ago
parent
commit
72ad2d2fe0
10 changed files with 228 additions and 46 deletions
  1. 71
    16
      breakout.py
  2. 8
    4
      camp_pico.py
  3. 37
    19
      camp_small.py
  4. 81
    0
      hardware/frame.scad
  5. BIN
      hardware/frame.stl
  6. 12
    0
      image.py
  7. 4
    2
      pi.py
  8. 11
    2
      snake.py
  9. 1
    1
      test.py
  10. 3
    2
      util.py

+ 71
- 16
breakout.py View File

@@ -11,6 +11,7 @@ from scroll import ScrollText
11 11
 import time
12 12
 import random
13 13
 import math
14
+import util
14 15
 
15 16
 class Breakout:
16 17
     def __init__(self, g, i, ts = 0.1, to = 60.0):
@@ -19,7 +20,7 @@ class Breakout:
19 20
         self.timestep = ts
20 21
         self.timeout = to
21 22
 
22
-        self.paddle_width = 9
23
+        self.paddle_width = 43#9
23 24
 
24 25
         self.winText = ScrollText(self.gui, "You Won!", "uushi",
25 26
                                   2, 50, (0, 255, 0))
@@ -28,6 +29,12 @@ class Breakout:
28 29
         self.scoreText = ScrollText(self.gui, "Score:", "uushi",
29 30
                                     2, 50, (255, 255, 255))
30 31
 
32
+        self.bg_c = (0, 0, 0)
33
+        self.fg_c = (0, 255, 0)
34
+        self.ball_c = (255, 0, 0)
35
+        self.paddle_c = (255, 255, 255)
36
+        self.text_c = (0, 0, 255)
37
+
31 38
         random.seed()
32 39
         self.restart()
33 40
 
@@ -47,11 +54,18 @@ class Breakout:
47 54
         self.score = 0
48 55
         self.direction = ""
49 56
 
50
-        self.data = [[(0, 0, 0) for y in range(self.gui.height)] for x in range(self.gui.width)]
57
+        self.data = [[self.bg_c for y in range(self.gui.height)] for x in range(self.gui.width)]
51 58
 
52 59
         for x in range(self.gui.width - 2):
53 60
             for y in range(5):
54
-                self.data[x + 1][y] = (0, 255, 0)
61
+                self.data[x + 1][y] = self.fg_c
62
+        self.maxScore = 5 * (self.gui.width - 2)
63
+
64
+        # TODO easy mode
65
+        self.nothing_to_lose = True
66
+
67
+        DrawText = util.getTextDrawer()
68
+        self.text = DrawText(self.gui, self.text_c)
55 69
 
56 70
         self.place()
57 71
 
@@ -95,8 +109,6 @@ class Breakout:
95 109
         self.old_keys = keys.copy()
96 110
 
97 111
     def step(self):
98
-        # TODO check for collisions with pieces
99
-
100 112
         # move ball
101 113
         self.ball[0] += self.ball[2]
102 114
         self.ball[1] += self.ball[3]
@@ -104,10 +116,21 @@ class Breakout:
104 116
         # check for collision with left wall
105 117
         if self.ball[0] <= 0:
106 118
             self.ball[2] = -self.ball[2]
119
+            self.ball[0] = 0
107 120
 
108 121
         # check for collision with right wall
109 122
         if self.ball[0] >= self.gui.width - 1:
110 123
             self.ball[2] = -self.ball[2]
124
+            self.ball[0] = self.gui.width - 1
125
+
126
+        # check for collisions with pieces
127
+        if self.data[int(self.ball[0])][int(self.ball[1])] != self.bg_c:
128
+            self.data[int(self.ball[0])][int(self.ball[1])] = self.bg_c
129
+            self.score += 1
130
+
131
+            # just invert Y travel direction
132
+            # TODO inaccurate collision behaviour in "corners"
133
+            self.ball[3] = -self.ball[3]
111 134
 
112 135
         # check for collision with ceiling
113 136
         if self.ball[1] <= 0:
@@ -115,22 +138,31 @@ class Breakout:
115 138
 
116 139
         # check for collision with paddle
117 140
         if (self.ball[1] == self.gui.height - 2) and (self.ball[0] >= (self.player - int(self.paddle_width / 2))) and (self.ball[0] <= (self.player + int(self.paddle_width / 2))):
118
-            # TODO angle
119
-            self.ball[3] = -self.ball[3]
141
+            # TODO angle for bounce from paddle
142
+            #self.ball[3] = -self.ball[3]
143
+            d = self.ball[0] - (self.player - (self.paddle_width / 2))
144
+            angle = (d / self.paddle_width - 0.5) / 2 * 3.14159
145
+            print(math.degrees(angle))
146
+            self.ball[2] = math.cos(angle) * math.sqrt(2)
147
+            self.ball[3] = math.sin(angle) * math.sqrt(2)
120 148
 
121 149
         # check for collision with floor
122 150
         if self.ball[1] >= self.gui.height - 1:
123
-            self.place()
124
-            self.lives -= 1
151
+            if self.nothing_to_lose:
152
+                # TODO should this bounce with an angle?
153
+                self.ball[3] = -self.ball[3]
154
+            else:
155
+                self.place()
156
+                self.lives -= 1
125 157
 
126 158
     def finishedEndScreen(self):
127
-        if self.score >= self.gui.width * self.gui.height:
159
+        if self.score >= self.maxScore:
128 160
             return self.winText.finished()
129 161
         else:
130 162
             return self.loseText.finished()
131 163
 
132 164
     def drawEndScreen(self):
133
-        if self.score >= self.gui.width * self.gui.height:
165
+        if self.score >= self.maxScore:
134 166
             self.winText.draw()
135 167
         else:
136 168
             self.loseText.draw()
@@ -139,13 +171,15 @@ class Breakout:
139 171
         self.scoreText.draw()
140 172
 
141 173
     def draw(self):
174
+        # handle / generate player inputs
142 175
         if self.input != None:
143 176
             self.buttons()
144 177
         else:
145 178
             # TODO "AI"
146 179
             pass
147 180
 
148
-        if self.lives < 0:
181
+        # only draw end-cards when game is over
182
+        if (self.lives < 0) or (self.score >= self.maxScore):
149 183
             if self.finishedEndScreen():
150 184
                 self.drawScoreScreen()
151 185
             else:
@@ -153,37 +187,58 @@ class Breakout:
153 187
                 self.scoreText.restart()
154 188
             return
155 189
 
190
+        # move paddle according to player input
156 191
         if self.direction == "l":
157 192
             self.player = max(self.player - 1, 0)
158 193
         elif self.direction == "r":
159 194
             self.player = min(self.player + 1, self.gui.width - 1)
160 195
         self.direction = ""
161 196
 
197
+        # run next iteration
162 198
         now = time.time()
163 199
         if (now - self.last) >= self.timestep:
164 200
             self.last = now
165 201
             self.step()
166 202
 
167
-            if self.lives < 0:
203
+            # end game when all lives lost or when won
204
+            if (self.lives < 0) or (self.score >= self.maxScore):
168 205
                 self.scoreText.setText("Score: " + str(self.score), "uushi")
169 206
                 self.winText.restart()
170 207
                 self.loseText.restart()
171 208
                 self.scoreText.restart()
172 209
 
210
+        # draw targets on playing area
173 211
         for x in range(0, self.gui.width):
174 212
             for y in range(0, self.gui.height):
175 213
                 self.gui.set_pixel(x, y, self.data[x][y])
176 214
 
215
+        # draw score
216
+        self.text.setText(str(self.score), "tom-thumb")
217
+        self.text.draw(-1, self.gui.height / 2 - 2)
218
+
219
+        # draw lives
220
+        self.text.setText(str(self.lives), "tom-thumb")
221
+        self.text.draw(-self.gui.width + 4, self.gui.height / 2 - 2)
222
+
223
+        # draw paddle
177 224
         for x in range(0, self.paddle_width):
178
-            self.gui.set_pixel(x + self.player - int(self.paddle_width / 2), self.gui.height - 1, (255, 255, 255))
225
+            self.gui.set_pixel(x + self.player - int(self.paddle_width / 2), self.gui.height - 1, self.paddle_c)
179 226
 
180
-        self.gui.set_pixel(self.ball[0], self.ball[1], (255, 0, 0))
227
+        # draw ball
228
+        self.gui.set_pixel(int(self.ball[0]), int(self.ball[1]), self.ball_c)
181 229
 
182 230
 if __name__ == "__main__":
183
-    import util
184 231
     # Need to import InputWrapper before initializing RGB Matrix on Pi
185 232
     i = util.getInput()
186 233
     t = util.getTarget(i)
187 234
 
188 235
     d = Breakout(t, i)
236
+
237
+    # example color modifications
238
+    d.fg_c = (0, 150, 0)
239
+    d.ball_c = (150, 0, 0)
240
+    d.paddle_c = (150, 150, 150)
241
+    d.text_c = (0, 0, 150)
242
+    d.restart() # re-gen with new colors
243
+
189 244
     util.loop(t, d.draw)

+ 8
- 4
camp_pico.py View File

@@ -26,6 +26,8 @@ from pico import PicoBatt
26 26
 #url = "http://ubabot.frubar.net"
27 27
 url = "http://www.xythobuz.de"
28 28
 
29
+scroll_speed = 10
30
+
29 31
 import util
30 32
 i = util.getInput()
31 33
 t = util.getTarget(i)
@@ -39,20 +41,20 @@ t.loop_end()
39 41
 
40 42
 # UbaBot is online
41 43
 success = Manager(t)
42
-success.add(ScrollText(t, "Visit UbaBot Cocktail machine at FruBar village for drinks!", "bitmap8", 1, 10, camp_green))
44
+success.add(ScrollText(t, "Visit UbaBot Cocktail machine at FruBar village for drinks!", "bitmap8", 1, scroll_speed, camp_green))
43 45
 success.add(Solid(t, 1.0))
44 46
 success.add(QRScreen(t, qr_data, 30.0, "Drinks", "bitmap6", camp_pink, (0, 0, 0)))
45 47
 success.add(Solid(t, 1.0))
46 48
 
47 49
 # UbaBot is offline
48 50
 fail = Manager(t)
49
-fail.add(ScrollText(t, "#CCCAMP23", "bitmap8", 1, 10, camp_green))
51
+fail.add(ScrollText(t, "#CCCAMP23", "bitmap8", 1, scroll_speed, camp_green))
50 52
 fail.add(Solid(t, 1.0))
51
-fail.add(ScrollText(t, "The UbaBot Cocktail machine is closed. Please come back later!", "bitmap8", 1, 10, camp_green))
53
+fail.add(ScrollText(t, "The UbaBot Cocktail machine is closed. Please come back later!", "bitmap8", 1, scroll_speed, camp_green))
52 54
 fail.add(Solid(t, 1.0))
53 55
 fail.add(GameOfLife(t, 20, (0, 255, 0), (0, 0, 0), None, 2.0))
54 56
 fail.add(Solid(t, 1.0))
55
-fail.add(ScrollText(t, "Your advertisement could appear here. Open a Pull Request on git.xythobuz.de/thomas/rgb-matrix-visualizer or send an e-mail to thomas@xythobuz.de", "bitmap8", 1, 10, camp_green))
57
+fail.add(ScrollText(t, "Your advertisement could appear here. Open a Pull Request on git.xythobuz.de/thomas/rgb-matrix-visualizer or send an e-mail to thomas@xythobuz.de", "bitmap8", 1, scroll_speed, camp_green))
56 58
 fail.add(Solid(t, 1.0))
57 59
 
58 60
 # UbaBot status checker
@@ -66,6 +68,8 @@ m.add(QRScreen(t, img_data, 15.0, None, None, (255, 255, 255), (0, 0, 0)))
66 68
 m.add(Solid(t, 1.0))
67 69
 m.add(d) # HTTP Check, either "success" or "fail"
68 70
 m.add(Solid(t, 1.0))
71
+m.add(ScrollText(t, "Need to print something? FruBar village has a 3D printer. Come by!", "bitmap8", 1, scroll_speed, camp_pink))
72
+m.add(Solid(t, 1.0))
69 73
 m.add(PicoBatt(t, 5.0, 5.0))
70 74
 m.add(Solid(t, 1.0))
71 75
 

+ 37
- 19
camp_small.py View File

@@ -22,8 +22,8 @@ from gamepad import InputWrapper
22 22
 from manager import Manager
23 23
 import util
24 24
 
25
-#url = "http://ubabot.frubar.net"
26
-url = "http://www.xythobuz.de"
25
+url_uba = "http://ubabot.frubar.net"
26
+url_printer = "http://i3-am8.fritz.box"
27 27
 
28 28
 scroll_speed = 50
29 29
 
@@ -39,27 +39,42 @@ splash.draw()
39 39
 t.loop_end()
40 40
 
41 41
 # UbaBot is online
42
-success = Manager(t)
43
-success.add(ImageScreen(t, "drinka.gif", 0.2, 2, 20.0, (0, 0, 0)))
44
-success.add(Solid(t, 1.0))
45
-success.add(ScrollText(t, "Visit the UbaBot Cocktail machine at FruBar village for drinks!", "lemon", 2, scroll_speed, camp_green))
46
-success.add(Solid(t, 1.0))
47
-success.add(QRScreen(t, url, 30.0, "Drinks:", "tom-thumb", camp_pink, (0, 0, 0)))
48
-success.add(Solid(t, 1.0))
42
+success_uba = Manager(t)
43
+success_uba.add(ImageScreen(t, "drinka.gif", 0.2, 2, 20.0, (0, 0, 0)))
44
+success_uba.add(Solid(t, 1.0))
45
+success_uba.add(ScrollText(t, "Visit the UbaBot Cocktail machine at FruBar village for drinks!", "lemon", 2, scroll_speed, camp_green))
46
+success_uba.add(Solid(t, 1.0))
47
+success_uba.add(QRScreen(t, url_uba, 30.0, "Drinks:", "tom-thumb", camp_pink, (0, 0, 0)))
48
+success_uba.add(Solid(t, 1.0))
49 49
 
50 50
 # UbaBot is offline
51
-fail = Manager(t)
52
-fail.add(ImageScreen(t, "attention.gif", 0.2, 2, 20.0, (0, 0, 0)))
53
-fail.add(Solid(t, 1.0))
54
-fail.add(ScrollText(t, "The UbaBot Cocktail machine is currently closed. Please come back later for more drinks!", "lemon", 2, scroll_speed, camp_pink))
55
-fail.add(Solid(t, 1.0))
56
-fail.add(GameOfLife(t, 20, (0, 255, 0), (0, 0, 0), None, 2.0))
57
-fail.add(Solid(t, 1.0))
51
+fail_uba = Manager(t)
52
+fail_uba.add(ImageScreen(t, "attention.gif", 0.2, 2, 20.0, (0, 0, 0)))
53
+fail_uba.add(Solid(t, 1.0))
54
+fail_uba.add(ScrollText(t, "The UbaBot Cocktail machine is currently closed. Please come back later for more drinks!", "lemon", 2, scroll_speed, camp_pink))
55
+fail_uba.add(Solid(t, 1.0))
56
+fail_uba.add(GameOfLife(t, 20, (0, 255, 0), (0, 0, 0), None, 2.0))
57
+fail_uba.add(Solid(t, 1.0))
58 58
 
59 59
 # UbaBot status checker
60
-d = CheckHTTP(url)
61
-d.success(success)
62
-d.fail(fail)
60
+d = CheckHTTP(url_uba)
61
+d.success(success_uba)
62
+d.fail(fail_uba)
63
+
64
+# 3D printer is online
65
+success_printer = Manager(t)
66
+success_printer.add(ScrollText(t, "Need to print something? FruBar village has a 3D printer. Come by!", "iv18x16u", 1, scroll_speed, camp_pink))
67
+success_printer.add(Solid(t, 1.0))
68
+
69
+# 3D printer is offline
70
+fail_printer = Manager(t)
71
+fail_printer.add(Solid(t, 1.0))
72
+fail_printer.add(Solid(t, 1.0))
73
+
74
+# Printer status checker
75
+d2 = CheckHTTP(url_printer)
76
+d2.success(success_printer)
77
+d2.fail(fail_printer)
63 78
 
64 79
 # Main "Menu"
65 80
 m = Manager(t, i)
@@ -67,8 +82,11 @@ m.add(ScrollText(t, "#CCCAMP23", "lemon", 1, scroll_speed, camp_green))
67 82
 m.add(Solid(t, 1.0))
68 83
 m.add(ImageScreen(t, "Favicon.png", 0, 1, 10.0))
69 84
 m.add(Solid(t, 1.0))
85
+m.add(ScrollText(t, "Grab a cold draft beer at FruBar village!", "iv18x16u", 1, scroll_speed, camp_green))
70 86
 m.add(d) # HTTP Check, either "success" or "fail"
71 87
 m.add(Solid(t, 1.0))
88
+m.add(d2) # HTTP Check, either "success" or "fail"
89
+m.add(Solid(t, 1.0))
72 90
 m.add(Snake(t, i, camp_pink, camp_green))
73 91
 m.add(Solid(t, 1.0))
74 92
 m.add(ScrollText(t, "Your advertisement could appear here. Open a Pull Request on git.xythobuz.de/thomas/rgb-matrix-visualizer or send an e-mail to thomas@xythobuz.de", "iv18x16u", 2, scroll_speed, camp_green))

+ 81
- 0
hardware/frame.scad View File

@@ -0,0 +1,81 @@
1
+dia = 14.5;
2
+rod_l = 1200;
3
+
4
+wall = 4;
5
+clamp_d = dia + wall * 2;
6
+clamp_h = 30;
7
+screw = 4.5;
8
+
9
+l = rod_l + 2 * dia;
10
+
11
+plane_off = 100;
12
+plane_l = rod_l - plane_off;
13
+
14
+echo("rod", rod_l);
15
+echo("plane", plane_l);
16
+echo("outer", l);
17
+
18
+$fn = $preview ? 42 : 100;
19
+
20
+module rods() {
21
+    // left/right
22
+    for (x = [0, l])
23
+    translate([x, 0, 0])
24
+    cylinder(d = dia, h = rod_l);
25
+    
26
+    // top/bottom
27
+    for (z = [0, l])
28
+    translate([dia, 0, z - dia])
29
+    rotate([0, 90, 0])
30
+    cylinder(d = dia, h = rod_l);
31
+    
32
+    // plane
33
+    translate([(l - plane_l) / 2, 0, -dia + (l - plane_l) / 2 - 1 * plane_off])
34
+    cube([plane_l, 1, plane_l + 2 * plane_off]);
35
+    translate([(l - plane_l) / 2 - 1 * plane_off, 0, -dia + (l - plane_l) / 2])
36
+    cube([plane_l + 2 * plane_off, 1, plane_l]);
37
+}
38
+
39
+module clamp() {
40
+    difference() {
41
+        union() {
42
+            hull()
43
+            for (r = [0, 90])
44
+            rotate([0, r, 0])
45
+            translate([0, 0, dia])
46
+            cylinder(d = clamp_d, h = clamp_h / 2);
47
+            
48
+            for (r = [0, 90])
49
+            rotate([0, r, 0])
50
+            translate([0, 0, dia])
51
+            cylinder(d = clamp_d, h = clamp_h);
52
+        }
53
+        
54
+        for (r = [0, 90])
55
+        rotate([0, r, 0])
56
+        translate([0, 0, dia])
57
+        translate([0, 0, -20])
58
+        cylinder(d = dia, h = clamp_h + 30);
59
+        
60
+        for (i = [0, 1])
61
+        translate([i ? clamp_h * 3 / 4 + dia : 0, clamp_d / 2 + 1, i ? 0 : clamp_h * 3 / 4 + dia])
62
+        rotate([90, 0, 0])
63
+        cylinder(d = screw, h = clamp_d + 2);
64
+    }
65
+}
66
+
67
+module frame() {
68
+    %translate([-l / 2, 0, dia - l / 2])
69
+    rods();
70
+    
71
+    for (r = [0 : 90 : 360])
72
+    rotate([0, r, 0])
73
+    translate([-l/ 2, 0, -l / 2])
74
+    clamp();
75
+}
76
+
77
+if ($preview)
78
+    translate([l / 2, 0, l / 2])
79
+    frame();
80
+else
81
+    clamp();

BIN
hardware/frame.stl View File


+ 12
- 0
image.py View File

@@ -65,6 +65,16 @@ class ImageScreen:
65 65
             self.image.is_animated = False
66 66
             self.image.n_frames = 1
67 67
 
68
+        # enlarge small images
69
+        if not self.image.is_animated and ((self.image.width * 2) <= self.gui.width) and ((self.image.height * 2) <= self.gui.height):
70
+            self.image = self.image.crop(self.image.getbbox())
71
+            self.image = self.image.resize((self.image.width * 2, self.image.height * 2),
72
+                                           Image.Resampling.NEAREST)
73
+            self.image.is_animated = False
74
+            self.image.n_frames = 1
75
+
76
+        # TODO cropping and scaling not working for GIF animations
77
+
68 78
         print(p, self.image.width, self.image.height, self.image.is_animated, self.image.n_frames)
69 79
 
70 80
         self.xOff = int((self.gui.width - self.image.width) / 2)
@@ -142,6 +152,8 @@ if __name__ == "__main__":
142 152
 
143 153
         if filename != "Favicon.png":
144 154
             continue
155
+        if (t.width != 32) or (t.height != 32):
156
+            continue
145 157
 
146 158
         try:
147 159
             # dump generated image to console, for embedding in Pico script

+ 4
- 2
pi.py View File

@@ -32,7 +32,7 @@ from rgbmatrix import RGBMatrix, RGBMatrixOptions
32 32
 from PIL import Image
33 33
 
34 34
 class PiMatrix:
35
-    def __init__(self, w = 32 * 2, h = 32, panelW = 32, panelH = 32):
35
+    def __init__(self, w = 32 * 4, h = 32, panelW = 32, panelH = 32):
36 36
         self.width = w # x-axis
37 37
         self.height = h # y-axis
38 38
 
@@ -86,5 +86,7 @@ class PiMatrix:
86 86
         self.image.putpixel((int(x), int(y)), color)
87 87
 
88 88
 if __name__ == "__main__":
89
-    t = PiMatrix(32, 32)
89
+    import util
90
+
91
+    t = PiMatrix()
90 92
     util.loop(t, lambda: t.set_pixel(15, 15, (255, 255, 255)))

+ 11
- 2
snake.py View File

@@ -10,6 +10,7 @@
10 10
 from scroll import ScrollText
11 11
 import time
12 12
 import random
13
+import util
13 14
 
14 15
 class Snake:
15 16
     def __init__(self, g, i, sc = (0, 255, 0), d = (0, 0, 255), bg = (0, 0, 0), ts = 0.3, su = 0.75, to = 60.0):
@@ -27,6 +28,8 @@ class Snake:
27 28
         self.scoreText = ScrollText(self.gui, "Score:", "uushi",
28 29
                                     2, 50, sc)
29 30
 
31
+        self.text_c = (0, 0, 255)
32
+
30 33
         random.seed()
31 34
         self.restart()
32 35
 
@@ -41,6 +44,9 @@ class Snake:
41 44
         self.player = [ (int(self.gui.width / 2), int(self.gui.height / 2)) ]
42 45
         self.data[self.player[0][0]][self.player[0][1]] = 1
43 46
 
47
+        DrawText = util.getTextDrawer()
48
+        self.text = DrawText(self.gui, self.text_c)
49
+
44 50
         self.old_keys = {
45 51
             "left": False,
46 52
             "right": False,
@@ -72,7 +78,7 @@ class Snake:
72 78
 
73 79
     def placeDot(self):
74 80
         d = (random.randrange(0, self.gui.width), random.randrange(0, self.gui.height))
75
-        while self.data[d[0]][d[1]] != 0:
81
+        while self.data[d[0]][d[1]] != 0: # TODO don't place dots below score text
76 82
             d = (random.randrange(0, self.gui.width), random.randrange(0, self.gui.height))
77 83
         self.data[d[0]][d[1]] = 2
78 84
 
@@ -177,8 +183,11 @@ class Snake:
177 183
             for y in range(0, self.gui.height):
178 184
                 self.gui.set_pixel(x, y, self.colors[self.data[x][y]])
179 185
 
186
+        # draw score
187
+        self.text.setText(str(self.score), "tom-thumb")
188
+        self.text.draw(-1, self.gui.height / 2 - 2)
189
+
180 190
 if __name__ == "__main__":
181
-    import util
182 191
     # Need to import InputWrapper before initializing RGB Matrix on Pi
183 192
     i = util.getInput()
184 193
     t = util.getTarget(i)

+ 1
- 1
test.py View File

@@ -13,7 +13,7 @@
13 13
 import pygame
14 14
 
15 15
 class TestGUI:
16
-    def __init__(self, width = 32 * 1, height = 32, multiplier = 16):
16
+    def __init__(self, width = 32 * 2, height = 32 * 2, multiplier = 16):
17 17
         self.width = width
18 18
         self.height = height
19 19
         self.multiplier = multiplier

+ 3
- 2
util.py View File

@@ -44,9 +44,10 @@ def getTarget(i = None):
44 44
         # TODO hard-coded adjustments
45 45
         from mapper import MapperReduceBrightness, MapperColorAdjust, MapperStripToRect
46 46
         bright = MapperReduceBrightness(pi, i)
47
-        col = MapperColorAdjust(bright)
47
+        #col = MapperColorAdjust(bright)
48
+        #target = col
48 49
         #target = MapperStripToRect(col)
49
-        target = col
50
+        target = MapperStripToRect(bright)
50 51
 
51 52
         if targetPlatform == None:
52 53
             # only print once

Loading…
Cancel
Save