<style type="text/css"> body { background-color: #9933ff; } sup { top: -0.2em; } .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { font-family: "Palatino Linotype", "Book Antiqua", Palatino, FreeSerif, serif; } .reveal { font-family: serif; color: #032b35; } .reveal .progress { background: #ff783154; color: #ff96c4; height: 4px; } .reveal h1 { font-size: 12rem; } .reveal .subheading { font-size: 1.5em; } .reveal pre, .reveal code { font-family: "Linux Libertine Mono"; } .reveal code { font-weight: bold; font-size: 1.1em; } .reveal .cyber { font-style: normal; } .reveal a { color: #ff96c4; } .reveal a:hover, .reveal a:focus { color: #ff76a4; } .reveal .controls { color: #ff96c4; } .reveal .slide-number { background-color: transparent; color: #ff96c4; font-weight: 600; } .reveal ul { list-style-type: disc; } .reveal ul ul { list-style-type: disclosure-closed; } .reveal ul ul > li::marker { font-size: 0.7em; } .reveal ul ul ul { list-style-type: square; } .reveal ol.footnotes-list { font-size: 0.6em; } .reveal section.resources ul { font-size: 0.6em; } .reveal table tbody tr:nth-child(2N-1) { background-color: #e3e8ee; } .reveal table th { border-bottom: 4px solid #cad3dd; } .reveal table td { border-bottom: 1px solid #cad3dd; } .reveal .gradimg { max-width: 75%; } </style> # LightPipe ## Installation & Effekte --- ![](https://md.cccgoe.de/uploads/8edd8efe-2433-49de-a8bb-78c618ee718d.png) --- # TOC 1. Installation 2. Effekte ausführen 3. Effekte schreiben 4. paintbag 6. Links --- # Installation * python3 * tk * Treiber: ```bash cd <dein ordner> git clone https://git.cccgoe.de/lightpipe/driver.git ``` --- ## Effekte ausführen ```graphviz digraph G { graph[pad=0.5, rankdir=LR] node [color="#00c466", style=bold] edge [color="#fe7900", style=bold, len=1.2] "lightpipe.py" [fontsize=18] "python" [fontsize=18] "run.py" [fontsize=24] "paintbag.py" [fontsize=18] "effects/*.py" [fontsize=18] "python"->"run.py"->"lightpipe.py","paintbag.py","effects/*.py" } ``` ```bash python3 run.py effects/gradients.py ``` --- # Effekte schreiben ```python=1 import time def effect( lp ): lp.clear( ) x = 4 color = ( 255, 0, 0 ) lp.set_pixel( 0, x, color ) lp.show( ) time.sleep( 2 ) ``` ---- # color * 3-Tuple mit int8: `( 0, 0, 255 )` * String mit hexadezimaler Notation: `"d511ff"` ---- # lp = Lightpipe() ```python lp.set_pixel( p, x, color ) lp.set_pipe( p, color ) lp.fill( p, x, colors ) lp.clear( show, background ) lp.show( ) ``` ---- ## Alles mit Unter-Pixel ```python lp.set_pixel_0( p, x, color ) lp.set_pixel_y( p, x, color, y ) lp.fill_0( p, x, colors ) lp.fill_y( p, x, colors, y ) ``` --- # paintbag.pb ```python pb.colors_37c3 pb.random_color( ) pb.cgs( color1, color2, n ) ``` ---- # Hübscher Effekt ```python=1 import time def effect( lp, pb ): color_a = pb.random_color( ) color_b = pb.random_color( ) gradient = pb.cgs( color_a, color_b, lp.p_size ) lp.fill( 0, 0, gradient ) lp.show( ) time.sleep( 5 ) ``` --- # Links * Slides: https://md.cccgoe.de/p/CVilynd2x * Code: https://git.cccgoe.de/lightpipe
{"type":"slide","slideOptions":{"transition":"slide","theme":"sans-serif"}}