implemented display orientation option
This commit is contained in:
parent
f0ab9e4558
commit
ca36269380
@ -44,7 +44,11 @@ class Inkycal:
|
|||||||
self.supports_colour = self.Settings.Layout.supports_colour
|
self.supports_colour = self.Settings.Layout.supports_colour
|
||||||
|
|
||||||
# Option to flip image upside down
|
# Option to flip image upside down
|
||||||
self.upside_down = False
|
if self.Settings.display_orientation == 'normal':
|
||||||
|
self.upside_down = False
|
||||||
|
|
||||||
|
elif self.Settings.display_orientation == 'upside_down':
|
||||||
|
self.upside_down = True
|
||||||
|
|
||||||
# Option to use epaper image optimisation
|
# Option to use epaper image optimisation
|
||||||
self.optimize = True
|
self.optimize = True
|
||||||
@ -122,9 +126,12 @@ class Inkycal:
|
|||||||
print('You are running inkycal v{}'.format(self._release))
|
print('You are running inkycal v{}'.format(self._release))
|
||||||
|
|
||||||
|
|
||||||
print('Running inkyal test-run for {} ePaper'.format(
|
print('Running inkycal test-run for {} ePaper'.format(
|
||||||
self.Settings.model))
|
self.Settings.model))
|
||||||
|
|
||||||
|
if self.upside_down == True:
|
||||||
|
print('upside-down mode active')
|
||||||
|
|
||||||
for module in self.active_modules:
|
for module in self.active_modules:
|
||||||
generate_im = 'self.{0}.generate_image()'.format(module)
|
generate_im = 'self.{0}.generate_image()'.format(module)
|
||||||
print('generating image for {} module...'.format(module), end = '')
|
print('generating image for {} module...'.format(module), end = '')
|
||||||
@ -316,7 +323,7 @@ class Inkycal:
|
|||||||
|
|
||||||
buffer = numpy.array(image.convert('RGB'))
|
buffer = numpy.array(image.convert('RGB'))
|
||||||
red, green = buffer[:, :, 0], buffer[:, :, 1]
|
red, green = buffer[:, :, 0], buffer[:, :, 1]
|
||||||
# grey->black
|
# grey->black
|
||||||
buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0,0,0]
|
buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0,0,0]
|
||||||
image = Image.fromarray(buffer)
|
image = Image.fromarray(buffer)
|
||||||
return image
|
return image
|
||||||
@ -326,7 +333,7 @@ class Inkycal:
|
|||||||
Currently has to be run manually"""
|
Currently has to be run manually"""
|
||||||
|
|
||||||
self.Display.calibrate()
|
self.Display.calibrate()
|
||||||
|
|
||||||
|
|
||||||
def _check_for_updates(self):
|
def _check_for_updates(self):
|
||||||
"""Check if a new update is available for inkycal"""
|
"""Check if a new update is available for inkycal"""
|
||||||
|
Loading…
Reference in New Issue
Block a user