You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Josef Dabrowski fed62b7d06
Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background
7 years ago
.DS_Store Trello widget cards working - displays all cards from a specified board and list 7 years ago
.gitignore Trello widget cards working - displays all cards from a specified board and list 7 years ago
DejaVuSans.ttf initial upload 7 years ago
DejaVuSansMono.ttf initial upload 7 years ago
EinkPaper.py Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
FreeMonoBold.ttf initial upload 7 years ago
calvin.jpg initial upload 7 years ago
card_image.bmp Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
epd7in5b.py initial upload 7 years ago
epdif.py initial upload 7 years ago
file Trello widget cards working - displays all cards from a specified board and list 7 years ago
folk.png Trello widget cards working - displays all cards from a specified board and list 7 years ago
forest.jpg Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
imagedata.py initial upload 7 years ago
imgBlack-withBackground.bmp Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
imgBlack.bmp Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
imgYellow.bmp initial upload 7 years ago
leaves.jpg Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
mask.bmp Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
onyxbook.jpg Trello widget cards working - displays all cards from a specified board and list 7 years ago
readme.md image scaling types and dynamic monochrome thresholding 7 years ago
staff.png Trello widget cards working - displays all cards from a specified board and list 7 years ago
steps.jpg Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
text.txt Trello widget cards working - displays all cards from a specified board and list 7 years ago
tree.jpg Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago
widget.py Tidied margin and alignment code, added transparency for potentially overlaying trello cards on background 7 years ago

readme.md

Run EinkPaper.py to start the program. To run in test mode, add argument -t or --test. Test mode will save generated images to the working directory rather than export them to an external display. Test mode will auto run if no external display package is detected.

EinkPaper.py will construct widget classes from widgets.py. Widgets are constructed in the initWidgets() function in EinkPaper.py.

The image widget is currently set to resize (to fit the whole image on the widget w/ no cropping), then to either monochrome or greyscale dither the image as specified in initWidgets(). The zoom function is currently broken and to be fixed.

--- Program flow ---

config data --> EinkPaper.py

Configuration of the widgets to be displayed is stored in the Einkpaper.py initWidgets() function. A new instance of a widget class is added to the widgetList array. 

General form: widget."widget name"(cwidth, cheight, x coord, y coord, width(by cell), height(by cell), OTHER ARGUMENTS...)
e.g.
widgetList.append(widget.ImageWidget(cwidth, cheight, 1, 1, 2, 2, "mono", "calvin.jpg"))

Text widget has one 'other argument', it is the string to be displayed on the widget. Image widget has three other args, the type of black and white filter to process the image with, the type of image size transformation to be performed, and the location or filename of the image. The two b&w filters are "mono" for monochrome, and "dither" for greyscale dithering. Image transforms are "fill", "resize", and "none".
The threshold limit for calculating the cutoff for black/white pixels in the monochrome function is calculated in autoThresholdLimit(). The limit is: the lowest pixel value + a factor between 0 and 1 x the pixel value range of the image. The pixel value range is found by performing getextrema() on the image. By default the factor is set to 0.4, or 40%.

Widgets will be drawn on the final canvas in the order they are appended to the widgetList array.

widget.py --> EinkPaper.py

When an instance of a widget class is created it will perform necessary computations, network tasks, and image operations to store an updated image object. This image object is the image of the widget to be passed back to EinkPaper.py's render() function. The size of this image will be some multiple of the cell size as specified in EinkPaper.py.

--- Running the program ---

The program is built for python2.
$ python EinkPaper.py
If the display package is present, will run with test mode disabled. Will periodically update each widget and each iteration will display the latest version on the external display. If the package is missing, will run in test mode, saving the generated canvas images to the working directory.

Or manually enable test mode:
$ python EinkPaper.py -t
or
$ python EinkPaper.py --test