Skip to content

Commit

Permalink
bug fixes, qol improvements, and general speed increases. next todo i…
Browse files Browse the repository at this point in the history
…s gamma rescaling
  • Loading branch information
Boxylmer committed Oct 21, 2023
1 parent 5b4c4c8 commit db7031e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
8 changes: 4 additions & 4 deletions DesktopApp/Application/MonitorBorderPixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ def disable(self): self.enabled = False

def get_top(self):
if self.enabled: return self.pix_top
else: return []
else: return np.array([])
def get_bottom(self):
if self.enabled: return self.pix_bottom
else: return []
else: return np.array([])
def get_left(self):
if self.enabled: return self.pix_left
else: return []
else: return np.array([])
def get_right(self):
if self.enabled: return self.pix_right
else: return []
else: return np.array([])

18 changes: 12 additions & 6 deletions DesktopApp/Application/MonitorOrchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,29 +334,35 @@ def get_pixel_stream(self):

if (self.path_mode == PATH_ORDERS.CUSTOM) and (self.custom_order_edge_directions[i] == -1):
if side == 'u':
rgbrow = np.flip(row)
rgbrow = self.flip_row(row)
elif side == 'd':
rgbrow = row
elif side == 'l':
rgbrow = row
elif side == 'r':
rgbrow = np.flip(row)
rgbrow = self.flip_row(row)
else:
if side == 'u':
rgbrow = row
elif side == 'd':
rgbrow = np.flip(row)
rgbrow = self.flip_row(row)
elif side == 'l':
rgbrow = np.flip(row)
rgbrow = self.flip_row(row)
elif side == 'r':
rgbrow = row

# logic here for states, todo. doing it here allows for easy "skips" later if we want to disable some rows
for colorval in rgbrow:
data.append(round(colorval[2]))
data.append(round(colorval[1]))
data.append(round(colorval[0]))
data.append(round(colorval[1]))
data.append(round(colorval[2]))

remove_info_tokens(data)
data.append(MICROCHIP_STOP_BYTE)
return data

@classmethod
def flip_row(cls, row):
reshaped = row.reshape(-1, 3)
flip = np.flip(reshaped, axis=0)
return flip

0 comments on commit db7031e

Please sign in to comment.