readme update and file clean

redesign
Josef Dabrowski 7 years ago
parent 0059dda861
commit f6b936e37f

BIN
.DS_Store vendored

Binary file not shown.

@ -50,7 +50,7 @@ def initWidgets():
widgetList.append(widget.TextWidget(cwidth, cheight, 0, 0, 1, 2, str1))
widgetList.append(widget.TextWidget(cwidth, cheight, 1, 0, 2, 1, str2))
#widgetList.append(widget.ImageWidget(cwidth, cheight, 2, 1, 1, 1, "mono", "faces.jpg"))
widgetList.append(widget.ImageWidget(cwidth, cheight, 1, 1, 2, 2, "mono", "img1.jpg"))
widgetList.append(widget.ImageWidget(cwidth, cheight, 1, 1, 2, 2, "mono", "calvin.jpg"))
widgetList.append(widget.ImageWidget(cwidth, cheight, 0, 2, 1, 1, "mono", "img1.jpg"))
return widgetList

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

@ -1,26 +0,0 @@
import epd7in5b
from PIL import Image, ImageDraw, ImageFont, ImageOps
import re
from renderer import Rend
WIDTH = 640
HEIGHT = 384
def main():
epd = epd7in5b.EPD()
epd.init()
rend = Rend()
rend.render()
print("start display frame")
epd.display_frame(epd.get_frame_buffer(rend.image_black),epd.get_frame_buffer(rend.image_yellow))
print("finish display frame")
#display images
#frame_black = epd.get_frame_buffer(Image.open('black.bmp'))
#frame_yellow = epd.get_frame_buffer(Image.open('red2.bmp'))
#epd.display_frame(frame_black, frame_yellow)
if __name__ == '__main__':
main()

@ -4,4 +4,33 @@ 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.
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 two other args, the type of black and white filter to process the image with, and the location or filename of the image. The two b&w filters are "mono" for monochrome, and "dither" for greyscale dithering.
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 repeatedly 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
Loading…
Cancel
Save