├── .gitignore ├── Doc ├── Makefile ├── build │ ├── doctest │ │ └── output.txt │ ├── doctrees │ │ ├── environment.pickle │ │ └── index.doctree │ ├── html.zip │ ├── html │ │ ├── .buildinfo │ │ ├── _images │ │ │ ├── arc.png │ │ │ ├── circle.png │ │ │ ├── gottherobot.png │ │ │ ├── graticule.png │ │ │ ├── poly.png │ │ │ ├── polys.png │ │ │ ├── printxy.png │ │ │ ├── rotate.png │ │ │ ├── scope.png │ │ │ └── snow.png │ │ ├── _sources │ │ │ └── index.txt │ │ ├── _static │ │ │ ├── ajax-loader.gif │ │ │ ├── basic.css │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── comment.png │ │ │ ├── default.css │ │ │ ├── doctools.js │ │ │ ├── down-pressed.png │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── jquery.js │ │ │ ├── minus.png │ │ │ ├── plus.png │ │ │ ├── pygments.css │ │ │ ├── searchtools.js │ │ │ ├── sidebar.js │ │ │ ├── underscore.js │ │ │ ├── up-pressed.png │ │ │ ├── up.png │ │ │ └── websupport.js │ │ ├── genindex.html │ │ ├── index.html │ │ ├── objects.inv │ │ ├── py-modindex.html │ │ ├── search.html │ │ └── searchindex.js │ └── latex │ │ ├── Makefile │ │ ├── arc.png │ │ ├── circle.png │ │ ├── fbpy.aux │ │ ├── fbpy.idx │ │ ├── fbpy.log │ │ ├── fbpy.out │ │ ├── fbpy.pdf │ │ ├── fbpy.tex │ │ ├── fbpy.toc │ │ ├── fncychap.sty │ │ ├── gottherobot.png │ │ ├── graticule.png │ │ ├── poly.png │ │ ├── polys.png │ │ ├── printxy.png │ │ ├── python.ist │ │ ├── rotate.png │ │ ├── snow.png │ │ ├── sphinx.sty │ │ ├── sphinxhowto.cls │ │ ├── sphinxmanual.cls │ │ └── tabulary.sty ├── documentation.txt ├── html.zip └── source │ ├── .index.rst.swp │ ├── conf.py │ ├── images │ ├── arc.png │ ├── circle.png │ ├── gottherobot.png │ ├── graticule.png │ ├── poly.png │ ├── polys.png │ ├── printxy.png │ ├── rotate.png │ ├── scope.png │ └── snow.png │ └── index.rst ├── LICENSE ├── MANIFEST ├── MANIFEST.in ├── README.md ├── README.txt ├── build ├── lib.linux-armv6l-2.7 │ ├── fblib.so │ └── fbpy │ │ ├── __init__.py │ │ ├── audioscope.py │ │ ├── fb.py │ │ ├── jack.py │ │ ├── obj.py │ │ ├── sprite.py │ │ ├── svg.py │ │ └── utils │ │ ├── __init__.py │ │ └── svg.py ├── lib.linux-x86_64-2.7 │ ├── fblib.so │ └── fbpy │ │ ├── __init__.py │ │ ├── audioscope.py │ │ ├── fb.py │ │ ├── jack.py │ │ ├── obj.py │ │ ├── sprite.py │ │ ├── svg.py │ │ └── utils │ │ ├── __init__.py │ │ └── svg.py ├── temp.linux-armv6l-2.7 │ └── fbpy │ │ └── utils │ │ ├── audio.o │ │ ├── fblib.o │ │ ├── fbutils.o │ │ └── test.o └── temp.linux-x86_64-2.7 │ └── fbpy │ └── utils │ ├── audio.o │ ├── fblib.o │ ├── fbutils.o │ └── test.o ├── buildinstall.sh ├── compile.sh ├── dist ├── fbpy-0.1.linux-x86_64.tar.gz └── fbpy-0.1.tar.gz ├── err.txt ├── examples ├── 3dpoly.py ├── 3dpoly0.py ├── 3dpoly1.py ├── :demo.py ├── :sus ├── Hunter97 ├── Voyager_17.mtl ├── Voyager_17.obj ├── audio.py ├── audioscope.py ├── byyrcmnd.png ├── clockdemo.py ├── clockdemorasp.py ├── cone0.mtl ├── cone0.obj ├── cube.obj ├── cube0.mtl ├── cube0.obj ├── curs.py ├── demo.py ├── demo.pyc ├── doc1.py ├── drawover.py ├── example.c ├── grab.py ├── grid0.mtl ├── grid0.obj ├── head.obj ├── informdriver.py ├── lunarmod.obj ├── models.txt ├── n ├── piclockdemo.py ├── pisphere.py ├── pitesthigh.py ├── polys.py ├── primitives.png ├── primitives.py ├── raider.mtl ├── raider.obj ├── raider2.obj ├── readpng.py ├── scaledornot.py ├── scope.png ├── scope.py ├── scope2.png ├── scopedemo.py ├── scopedemorasp.py ├── snow.py ├── sphere.mtl ├── sphere.obj ├── sphere.py ├── sphere0.mtl ├── sphere0.obj ├── sphere2.obj ├── sphererasp.py ├── sprite.html ├── sysinfo.py ├── test.old.svg ├── test.sh ├── test.svg ├── test.svg.2014_07_01_01_15_00.0.svg ├── test.svg.2014_07_01_01_18_52.0.svg ├── testcylon.svg ├── testhigh.py ├── testsprite.py └── transform.py ├── fbpy ├── __init__.py ├── __init__.pyc ├── audioscope.py ├── audioscope.pyc ├── fb.py ├── fb.pyc ├── jack.py ├── jack.pyc ├── obj.py ├── sprite.py ├── sprite.pyc ├── svg.py ├── svg.pyc └── utils │ ├── .swp │ ├── Makefile │ ├── __init__.py │ ├── __init__.pyc │ ├── audio.c │ ├── audio.h │ ├── fblib.c │ ├── fblib.o │ ├── fblib.pyx │ ├── fbutils.c │ ├── fbutils.c.temp │ ├── fbutils.h │ ├── fbutils.html │ ├── fbutils.o │ ├── font.h │ ├── print.c │ ├── svg.py │ ├── test │ ├── test.c │ ├── test.h │ └── test.o ├── font ├── 35.svg ├── 36.svg ├── 40.svg ├── 41.svg ├── 45.svg ├── 48.svg ├── 49.svg ├── 50.svg ├── 51.svg ├── 52.svg ├── 53.svg ├── 54.svg ├── 55.svg ├── 56.svg ├── 57.svg ├── 58.svg ├── 59.svg ├── 64.svg ├── 65.svg ├── 66.svg ├── 67.svg ├── 68.svg ├── 69.svg ├── 70.svg ├── 71.svg ├── 72.svg ├── 73.svg ├── 74.svg ├── 75.svg ├── 76.svg ├── 77.svg ├── 78.svg ├── 79.svg ├── 80.svg ├── 81.svg ├── 82.svg ├── 83.svg ├── 84.svg ├── 85.svg ├── 86.svg ├── 87.svg ├── 88.svg ├── 89.svg ├── 90.svg └── 95.svg ├── install.sh ├── setup.cfg ├── setup.py ├── test.png ├── tests.txt └── tests └── hash1.txt /.gitignore: -------------------------------------------------------------------------------- 1 | *.[oa] 2 | *~ 3 | -------------------------------------------------------------------------------- /Doc/build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/doctrees/environment.pickle -------------------------------------------------------------------------------- /Doc/build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/doctrees/index.doctree -------------------------------------------------------------------------------- /Doc/build/html.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html.zip -------------------------------------------------------------------------------- /Doc/build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: d4a3578796638cff02bfc263d8338ea7 4 | tags: fbb0d17656682115ca4d033fb2f83ba1 5 | -------------------------------------------------------------------------------- /Doc/build/html/_images/arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/arc.png -------------------------------------------------------------------------------- /Doc/build/html/_images/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/circle.png -------------------------------------------------------------------------------- /Doc/build/html/_images/gottherobot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/gottherobot.png -------------------------------------------------------------------------------- /Doc/build/html/_images/graticule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/graticule.png -------------------------------------------------------------------------------- /Doc/build/html/_images/poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/poly.png -------------------------------------------------------------------------------- /Doc/build/html/_images/polys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/polys.png -------------------------------------------------------------------------------- /Doc/build/html/_images/printxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/printxy.png -------------------------------------------------------------------------------- /Doc/build/html/_images/rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/rotate.png -------------------------------------------------------------------------------- /Doc/build/html/_images/scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/scope.png -------------------------------------------------------------------------------- /Doc/build/html/_images/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_images/snow.png -------------------------------------------------------------------------------- /Doc/build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. fbpy documentation master file, created by 2 | sphinx-quickstart on Fri Jun 20 01:39:00 2014. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to fbpy's documentation! 7 | ================================ 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | 15 | General description 16 | =================== 17 | 18 | The `fbpy` module is an API for drawing in the framebuffer on Linux machines. 19 | It was conceived as part of an audio player project based on the 20 | raspberry pi computer and wolfson pi audio interface. I needed a low-level 21 | graphics library for visualizing audio data (scope, phase,...). I also 22 | wanted to gain some programming skills, like writing c libs for python and 23 | some kernel stuff. So this module is by no means an attempt to make a 24 | better graphics lib with fancy hardware acceleration or anythin or 25 | making something original. I think it is use able though and by examining 26 | the source, it might serve as a form of documentation if you want to 27 | make something like this yourself. That is why I publish it. Oh, and of course 28 | because I support open source hardware *and* software, the 'firmware' of 29 | my audio player should be available as source :) 30 | 31 | Website 32 | ------- 33 | 34 | http://transistorlove.wordpress.com 35 | 36 | 37 | Module documentation 38 | ==================== 39 | 40 | .. automodule:: fb 41 | :members: 42 | 43 | .. automodule:: svg 44 | :members: 45 | 46 | .. automodule:: sprite 47 | :members: 48 | 49 | .. automodule:: audioscope 50 | :members: 51 | 52 | Indices and tables 53 | ================== 54 | 55 | * :ref:`genindex` 56 | * :ref:`modindex` 57 | * :ref:`search` 58 | 59 | -------------------------------------------------------------------------------- /Doc/build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /Doc/build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /Doc/build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/comment-close.png -------------------------------------------------------------------------------- /Doc/build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/comment.png -------------------------------------------------------------------------------- /Doc/build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /Doc/build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/down.png -------------------------------------------------------------------------------- /Doc/build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/file.png -------------------------------------------------------------------------------- /Doc/build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/minus.png -------------------------------------------------------------------------------- /Doc/build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/plus.png -------------------------------------------------------------------------------- /Doc/build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 8 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 16 | .highlight .go { color: #303030 } /* Generic.Output */ 17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 18 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 20 | .highlight .gt { color: #0040D0 } /* Generic.Traceback */ 21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #902000 } /* Keyword.Type */ 27 | .highlight .m { color: #208050 } /* Literal.Number */ 28 | .highlight .s { color: #4070a0 } /* Literal.String */ 29 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 30 | .highlight .nb { color: #007020 } /* Name.Builtin */ 31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #60add5 } /* Name.Constant */ 33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 35 | .highlight .ne { color: #007020 } /* Name.Exception */ 36 | .highlight .nf { color: #06287e } /* Name.Function */ 37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 43 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 44 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 45 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 46 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 47 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 48 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 49 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 50 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 51 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 52 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 53 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 54 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 55 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 56 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 57 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 58 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 59 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 60 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 61 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 62 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /Doc/build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /Doc/build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/_static/up.png -------------------------------------------------------------------------------- /Doc/build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/html/objects.inv -------------------------------------------------------------------------------- /Doc/build/html/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Search — fbpy 0.1 documentation 12 | 13 | 14 | 15 | 16 | 25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 49 | 50 |
51 |
52 |
53 |
54 | 55 |

Search

56 |
57 | 58 |

59 | Please activate JavaScript to enable the search 60 | functionality. 61 |

62 |
63 |

64 | From here you can search these documents. Enter your search 65 | words into the box below and click "search". Note that the search 66 | function will automatically search for all of the words. Pages 67 | containing fewer words won't appear in the result list. 68 |

69 |
70 | 71 | 72 | 73 |
74 | 75 |
76 | 77 |
78 | 79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 | 100 | 104 | 105 | -------------------------------------------------------------------------------- /Doc/build/latex/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx LaTeX output 2 | 3 | ALLDOCS = $(basename $(wildcard *.tex)) 4 | ALLPDF = $(addsuffix .pdf,$(ALLDOCS)) 5 | ALLDVI = $(addsuffix .dvi,$(ALLDOCS)) 6 | 7 | # Prefix for archive names 8 | ARCHIVEPRREFIX = 9 | # Additional LaTeX options 10 | LATEXOPTS = 11 | 12 | all: $(ALLPDF) 13 | all-pdf: $(ALLPDF) 14 | all-dvi: $(ALLDVI) 15 | all-ps: all-dvi 16 | for f in *.dvi; do dvips $$f; done 17 | 18 | all-pdf-ja: 19 | for f in *.pdf *.png *.gif *.jpg *.jpeg; do ebb $$f; done 20 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 21 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 22 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 23 | for f in *.idx; do mendex -U -f -d "`basename $$f .idx`.dic" -s python.ist $$f; done 24 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 25 | for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done 26 | for f in *.dvi; do dvipdfmx $$f; done 27 | 28 | zip: all-$(FMT) 29 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 30 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 31 | zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT) 32 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 33 | 34 | tar: all-$(FMT) 35 | mkdir $(ARCHIVEPREFIX)docs-$(FMT) 36 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT) 37 | tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT) 38 | rm -r $(ARCHIVEPREFIX)docs-$(FMT) 39 | 40 | bz2: tar 41 | bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar 42 | 43 | # The number of LaTeX runs is quite conservative, but I don't expect it 44 | # to get run often, so the little extra time won't hurt. 45 | %.dvi: %.tex 46 | latex $(LATEXOPTS) '$<' 47 | latex $(LATEXOPTS) '$<' 48 | latex $(LATEXOPTS) '$<' 49 | -makeindex -s python.ist '$(basename $<).idx' 50 | latex $(LATEXOPTS) '$<' 51 | latex $(LATEXOPTS) '$<' 52 | 53 | %.pdf: %.tex 54 | pdflatex $(LATEXOPTS) '$<' 55 | pdflatex $(LATEXOPTS) '$<' 56 | pdflatex $(LATEXOPTS) '$<' 57 | -makeindex -s python.ist '$(basename $<).idx' 58 | pdflatex $(LATEXOPTS) '$<' 59 | pdflatex $(LATEXOPTS) '$<' 60 | 61 | clean: 62 | rm -f *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla 63 | 64 | .PHONY: all all-pdf all-dvi all-ps clean 65 | .PHONY: all-pdf-ja 66 | 67 | -------------------------------------------------------------------------------- /Doc/build/latex/arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/arc.png -------------------------------------------------------------------------------- /Doc/build/latex/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/circle.png -------------------------------------------------------------------------------- /Doc/build/latex/fbpy.aux: -------------------------------------------------------------------------------- 1 | \relax 2 | \ifx\hyper@anchor\@undefined 3 | \global \let \oldcontentsline\contentsline 4 | \gdef \contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} 5 | \global \let \oldnewlabel\newlabel 6 | \gdef \newlabel#1#2{\newlabelxx{#1}#2} 7 | \gdef \newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} 8 | \AtEndDocument{\let \contentsline\oldcontentsline 9 | \let \newlabel\oldnewlabel} 10 | \else 11 | \global \let \hyper@last\relax 12 | \fi 13 | 14 | \select@language{english} 15 | \@writefile{toc}{\select@language{english}} 16 | \@writefile{lof}{\select@language{english}} 17 | \@writefile{lot}{\select@language{english}} 18 | \newlabel{index::doc}{{}{1}{\relax }{section*.2}{}} 19 | \@writefile{toc}{\contentsline {chapter}{\numberline {1}General description}{3}{chapter.1}} 20 | \@writefile{lof}{\addvspace {10\p@ }} 21 | \@writefile{lot}{\addvspace {10\p@ }} 22 | \newlabel{index:general-description}{{1}{3}{General description\relax }{chapter.1}{}} 23 | \newlabel{index:welcome-to-fbpy-s-documentation}{{1}{3}{General description\relax }{chapter.1}{}} 24 | \@writefile{toc}{\contentsline {section}{\numberline {1.1}Website}{3}{section.1.1}} 25 | \newlabel{index:website}{{1.1}{3}{Website\relax }{section.1.1}{}} 26 | \@writefile{toc}{\contentsline {chapter}{\numberline {2}Module documentation}{5}{chapter.2}} 27 | \@writefile{lof}{\addvspace {10\p@ }} 28 | \@writefile{lot}{\addvspace {10\p@ }} 29 | \newlabel{index:module-fb}{{2}{5}{Module documentation\relax }{chapter.2}{}} 30 | \newlabel{index:module-documentation}{{2}{5}{Module documentation\relax }{chapter.2}{}} 31 | \newlabel{index:fb.Colors}{{2}{5}{Module documentation\relax }{section*.3}{}} 32 | \newlabel{index:fb.Surface}{{2}{5}{Module documentation\relax }{section*.4}{}} 33 | \newlabel{index:fb.Surface.addpoly}{{2}{5}{Module documentation\relax }{section*.5}{}} 34 | \newlabel{index:fb.Surface.arc}{{2}{5}{Module documentation\relax }{section*.6}{}} 35 | \newlabel{index:fb.Surface.blit}{{2}{6}{Module documentation\relax }{section*.7}{}} 36 | \newlabel{index:fb.Surface.circle}{{2}{7}{Module documentation\relax }{section*.8}{}} 37 | \newlabel{index:fb.Surface.clear}{{2}{8}{Module documentation\relax }{section*.9}{}} 38 | \newlabel{index:fb.Surface.drawpolys}{{2}{8}{Module documentation\relax }{section*.10}{}} 39 | \newlabel{index:fb.Surface.get_raw}{{2}{9}{Module documentation\relax }{section*.11}{}} 40 | \newlabel{index:fb.Surface.grab}{{2}{9}{Module documentation\relax }{section*.12}{}} 41 | \newlabel{index:fb.Surface.grabsequence}{{2}{9}{Module documentation\relax }{section*.13}{}} 42 | \newlabel{index:fb.Surface.grabsilent}{{2}{9}{Module documentation\relax }{section*.14}{}} 43 | \newlabel{index:fb.Surface.graticule}{{2}{9}{Module documentation\relax }{section*.15}{}} 44 | \newlabel{index:fb.Surface.informdriver}{{2}{10}{Module documentation\relax }{section*.16}{}} 45 | \newlabel{index:fb.Surface.line}{{2}{10}{Module documentation\relax }{section*.17}{}} 46 | \newlabel{index:fb.Surface.poly}{{2}{10}{Module documentation\relax }{section*.18}{}} 47 | \newlabel{index:fb.Surface.printxy}{{2}{11}{Module documentation\relax }{section*.19}{}} 48 | \newlabel{index:fb.Surface.rect}{{2}{12}{Module documentation\relax }{section*.20}{}} 49 | \newlabel{index:fb.Surface.set_dotstyle}{{2}{12}{Module documentation\relax }{section*.21}{}} 50 | \newlabel{index:fb.Surface.set_raw}{{2}{12}{Module documentation\relax }{section*.22}{}} 51 | \newlabel{index:fb.Surface.snow}{{2}{12}{Module documentation\relax }{section*.23}{}} 52 | \newlabel{index:fb.Surface.something}{{2}{12}{Module documentation\relax }{section*.24}{}} 53 | \newlabel{index:fb.Surface.update}{{2}{12}{Module documentation\relax }{section*.25}{}} 54 | \newlabel{index:fb.Trafo}{{2}{13}{Module documentation\relax }{section*.26}{}} 55 | \newlabel{index:fb.Uniton}{{2}{14}{Module documentation\relax }{section*.27}{}} 56 | \@writefile{toc}{\contentsline {chapter}{\numberline {3}Indices and tables}{15}{chapter.3}} 57 | \@writefile{lof}{\addvspace {10\p@ }} 58 | \@writefile{lot}{\addvspace {10\p@ }} 59 | \newlabel{index:indices-and-tables}{{3}{15}{Indices and tables\relax }{chapter.3}{}} 60 | \@writefile{toc}{\contentsline {chapter}{Python Module Index}{17}{section*.28}} 61 | -------------------------------------------------------------------------------- /Doc/build/latex/fbpy.idx: -------------------------------------------------------------------------------- 1 | \indexentry{fb (module)|hyperpage}{5} 2 | \indexentry{Colors (class in fb)|hyperpage}{5} 3 | \indexentry{Surface (class in fb)|hyperpage}{5} 4 | \indexentry{addpoly() (fb.Surface static method)|hyperpage}{5} 5 | \indexentry{arc() (fb.Surface static method)|hyperpage}{5} 6 | \indexentry{blit() (fb.Surface method)|hyperpage}{6} 7 | \indexentry{circle() (fb.Surface static method)|hyperpage}{7} 8 | \indexentry{clear() (fb.Surface method)|hyperpage}{8} 9 | \indexentry{drawpolys() (fb.Surface method)|hyperpage}{8} 10 | \indexentry{get\_raw() (fb.Surface method)|hyperpage}{9} 11 | \indexentry{grab() (fb.Surface method)|hyperpage}{9} 12 | \indexentry{grabsequence() (fb.Surface method)|hyperpage}{9} 13 | \indexentry{grabsilent() (fb.Surface method)|hyperpage}{9} 14 | \indexentry{graticule() (fb.Surface static method)|hyperpage}{9} 15 | \indexentry{informdriver() (fb.Surface method)|hyperpage}{10} 16 | \indexentry{line() (fb.Surface static method)|hyperpage}{10} 17 | \indexentry{poly() (fb.Surface static method)|hyperpage}{10} 18 | \indexentry{printxy() (fb.Surface static method)|hyperpage}{11} 19 | \indexentry{rect() (fb.Surface static method)|hyperpage}{12} 20 | \indexentry{set\_dotstyle() (fb.Surface method)|hyperpage}{12} 21 | \indexentry{set\_raw() (fb.Surface method)|hyperpage}{12} 22 | \indexentry{snow() (fb.Surface method)|hyperpage}{12} 23 | \indexentry{something() (fb.Surface method)|hyperpage}{12} 24 | \indexentry{update() (fb.Surface method)|hyperpage}{12} 25 | \indexentry{Trafo (class in fb)|hyperpage}{13} 26 | \indexentry{Uniton (class in fb)|hyperpage}{14} 27 | -------------------------------------------------------------------------------- /Doc/build/latex/fbpy.out: -------------------------------------------------------------------------------- 1 | \BOOKMARK [0][-]{chapter.1}{General description}{} 2 | \BOOKMARK [1][-]{section.1.1}{Website}{chapter.1} 3 | \BOOKMARK [0][-]{chapter.2}{Module documentation}{} 4 | \BOOKMARK [0][-]{chapter.3}{Indices and tables}{} 5 | \BOOKMARK [0][-]{section*.28}{Python Module Index}{} 6 | -------------------------------------------------------------------------------- /Doc/build/latex/fbpy.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/fbpy.pdf -------------------------------------------------------------------------------- /Doc/build/latex/fbpy.toc: -------------------------------------------------------------------------------- 1 | \select@language {english} 2 | \contentsline {chapter}{\numberline {1}General description}{3}{chapter.1} 3 | \contentsline {section}{\numberline {1.1}Website}{3}{section.1.1} 4 | \contentsline {chapter}{\numberline {2}Module documentation}{5}{chapter.2} 5 | \contentsline {chapter}{\numberline {3}Indices and tables}{15}{chapter.3} 6 | \contentsline {chapter}{Python Module Index}{17}{section*.28} 7 | -------------------------------------------------------------------------------- /Doc/build/latex/gottherobot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/gottherobot.png -------------------------------------------------------------------------------- /Doc/build/latex/graticule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/graticule.png -------------------------------------------------------------------------------- /Doc/build/latex/poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/poly.png -------------------------------------------------------------------------------- /Doc/build/latex/polys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/polys.png -------------------------------------------------------------------------------- /Doc/build/latex/printxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/printxy.png -------------------------------------------------------------------------------- /Doc/build/latex/python.ist: -------------------------------------------------------------------------------- 1 | line_max 100 2 | headings_flag 1 3 | heading_prefix " \\bigletter " 4 | 5 | preamble "\\begin{theindex} 6 | \\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}} 7 | 8 | " 9 | 10 | symhead_positive "{Symbols}" 11 | numhead_positive "{Numbers}" 12 | -------------------------------------------------------------------------------- /Doc/build/latex/rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/rotate.png -------------------------------------------------------------------------------- /Doc/build/latex/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/build/latex/snow.png -------------------------------------------------------------------------------- /Doc/build/latex/sphinxhowto.cls: -------------------------------------------------------------------------------- 1 | % 2 | % sphinxhowto.cls for Sphinx (http://sphinx.pocoo.org/) 3 | % 4 | 5 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 6 | \ProvidesClass{sphinxhowto}[2009/06/02 Document class (Sphinx HOWTO)] 7 | 8 | % 'oneside' option overriding the 'twoside' default 9 | \newif\if@oneside 10 | \DeclareOption{oneside}{\@onesidetrue} 11 | % Pass remaining document options to the parent class. 12 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\sphinxdocclass}} 13 | \ProcessOptions\relax 14 | 15 | % Default to two-side document 16 | \if@oneside 17 | % nothing to do (oneside is the default) 18 | \else 19 | \PassOptionsToClass{twoside}{\sphinxdocclass} 20 | \fi 21 | 22 | \LoadClass{\sphinxdocclass} 23 | 24 | % Set some sane defaults for section numbering depth and TOC depth. You can 25 | % reset these counters in your preamble. 26 | % 27 | \setcounter{secnumdepth}{2} 28 | 29 | % Change the title page to look a bit better, and fit in with the fncychap 30 | % ``Bjarne'' style a bit better. 31 | % 32 | \renewcommand{\maketitle}{ 33 | \rule{\textwidth}{1pt} 34 | \ifsphinxpdfoutput 35 | \begingroup 36 | % These \defs are required to deal with multi-line authors; it 37 | % changes \\ to ', ' (comma-space), making it pass muster for 38 | % generating document info in the PDF file. 39 | \def\\{, } 40 | \def\and{and } 41 | \pdfinfo{ 42 | /Author (\@author) 43 | /Title (\@title) 44 | } 45 | \endgroup 46 | \fi 47 | \begin{flushright} 48 | \sphinxlogo% 49 | {\rm\Huge\py@HeaderFamily \@title} \par 50 | {\em\large\py@HeaderFamily \py@release\releaseinfo} \par 51 | \vspace{25pt} 52 | {\Large\py@HeaderFamily 53 | \begin{tabular}[t]{c} 54 | \@author 55 | \end{tabular}} \par 56 | \vspace{25pt} 57 | \@date \par 58 | \py@authoraddress \par 59 | \end{flushright} 60 | \@thanks 61 | \setcounter{footnote}{0} 62 | \let\thanks\relax\let\maketitle\relax 63 | %\gdef\@thanks{}\gdef\@author{}\gdef\@title{} 64 | } 65 | 66 | \let\py@OldTableofcontents=\tableofcontents 67 | \renewcommand{\tableofcontents}{ 68 | \begingroup 69 | \parskip = 0mm 70 | \py@OldTableofcontents 71 | \endgroup 72 | \rule{\textwidth}{1pt} 73 | \vspace{12pt} 74 | } 75 | 76 | \@ifundefined{fancyhf}{ 77 | \pagestyle{plain}}{ 78 | \pagestyle{normal}} % start this way; change for 79 | \pagenumbering{arabic} % ToC & chapters 80 | 81 | \thispagestyle{empty} 82 | 83 | % Fix the bibliography environment to add an entry to the Table of 84 | % Contents. 85 | % For an article document class this environment is a section, 86 | % so no page break before it. 87 | \let\py@OldThebibliography=\thebibliography 88 | \renewcommand{\thebibliography}[1]{ 89 | \phantomsection 90 | \py@OldThebibliography{1} 91 | \addcontentsline{toc}{section}{\bibname} 92 | } 93 | -------------------------------------------------------------------------------- /Doc/documentation.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/documentation.txt -------------------------------------------------------------------------------- /Doc/html.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/html.zip -------------------------------------------------------------------------------- /Doc/source/.index.rst.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/.index.rst.swp -------------------------------------------------------------------------------- /Doc/source/images/arc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/arc.png -------------------------------------------------------------------------------- /Doc/source/images/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/circle.png -------------------------------------------------------------------------------- /Doc/source/images/gottherobot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/gottherobot.png -------------------------------------------------------------------------------- /Doc/source/images/graticule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/graticule.png -------------------------------------------------------------------------------- /Doc/source/images/poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/poly.png -------------------------------------------------------------------------------- /Doc/source/images/polys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/polys.png -------------------------------------------------------------------------------- /Doc/source/images/printxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/printxy.png -------------------------------------------------------------------------------- /Doc/source/images/rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/rotate.png -------------------------------------------------------------------------------- /Doc/source/images/scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/scope.png -------------------------------------------------------------------------------- /Doc/source/images/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/Doc/source/images/snow.png -------------------------------------------------------------------------------- /Doc/source/index.rst: -------------------------------------------------------------------------------- 1 | .. fbpy documentation master file, created by 2 | sphinx-quickstart on Fri Jun 20 01:39:00 2014. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | Welcome to fbpy's documentation! 7 | ================================ 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | 14 | 15 | General description 16 | =================== 17 | 18 | The `fbpy` module is an API for drawing in the framebuffer on Linux machines. 19 | It was conceived as part of an audio player project based on the 20 | raspberry pi computer and wolfson pi audio interface. I needed a low-level 21 | graphics library for visualizing audio data (scope, phase,...). I also 22 | wanted to gain some programming skills, like writing c libs for python and 23 | some kernel stuff. So this module is by no means an attempt to make a 24 | better graphics lib with fancy hardware acceleration or anythin or 25 | making something original. I think it is use able though and by examining 26 | the source, it might serve as a form of documentation if you want to 27 | make something like this yourself. That is why I publish it. Oh, and of course 28 | because I support open source hardware *and* software, the 'firmware' of 29 | my audio player should be available as source :) 30 | 31 | Website 32 | ------- 33 | 34 | http://transistorlove.wordpress.com 35 | 36 | 37 | Module documentation 38 | ==================== 39 | 40 | .. automodule:: fb 41 | :members: 42 | 43 | .. automodule:: svg 44 | :members: 45 | 46 | .. automodule:: sprite 47 | :members: 48 | 49 | .. automodule:: audioscope 50 | :members: 51 | 52 | Indices and tables 53 | ================== 54 | 55 | * :ref:`genindex` 56 | * :ref:`modindex` 57 | * :ref:`search` 58 | 59 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | #MANIFEST.in 2 | 3 | include *.txt 4 | include fblib.so 5 | recursive-include examples * 6 | recursive-include Doc * 7 | recursive-include fbpy * 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | fbpy 2 | ==== 3 | 4 | python module for drawing in the linux framebuffer 5 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/README.txt -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fblib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/lib.linux-armv6l-2.7/fblib.so -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fbpy/__init__.py: -------------------------------------------------------------------------------- 1 | #import fb 2 | -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fbpy/jack.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # untitled.py 5 | # 6 | # Copyright 2014 marcell 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 | # MA 02110-1301, USA. 22 | import fblib 23 | import numpy as np 24 | 25 | class Jackaudio(object): 26 | 27 | def __init__(self): 28 | audio = np.zeros(1024) 29 | self.dataL = np.array(audio, dtype=np.float64) 30 | self.dataR = np.array(audio, dtype=np.float64) 31 | 32 | def jackon(self): 33 | r=fblib.fbjackon() 34 | if r==-1: 35 | print "SORRY: only one instance allowed at the moment" 36 | print "Hey, this is pre-alpha..." 37 | return -1 38 | 39 | def jackoff(self): 40 | fblib.fbjackoff() 41 | 42 | def jackread(self): 43 | fblib.fbreadjack(self.dataL, self.dataR) 44 | 45 | @property 46 | def channels(self): 47 | self.jackread() 48 | return (self.dataL, self.dataR) 49 | 50 | if __name__ == '__main__': 51 | pass 52 | -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fbpy/obj.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class Ddd(object): 4 | 5 | def __init__(self, filename, scale): 6 | self.filename = filename 7 | self.xcrds = [] 8 | self.ycrds = [] 9 | self.zcrds = [] 10 | self.x=[] 11 | self.y=[] 12 | self.z=[] 13 | self.scale = scale 14 | 15 | def open(self): 16 | 17 | f = open(self.filename,'r') 18 | 19 | lines = f.readlines() 20 | f.close() 21 | x=[] 22 | y=[] 23 | z=[] 24 | for i, l in enumerate(lines): 25 | if 'v ' in l: 26 | crd = l.strip('v') 27 | xyz = crd.split(' ') 28 | self.xcrds.append(self.scale*float(xyz[1])) 29 | self.ycrds.append(self.scale*float(xyz[2])) 30 | self.zcrds.append(self.scale*float(xyz[3])) 31 | 32 | for i, l in enumerate(lines): 33 | if 'f ' in l: 34 | poly = l.strip('f') 35 | indi = poly.split(' ') 36 | x=[] 37 | y=[] 38 | z=[] 39 | for j, index in enumerate(indi): 40 | try: 41 | iindex = int(index) 42 | x.append(self.xcrds[iindex-1]) 43 | y.append(self.ycrds[iindex-1]) 44 | z.append(self.zcrds[iindex-1]) 45 | 46 | except: 47 | pass 48 | x.append(x[0]) 49 | y.append(y[0]) 50 | z.append(z[0]) 51 | self.x.append(np.array(x,dtype=np.int32)) 52 | self.y.append(np.array(y,dtype=np.int32)) 53 | self.z.append(np.array(z,dtype=np.int32)) 54 | 55 | if __name__ == '__main__': 56 | 57 | instance = Ddd('../examples/sphere.obj',1) 58 | instance.open() 59 | print instance.x 60 | 61 | 62 | -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fbpy/sprite.py: -------------------------------------------------------------------------------- 1 | # * sprite.py module for pythons fbpy package. Draws sprites without 2 | # * using hw blitterzz 3 | # * Copyright (C) 2014 Marcell Marosvolgyi aka noisegate 4 | # * 5 | # * This program is free software; you can redistribute it and/or 6 | # * modify it under the terms of the GNU General Public License 7 | # * as published by the Free Software Foundation; either version 2 8 | # * of the License, or (at your option) any later version. 9 | # * 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # * 15 | # * You should have received a copy of the GNU General Public License 16 | # * along with this program; if not, write to the Free Software 17 | # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # * 19 | # version: 0.1 20 | # profanities included 4 xtra powerimport fbpy.fb as fb 21 | 22 | import fbpy.fb as fb 23 | import copy 24 | import numpy as np 25 | import time 26 | 27 | class Needmain(type): 28 | """ 29 | Dont instantiate the sprite if 30 | there is no main surface. 31 | 32 | 33 | """ 34 | def __call__(self, *args, **kwargs): 35 | if fb.Surface.isalive(): 36 | return super(Needmain, self).__call__(*args, **kwargs) 37 | else: 38 | raise TypeError("Need main surface") 39 | 40 | class Sprite(object): 41 | """ 42 | A drawing surface, which can be moved around 43 | without destructing the background. 44 | 45 | Full example: 46 | 47 | .. doctest:: 48 | >>> import fbpy.fb 49 | 50 | >>> import fbpy.sprite 51 | 52 | 53 | 54 | """ 55 | 56 | __metaclass__ = Needmain 57 | 58 | def __init__(self, (x,y),(w,h)): 59 | 60 | self.surface = fb.Surface((x,y),(w,h)) 61 | self.backgr = fb.Surface((x,y),(w,h)) 62 | self.newstamp = None 63 | self.spritedata = [] 64 | self.oldR = (x,y) 65 | self.R = (x,y) 66 | self.backgr.keepbackground() 67 | self.oldstamp = self.backgr.get_raw() 68 | #self.oldstamp = np.zeros(w*h*4,dtype=np.int8) 69 | 70 | 71 | def moveto(self, R, sprite_no): 72 | """ 73 | move to new position using 74 | FTL drive 75 | it jumps. for smooth moves, fast 76 | a low level iface will be implemented 77 | 78 | moveto(, sprite_nr) 79 | """ 80 | 81 | self.R = R 82 | 83 | self.surface.origo = self.R 84 | res = self.surface.overlay(self.oldstamp,self.spritedata[sprite_no], self.oldR[0], self.oldR[1], 1) 85 | 86 | if res == 0 : self.oldR = self.R 87 | 88 | def save(self): 89 | """ 90 | save current surface to list 91 | """ 92 | self.spritedata.append(self.surface.get_raw()) 93 | 94 | def hide(self): 95 | """ 96 | hide this sprite 97 | 98 | """ 99 | self.surface.overlay(self.oldstamp,self.spritedata[0], self.oldR[0],self.oldR[1], 0) 100 | 101 | @property 102 | def x(self): 103 | return self.surface.origo[0] 104 | 105 | @x.setter 106 | def x(self,x): 107 | temp = self.surface.origo 108 | temp = (x, temp[0]) 109 | 110 | @property 111 | def y(self): 112 | return self.surface.origo[1] 113 | 114 | @y.setter 115 | def y(self,y): 116 | temp = self.surface.origo 117 | temp = (y, temp[1]) 118 | 119 | def redraw(self): 120 | pass 121 | 122 | if __name__ == '__main__': 123 | main = fb.Surface() 124 | 125 | sprite = Sprite((10,10),(100,100)) 126 | sprite.surface.clear() 127 | sprite.surface.line((0,0),(100,100)) 128 | sprite.moveto(20,20) 129 | 130 | fb.Surface.close() 131 | 132 | -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fbpy/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Some docu here then... 3 | """ 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /build/lib.linux-armv6l-2.7/fbpy/utils/svg.py: -------------------------------------------------------------------------------- 1 | #http://stackoverflow.com/questions/15857818/python-svg-parser 2 | from xml.dom import minidom 3 | import re 4 | 5 | class Poly(object): 6 | 7 | def __init__(self): 8 | self.x = [] 9 | self.y = [] 10 | self.z = [] 11 | 12 | class Svg2Poly(object): 13 | 14 | def __init__(self, filename, layer): 15 | self.filename = filename 16 | self.path_strings = '' 17 | self.polys = [] 18 | self.layer = layer 19 | self.fetch() 20 | self.parse() 21 | 22 | def fetch(self): 23 | doc = minidom.parse("./test.svg") # parseString also exists 24 | self.path_strings = [path.getAttribute('d') for path in doc.getElementsByTagName('path')] 25 | doc.unlink() 26 | 27 | def parse(self): 28 | for i, l in enumerate(self.path_strings): 29 | print "Item {0}:".format(i) 30 | self.polys.append(Poly()) 31 | currentpoly = self.polys[-1] 32 | crds = re.findall("([0-9]+(\.[0-9]+)?|\.[0-9]+),([0-9]+(\.[0-9]+)?|\.[0-9]+)", l) 33 | for j, m in enumerate(crds): 34 | print "Coordinate {0}".format(j), 35 | currentpoly.x.append(float(m[0])) 36 | currentpoly.y.append(float(m[2])) 37 | currentpoly.z.append(float(self.layer)) 38 | 39 | def report(self): 40 | s="" 41 | s+="svg poly container object\n" 42 | s+="file {0}\n".format(self.filename) 43 | s+="number of polys {0}\n".format(len(self.polys)) 44 | return s 45 | 46 | def __repr__(self): 47 | return self.report() 48 | 49 | def __str__(self): 50 | return self.report() 51 | 52 | 53 | if __name__ == '__main__': 54 | converter = Svg2Poly("./test.svg",1) 55 | print converter 56 | 57 | 58 | -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fblib.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/lib.linux-x86_64-2.7/fblib.so -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fbpy/__init__.py: -------------------------------------------------------------------------------- 1 | #import fb 2 | -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fbpy/jack.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # untitled.py 5 | # 6 | # Copyright 2014 marcell 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 | # MA 02110-1301, USA. 22 | import fblib 23 | import numpy as np 24 | 25 | class Jackaudio(object): 26 | 27 | def __init__(self): 28 | audio = np.zeros(1024) 29 | self.dataL = np.array(audio, dtype=np.float64) 30 | self.dataR = np.array(audio, dtype=np.float64) 31 | 32 | def jackon(self): 33 | r=fblib.fbjackon() 34 | if r==-1: 35 | print "SORRY: only one instance allowed at the moment" 36 | print "Hey, this is pre-alpha..." 37 | return -1 38 | 39 | def jackoff(self): 40 | fblib.fbjackoff() 41 | 42 | def jackread(self): 43 | fblib.fbreadjack(self.dataL, self.dataR) 44 | 45 | @property 46 | def channels(self): 47 | self.jackread() 48 | return (self.dataL, self.dataR) 49 | 50 | if __name__ == '__main__': 51 | pass 52 | -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fbpy/obj.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class Ddd(object): 4 | 5 | def __init__(self, filename, scale): 6 | self.filename = filename 7 | self.xcrds = [] 8 | self.ycrds = [] 9 | self.zcrds = [] 10 | self.x=[] 11 | self.y=[] 12 | self.z=[] 13 | self.scale = scale 14 | 15 | def open(self): 16 | 17 | f = open(self.filename,'r') 18 | 19 | lines = f.readlines() 20 | f.close() 21 | x=[] 22 | y=[] 23 | z=[] 24 | for i, l in enumerate(lines): 25 | if 'v ' in l: 26 | crd = l.strip('v') 27 | xyz = crd.split(' ') 28 | self.xcrds.append(self.scale*float(xyz[1])) 29 | self.ycrds.append(self.scale*float(xyz[2])) 30 | self.zcrds.append(self.scale*float(xyz[3])) 31 | 32 | for i, l in enumerate(lines): 33 | if 'f ' in l: 34 | poly = l.strip('f') 35 | indi = poly.split(' ') 36 | x=[] 37 | y=[] 38 | z=[] 39 | for j, index in enumerate(indi): 40 | try: 41 | iindex = int(index) 42 | x.append(self.xcrds[iindex-1]) 43 | y.append(self.ycrds[iindex-1]) 44 | z.append(self.zcrds[iindex-1]) 45 | 46 | except: 47 | pass 48 | x.append(x[0]) 49 | y.append(y[0]) 50 | z.append(z[0]) 51 | self.x.append(np.array(x,dtype=np.int32)) 52 | self.y.append(np.array(y,dtype=np.int32)) 53 | self.z.append(np.array(z,dtype=np.int32)) 54 | 55 | if __name__ == '__main__': 56 | 57 | instance = Ddd('../examples/sphere.obj',1) 58 | instance.open() 59 | print instance.x 60 | 61 | 62 | -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fbpy/sprite.py: -------------------------------------------------------------------------------- 1 | # * sprite.py module for pythons fbpy package. Draws sprites without 2 | # * using hw blitterzz 3 | # * Copyright (C) 2014 Marcell Marosvolgyi aka noisegate 4 | # * 5 | # * This program is free software; you can redistribute it and/or 6 | # * modify it under the terms of the GNU General Public License 7 | # * as published by the Free Software Foundation; either version 2 8 | # * of the License, or (at your option) any later version. 9 | # * 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # * 15 | # * You should have received a copy of the GNU General Public License 16 | # * along with this program; if not, write to the Free Software 17 | # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # * 19 | # version: 0.1 20 | # profanities included 4 xtra powerimport fbpy.fb as fb 21 | 22 | import fbpy.fb as fb 23 | import copy 24 | import numpy as np 25 | import time 26 | 27 | class Needmain(type): 28 | """ 29 | Dont instantiate the sprite if 30 | there is no main surface. 31 | 32 | 33 | """ 34 | def __call__(self, *args, **kwargs): 35 | if fb.Surface.isalive(): 36 | return super(Needmain, self).__call__(*args, **kwargs) 37 | else: 38 | raise TypeError("Need main surface") 39 | 40 | class Sprite(object): 41 | """ 42 | A drawing surface, which can be moved around 43 | without destructing the background. 44 | 45 | Full example: 46 | 47 | .. doctest:: 48 | >>> import fbpy.fb 49 | 50 | >>> import fbpy.sprite 51 | 52 | 53 | 54 | """ 55 | 56 | __metaclass__ = Needmain 57 | 58 | def __init__(self, (x,y),(w,h)): 59 | 60 | self.surface = fb.Surface((x,y),(w,h)) 61 | self.backgr = fb.Surface((x,y),(w,h)) 62 | self.newstamp = None 63 | self.spritedata = [] 64 | self.oldR = (x,y) 65 | self.R = (x,y) 66 | self.backgr.keepbackground() 67 | self.oldstamp = self.backgr.get_raw() 68 | #self.oldstamp = np.zeros(w*h*4,dtype=np.int8) 69 | 70 | 71 | def moveto(self, R, sprite_no): 72 | """ 73 | move to new position using 74 | FTL drive 75 | it jumps. for smooth moves, fast 76 | a low level iface will be implemented 77 | 78 | moveto(, sprite_nr) 79 | """ 80 | 81 | self.R = R 82 | 83 | self.surface.origo = self.R 84 | res = self.surface.overlay(self.oldstamp,self.spritedata[sprite_no], self.oldR[0], self.oldR[1], 1) 85 | 86 | if res == 0 : self.oldR = self.R 87 | 88 | def save(self): 89 | """ 90 | save current surface to list 91 | """ 92 | self.spritedata.append(self.surface.get_raw()) 93 | 94 | def hide(self): 95 | """ 96 | hide this sprite 97 | 98 | """ 99 | self.surface.overlay(self.oldstamp,self.spritedata[0], self.oldR[0],self.oldR[1], 0) 100 | 101 | @property 102 | def x(self): 103 | return self.surface.origo[0] 104 | 105 | @x.setter 106 | def x(self,x): 107 | temp = self.surface.origo 108 | temp = (x, temp[0]) 109 | 110 | @property 111 | def y(self): 112 | return self.surface.origo[1] 113 | 114 | @y.setter 115 | def y(self,y): 116 | temp = self.surface.origo 117 | temp = (y, temp[1]) 118 | 119 | def redraw(self): 120 | pass 121 | 122 | if __name__ == '__main__': 123 | main = fb.Surface() 124 | 125 | sprite = Sprite((10,10),(100,100)) 126 | sprite.surface.clear() 127 | sprite.surface.line((0,0),(100,100)) 128 | sprite.moveto(20,20) 129 | 130 | fb.Surface.close() 131 | 132 | -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fbpy/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Some docu here then... 3 | """ 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /build/lib.linux-x86_64-2.7/fbpy/utils/svg.py: -------------------------------------------------------------------------------- 1 | #http://stackoverflow.com/questions/15857818/python-svg-parser 2 | from xml.dom import minidom 3 | import re 4 | 5 | class Poly(object): 6 | 7 | def __init__(self): 8 | self.x = [] 9 | self.y = [] 10 | self.z = [] 11 | 12 | class Svg2Poly(object): 13 | 14 | def __init__(self, filename, layer): 15 | self.filename = filename 16 | self.path_strings = '' 17 | self.polys = [] 18 | self.layer = layer 19 | self.fetch() 20 | self.parse() 21 | 22 | def fetch(self): 23 | doc = minidom.parse("./test.svg") # parseString also exists 24 | self.path_strings = [path.getAttribute('d') for path in doc.getElementsByTagName('path')] 25 | doc.unlink() 26 | 27 | def parse(self): 28 | for i, l in enumerate(self.path_strings): 29 | print "Item {0}:".format(i) 30 | self.polys.append(Poly()) 31 | currentpoly = self.polys[-1] 32 | crds = re.findall("([0-9]+(\.[0-9]+)?|\.[0-9]+),([0-9]+(\.[0-9]+)?|\.[0-9]+)", l) 33 | for j, m in enumerate(crds): 34 | print "Coordinate {0}".format(j), 35 | currentpoly.x.append(float(m[0])) 36 | currentpoly.y.append(float(m[2])) 37 | currentpoly.z.append(float(self.layer)) 38 | 39 | def report(self): 40 | s="" 41 | s+="svg poly container object\n" 42 | s+="file {0}\n".format(self.filename) 43 | s+="number of polys {0}\n".format(len(self.polys)) 44 | return s 45 | 46 | def __repr__(self): 47 | return self.report() 48 | 49 | def __str__(self): 50 | return self.report() 51 | 52 | 53 | if __name__ == '__main__': 54 | converter = Svg2Poly("./test.svg",1) 55 | print converter 56 | 57 | 58 | -------------------------------------------------------------------------------- /build/temp.linux-armv6l-2.7/fbpy/utils/audio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-armv6l-2.7/fbpy/utils/audio.o -------------------------------------------------------------------------------- /build/temp.linux-armv6l-2.7/fbpy/utils/fblib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-armv6l-2.7/fbpy/utils/fblib.o -------------------------------------------------------------------------------- /build/temp.linux-armv6l-2.7/fbpy/utils/fbutils.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-armv6l-2.7/fbpy/utils/fbutils.o -------------------------------------------------------------------------------- /build/temp.linux-armv6l-2.7/fbpy/utils/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-armv6l-2.7/fbpy/utils/test.o -------------------------------------------------------------------------------- /build/temp.linux-x86_64-2.7/fbpy/utils/audio.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-x86_64-2.7/fbpy/utils/audio.o -------------------------------------------------------------------------------- /build/temp.linux-x86_64-2.7/fbpy/utils/fblib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-x86_64-2.7/fbpy/utils/fblib.o -------------------------------------------------------------------------------- /build/temp.linux-x86_64-2.7/fbpy/utils/fbutils.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-x86_64-2.7/fbpy/utils/fbutils.o -------------------------------------------------------------------------------- /build/temp.linux-x86_64-2.7/fbpy/utils/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/build/temp.linux-x86_64-2.7/fbpy/utils/test.o -------------------------------------------------------------------------------- /buildinstall.sh: -------------------------------------------------------------------------------- 1 | sudo python setup.py build build_ext install 2 | -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | python setup.py build_ext --inplace 2 | -------------------------------------------------------------------------------- /dist/fbpy-0.1.linux-x86_64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/dist/fbpy-0.1.linux-x86_64.tar.gz -------------------------------------------------------------------------------- /dist/fbpy-0.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/dist/fbpy-0.1.tar.gz -------------------------------------------------------------------------------- /err.txt: -------------------------------------------------------------------------------- 1 | running build 2 | running build_py 3 | copying fbpy/fb.py -> build/lib.linux-x86_64-2.7/fbpy 4 | running build_ext 5 | running install 6 | running install_lib 7 | copying build/lib.linux-x86_64-2.7/fbpy/fb.py -> /usr/local/lib/python2.7/dist-packages/fbpy 8 | byte-compiling /usr/local/lib/python2.7/dist-packages/fbpy/fb.py to fb.pyc 9 | running install_egg_info 10 | Removing /usr/local/lib/python2.7/dist-packages/fbpy-0.1.egg-info 11 | Writing /usr/local/lib/python2.7/dist-packages/fbpy-0.1.egg-info 12 | -------------------------------------------------------------------------------- /examples/3dpoly.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import fbpy.sprite as sprite 3 | import numpy as np 4 | import time 5 | 6 | if __name__ == '__main__': 7 | 8 | main = fb.Surface() 9 | 10 | mysprite = sprite.Sprite((0,0),(200,200)) 11 | 12 | mysprite.surface.dddtrafo 13 | 14 | mysprite.surface.dddtrafo.ez=155 15 | mysprite.surface.dddtrafo.ex=-100 16 | mysprite.surface.dddtrafo.ey=-100 17 | mysprite.surface.dddtrafo.cx = 0 18 | mysprite.surface.dddtrafo.cy = 0 19 | mysprite.surface.dddtrafo.cz = 325 20 | 21 | mini =-100 22 | maxi = 100 23 | back =-100 24 | front =100 25 | mysprite.surface.addpoly( [mini,maxi,maxi,mini,mini], 26 | [mini,mini,maxi,maxi,mini], 27 | [back,back,back,back,back]) 28 | mysprite.surface.addpoly( [mini,maxi,maxi,mini,mini], 29 | [mini,mini,maxi,maxi,mini], 30 | [front,front,front,front,front]) 31 | mysprite.surface.addpoly( [mini,mini,mini,mini,mini], 32 | [mini,mini,maxi,maxi,mini], 33 | [back,front,front,back,back]) 34 | mysprite.surface.addpoly( [maxi,maxi,maxi,maxi,maxi], 35 | [mini,mini,maxi,maxi,mini], 36 | [back,front,front,back,back]) 37 | 38 | mysprite.surface.clear() 39 | for i in np.arange(0,2*np.pi,0.005): 40 | mysprite.surface.clear() 41 | mysprite.surface.dddtrafo.tetay = 2*i 42 | mysprite.surface.dddtrafo.tetax = 3*i 43 | mysprite.surface.dddtrafo.tetaz = i 44 | # mysprite.surface.pixelstyle.blur=2 45 | # mysprite.surface.pixelstyle.blurradius=1 46 | # mysprite.surface.pixelstyle.sigma=1 47 | # mysprite.surface.pixelstyle.color.a = 100 48 | # mysprite.surface.pixelstyle.color.r = 0 49 | # mysprite.surface.pixelstyle.color.g = 40 50 | # mysprite.surface.pixelstyle.color.b = 10 51 | mysprite.surface.draw3dpolys() 52 | mysprite.surface.styledredraw() 53 | mysprite.save() 54 | 55 | N =len(mysprite.spritedata) 56 | 57 | 58 | for j in range(30): 59 | for i in range(N): 60 | alpha = 2.0*i/N*np.pi 61 | x = np.cos(alpha)*0+600 62 | y = np.sin(alpha)*0+300 63 | mysprite.moveto((x,y),i) 64 | time.sleep(0.005) 65 | -------------------------------------------------------------------------------- /examples/3dpoly0.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import numpy as np 3 | import time 4 | 5 | if __name__ == '__main__': 6 | 7 | main = fb.Surface() 8 | 9 | sub = fb.Surface((0,0),(300,300)) 10 | sub.dddtrafo 11 | 12 | sub.dddtrafo.ez=155 13 | sub.dddtrafo.ex=-100 14 | sub.dddtrafo.ey=-100 15 | sub.dddtrafo.cx = 0 16 | sub.dddtrafo.cy = 0 17 | sub.dddtrafo.cz = 325 18 | 19 | mini =-100 20 | maxi = 100 21 | back =-100 22 | front =100 23 | sub.addpoly( [mini,maxi,maxi,mini,mini], 24 | [mini,mini,maxi,maxi,mini], 25 | [back,back,back,back,back]) 26 | sub.addpoly( [mini,maxi,maxi,mini,mini], 27 | [mini,mini,maxi,maxi,mini], 28 | [front,front,front,front,front]) 29 | sub.addpoly( [mini,mini,mini,mini,mini], 30 | [mini,mini,maxi,maxi,mini], 31 | [back,front,front,back,back]) 32 | sub.addpoly( [maxi,maxi,maxi,maxi,maxi], 33 | [mini,mini,maxi,maxi,mini], 34 | [back,front,front,back,back]) 35 | 36 | for i in np.arange(0,2*np.pi,0.005): 37 | sub.clear() 38 | sub.dddtrafo.tetay = 2*i 39 | sub.dddtrafo.tetax = 3*i 40 | sub.dddtrafo.tetaz = i 41 | sub.dddtrafo.ctetax = 0.0 42 | sub.dddtrafo.ctetay = 0.0 43 | sub.dddtrafo.ctetaz = 0.0 44 | sub.draw3dpolys() 45 | time.sleep(0.005) 46 | sub.update() 47 | 48 | -------------------------------------------------------------------------------- /examples/3dpoly1.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import numpy as np 3 | import time 4 | 5 | if __name__ == '__main__': 6 | 7 | main = fb.Surface() 8 | 9 | sub = fb.Surface((700,300),(500,500)) 10 | 11 | grid = fb.Surface((700,300),(500,500)) 12 | 13 | sub.dddtrafo.ez=155 14 | sub.dddtrafo.ex=-250 15 | sub.dddtrafo.ey=-250 16 | sub.dddtrafo.cx = 0 17 | sub.dddtrafo.cy = 40 18 | sub.dddtrafo.cz = 325 19 | grid.dddtrafo.ez=155 20 | grid.dddtrafo.ex=-250 21 | grid.dddtrafo.ey=-250 22 | grid.dddtrafo.cx = 0 23 | grid.dddtrafo.cy = 40 24 | grid.dddtrafo.cz = 325 25 | grid.pixelstyle.color = fb.Color(0,100,0,0) 26 | 27 | mini =-50 28 | maxi = 50 29 | back =-50 30 | front =50 31 | sub.addpoly( [mini,maxi,maxi,mini,mini], 32 | [mini,mini,maxi,maxi,mini], 33 | [back,back,back,back,back]) 34 | sub.addpoly( [mini,maxi,maxi,mini,mini], 35 | [mini,mini,maxi,maxi,mini], 36 | [front,front,front,front,front]) 37 | sub.addpoly( [mini,mini,mini,mini,mini], 38 | [mini,mini,maxi,maxi,mini], 39 | [back,front,front,back,back]) 40 | sub.addpoly( [maxi,maxi,maxi,maxi,maxi], 41 | [mini,mini,maxi,maxi,mini], 42 | [back,front,front,back,back]) 43 | 44 | 45 | for x in range(-200,200,20): 46 | grid.addpoly([x,x],[-200,200],[0,0]) 47 | grid.addpoly([-200,200],[x,x],[0,0]) 48 | 49 | for i in np.arange(0,2*np.pi,0.005): 50 | cx = 325*np.sin(i) 51 | cz = 325*np.cos(i) 52 | cy = 40 53 | sub.clear() 54 | grid.dddtrafo.tetay = 0.0 55 | grid.dddtrafo.tetax = 1.5 56 | grid.dddtrafo.tetaz = 0.0 57 | grid.dddtrafo.ctetax = 0.0 58 | grid.dddtrafo.ctetay = i 59 | grid.dddtrafo.ctetaz = 0.0 60 | grid.dddtrafo.cx = cx 61 | grid.dddtrafo.cz = cz 62 | grid.dddtrafo.cy = cy 63 | grid.clear() 64 | grid.draw3dpolys() 65 | sub.dddtrafo.tetay = 2*i 66 | sub.dddtrafo.tetax = 3*i 67 | sub.dddtrafo.tetaz = i 68 | sub.dddtrafo.ctetax = 0.0 69 | sub.dddtrafo.ctetay = i 70 | sub.dddtrafo.ctetaz = 0.0 71 | sub.dddtrafo.cx = cx 72 | sub.dddtrafo.cz = cz 73 | sub.dddtrafo.cy = cy 74 | sub.draw3dpolys() 75 | grid.update() 76 | sub.update() 77 | time.sleep(0.005) 78 | -------------------------------------------------------------------------------- /examples/:demo.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import fbpy.svg as svg 3 | import time 4 | import subprocess 5 | import numpy as np 6 | import curses 7 | 8 | class Welcome(object): 9 | 10 | main = fb.Surface() 11 | midd = fb.Surface((0,0),(800,300)) 12 | scrn = None 13 | 14 | @classmethod 15 | def curses(cls): 16 | cls.scrn = curses.initscr() 17 | curses.cbreak() 18 | cls.scrn.addstr(10,10,"computer up...") 19 | 20 | @classmethod 21 | def helloworld(cls): 22 | print subprocess.check_output(["clear"]) 23 | cls.midd.pixelstyle = fb.Pixelstyles.faint 24 | tekst1 = svg.Text((10,10),"initializing fbpy 01", 1.5, cls.midd) 25 | cls.midd.update() 26 | 27 | @classmethod 28 | def enough(cls): 29 | curses.endwin() 30 | fb.Surface.close() 31 | 32 | if __name__ == "__main__": 33 | Welcome.curses() 34 | Welcome.helloworld() 35 | Welcome.enough() 36 | -------------------------------------------------------------------------------- /examples/:sus: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import fbpy.svg as svg 3 | import time 4 | import subprocess 5 | import numpy as np 6 | import curses 7 | 8 | class Welcome(object): 9 | 10 | main = fb.Surface() 11 | midd = fb.Surface((0,0),(800,300)) 12 | scrn = None 13 | 14 | @classmethod 15 | def curses(cls): 16 | cls.scrn = curses.initscr() 17 | curses.cbreak() 18 | cls.scrn.addstr(10,10,"computer up...") 19 | 20 | @classmethod 21 | def helloworld(cls): 22 | print subprocess.check_output(["clear"]) 23 | cls.midd.pixelstyle = fb.Pixelstyles.faint 24 | tekst1 = svg.Text((10,10),"initializing fbpy 01", 1.5, cls.midd) 25 | cls.midd.update() 26 | 27 | @classmethod 28 | def enough(cls): 29 | curses.endwin() 30 | fb.Surface.close() 31 | 32 | if __name__ == "__main__": 33 | Welcome.curses() 34 | Welcome.helloworld() 35 | Welcome.enough() 36 | -------------------------------------------------------------------------------- /examples/Hunter97: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/examples/Hunter97 -------------------------------------------------------------------------------- /examples/Voyager_17.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'Voyager_17.blend' 2 | # Material Count: 7 3 | 4 | newmtl tex_01 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.250000 0.250000 0.250000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | map_Kd /home/marcell/Downloads/Voyager 1&2/Voyager_tex_01.psd 13 | 14 | newmtl tex_01_NONE 15 | Ns 96.078431 16 | Ka 0.000000 0.000000 0.000000 17 | Kd 0.640000 0.640000 0.640000 18 | Ks 0.250000 0.250000 0.250000 19 | Ni 1.000000 20 | d 1.000000 21 | illum 2 22 | map_Kd /home/marcell/Downloads/Voyager 1&2/texture/Voyager_tex_01.psd 23 | 24 | newmtl tex_01_Voyager_tex_01.ps.002 25 | Ns 96.078431 26 | Ka 0.000000 0.000000 0.000000 27 | Kd 0.640000 0.640000 0.640000 28 | Ks 0.250000 0.250000 0.250000 29 | Ni 1.000000 30 | d 1.000000 31 | illum 2 32 | map_Kd /home/marcell/Downloads/Voyager 1&2/Voyager_tex_01.psd 33 | 34 | newmtl tex_01_Voyager_tex_01.ps.003 35 | Ns 96.078431 36 | Ka 0.000000 0.000000 0.000000 37 | Kd 0.640000 0.640000 0.640000 38 | Ks 0.250000 0.250000 0.250000 39 | Ni 1.000000 40 | d 1.000000 41 | illum 2 42 | map_Kd /home/marcell/Downloads/Voyager 1&2/Voyager_tex_01.psd 43 | 44 | newmtl tex_02_AO 45 | Ns 96.078431 46 | Ka 0.000000 0.000000 0.000000 47 | Kd 0.640000 0.640000 0.640000 48 | Ks 0.500000 0.500000 0.500000 49 | Ni 1.000000 50 | d 1.000000 51 | illum 2 52 | map_Kd /home/marcell/Downloads/Voyager 1&2/tex_02_AO.png 53 | 54 | newmtl tex_02_AO_dark 55 | Ns 96.078431 56 | Ka 0.000000 0.000000 0.000000 57 | Kd 0.122570 0.122570 0.122570 58 | Ks 0.500000 0.500000 0.500000 59 | Ni 1.000000 60 | d 1.000000 61 | illum 2 62 | map_Kd /home/marcell/Downloads/Voyager 1&2/tex_02_AO.png 63 | 64 | newmtl tex_02_AO_dark_NONE 65 | Ns 96.078431 66 | Ka 0.000000 0.000000 0.000000 67 | Kd 0.122570 0.122570 0.122570 68 | Ks 0.500000 0.500000 0.500000 69 | Ni 1.000000 70 | d 1.000000 71 | illum 2 72 | map_Kd /home/marcell/Downloads/Voyager 1&2/texture/tex_02_AO.png 73 | -------------------------------------------------------------------------------- /examples/audio.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import fbpy.jack as jack 3 | import time 4 | 5 | if __name__ == '__main__': 6 | main = fb.Surface() 7 | surf = fb.Surface((1000,15),(204,204)) 8 | surf.graticule((0.0,0.0),(1.0,1.0)) 9 | sprite = surf.get_raw() 10 | ja = jack.Jackaudio() 11 | 12 | ja.jackon() 13 | while 1<2: 14 | ja.jackread() 15 | ja.dataL 16 | x=[] 17 | yL=[] 18 | yR=[] 19 | j=0 20 | for i,a in enumerate(ja.dataL): 21 | if (i % 5 == 0): 22 | j = j+1 23 | x.append(j) 24 | yL.append(int(a*20)+80) 25 | yR.append(int(ja.dataR[i]*20)+120) 26 | surf.clear() 27 | surf.set_raw(sprite) 28 | surf.poly(x, yL) 29 | surf.poly(x, yR) 30 | surf.rect((0.0,0.0),(1.0,1.0)) 31 | surf.update() 32 | time.sleep(0.05) 33 | ja.jackoff() 34 | surf.close() 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/byyrcmnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/examples/byyrcmnd.png -------------------------------------------------------------------------------- /examples/clockdemo.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | 4 | class Clock(object): 5 | 6 | def __init__(self): 7 | self.win = fb.Surface() 8 | self.cwin = fb.Surface((400,400),(700,100)) 9 | self.win.clear() 10 | self.win.printxy((0.7,0.9),"fb python iface by Noisegate 2014",1) 11 | self.cwin.clear() 12 | self.win.update() 13 | self.cwin.update() 14 | 15 | def start(self): 16 | while True: 17 | self.cwin.clear() 18 | self.cwin.printxy((0,0),time.ctime(),2) 19 | self.cwin.update() 20 | time.sleep(1) 21 | 22 | if __name__ == "__main__": 23 | myclock = Clock() 24 | myclock.start() 25 | 26 | -------------------------------------------------------------------------------- /examples/clockdemorasp.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | 4 | class Clock(object): 5 | 6 | def __init__(self): 7 | self.win = fb.Surface() 8 | self.cwin = fb.Surface((0,0),(300,200)) 9 | self.win.clear() 10 | self.win.printxy((0.7,0.9),"fb python iface by Noisegate 2014",1) 11 | 12 | self.cwin.clear() 13 | self.win.update() 14 | self.cwin.update() 15 | 16 | def start(self): 17 | while True: 18 | self.cwin.clear() 19 | self.cwin.pixelstyle.color.a = 100 20 | self.cwin.printxy((0,0),time.ctime(),2) 21 | self.cwin.update() 22 | time.sleep(1) 23 | 24 | if __name__ == "__main__": 25 | myclock = Clock() 26 | myclock.start() 27 | 28 | -------------------------------------------------------------------------------- /examples/cone0.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /examples/cone0.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.70 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib cone0.mtl 4 | o Cone 5 | v 0.000000 -1.000000 -1.000000 6 | v 0.000000 1.000000 0.000000 7 | v 0.195090 -1.000000 -0.980785 8 | v 0.382683 -1.000000 -0.923880 9 | v 0.555570 -1.000000 -0.831470 10 | v 0.707107 -1.000000 -0.707107 11 | v 0.831470 -1.000000 -0.555570 12 | v 0.923880 -1.000000 -0.382683 13 | v 0.980785 -1.000000 -0.195090 14 | v 1.000000 -1.000000 -0.000000 15 | v 0.980785 -1.000000 0.195090 16 | v 0.923880 -1.000000 0.382683 17 | v 0.831470 -1.000000 0.555570 18 | v 0.707107 -1.000000 0.707107 19 | v 0.555570 -1.000000 0.831470 20 | v 0.382683 -1.000000 0.923880 21 | v 0.195090 -1.000000 0.980785 22 | v -0.000000 -1.000000 1.000000 23 | v -0.195091 -1.000000 0.980785 24 | v -0.382684 -1.000000 0.923879 25 | v -0.555571 -1.000000 0.831469 26 | v -0.707107 -1.000000 0.707106 27 | v -0.831470 -1.000000 0.555570 28 | v -0.923880 -1.000000 0.382683 29 | v -0.980785 -1.000000 0.195089 30 | v -1.000000 -1.000000 -0.000001 31 | v -0.980785 -1.000000 -0.195091 32 | v -0.923879 -1.000000 -0.382684 33 | v -0.831469 -1.000000 -0.555571 34 | v -0.707106 -1.000000 -0.707108 35 | v -0.555569 -1.000000 -0.831470 36 | v -0.382682 -1.000000 -0.923880 37 | v -0.195089 -1.000000 -0.980786 38 | usemtl None 39 | s off 40 | f 32 2 33 41 | f 1 2 3 42 | f 31 2 32 43 | f 30 2 31 44 | f 29 2 30 45 | f 28 2 29 46 | f 27 2 28 47 | f 26 2 27 48 | f 25 2 26 49 | f 24 2 25 50 | f 23 2 24 51 | f 22 2 23 52 | f 21 2 22 53 | f 20 2 21 54 | f 19 2 20 55 | f 18 2 19 56 | f 17 2 18 57 | f 16 2 17 58 | f 15 2 16 59 | f 14 2 15 60 | f 13 2 14 61 | f 12 2 13 62 | f 11 2 12 63 | f 10 2 11 64 | f 9 2 10 65 | f 8 2 9 66 | f 7 2 8 67 | f 6 2 7 68 | f 5 2 6 69 | f 4 2 5 70 | f 33 2 1 71 | f 3 2 4 72 | f 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 73 | -------------------------------------------------------------------------------- /examples/cube.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.70 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | o Cube_Cube.001 4 | v -1.000000 -1.000000 1.000000 5 | v -1.000000 -1.000000 -1.000000 6 | v 1.000000 -1.000000 -1.000000 7 | v 1.000000 -1.000000 1.000000 8 | v -1.000000 1.000000 1.000000 9 | v -1.000000 1.000000 -1.000000 10 | v 1.000000 1.000000 -1.000000 11 | v 1.000000 1.000000 1.000000 12 | s off 13 | f 5 6 2 1 14 | f 6 7 3 2 15 | f 7 8 4 3 16 | f 8 5 1 4 17 | f 1 2 3 4 18 | f 8 7 6 5 19 | -------------------------------------------------------------------------------- /examples/cube0.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl Material 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | -------------------------------------------------------------------------------- /examples/cube0.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.70 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib cube0.mtl 4 | o Cube 5 | v 1.000000 -1.000000 -1.000000 6 | v 1.000000 -1.000000 1.000000 7 | v -1.000000 -1.000000 1.000000 8 | v -1.000000 -1.000000 -1.000000 9 | v 1.000000 1.000000 -0.999999 10 | v 0.999999 1.000000 1.000001 11 | v -1.000000 1.000000 1.000000 12 | v -1.000000 1.000000 -1.000000 13 | usemtl Material 14 | s off 15 | f 1 2 3 4 16 | f 5 8 7 6 17 | f 1 5 6 2 18 | f 2 6 7 3 19 | f 3 7 8 4 20 | f 5 1 4 8 21 | -------------------------------------------------------------------------------- /examples/curs.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import curses 3 | import time 4 | 5 | if __name__ == "__main__": 6 | s = curses.initscr() 7 | curses.cbreak() 8 | s.addstr(10,10,"Hello world") 9 | 10 | s.keypad(1) 11 | 12 | key ='' 13 | 14 | while (key!=ord('q')): 15 | key = s.getkey() 16 | s.addstr(30,30,time.ctime()) 17 | s.refresh() 18 | 19 | curses.endwin() 20 | -------------------------------------------------------------------------------- /examples/demo.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/examples/demo.pyc -------------------------------------------------------------------------------- /examples/doc1.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | 3 | if __name__ == '__main__': 4 | main = fb.Surface() 5 | 6 | sub = fb.Surface((0,0),(800,100)) 7 | 8 | sub.clear() 9 | 10 | sub.pixelstyle.color = fb.Color(40,40,40,255) 11 | sub.fillrect((0.0, 0.0),(1.0,1.0)) 12 | 13 | sub.pixelstyle = fb.Pixelstyles.sharp 14 | sub.pixelstyle.color = fb.Colors.darkgrey 15 | 16 | sub.printxy((10,10),"Drawing in the framebuffer is fun!",2) 17 | #sub.line((0,35),(800,35)) 18 | 19 | sub.pixelstyle = fb.Pixelstyles.faint 20 | sub.pixelstyle.blur = 2 21 | sub.pixelstyle.blurradius = 8 22 | sub.pixelstyle.sigma = 4 23 | sub.pixelstyle.color = fb.Color(2,2,2,200) 24 | sub.printxy((10,10+24+3),"Drawing in the framebuffer is fun!",2) 25 | sub.grabsilent("../Doc/source/images/test.png") 26 | 27 | main.close() 28 | 29 | -------------------------------------------------------------------------------- /examples/drawover.py: -------------------------------------------------------------------------------- 1 | #test drawing while keeping background... 2 | import fbpy.fb as fb 3 | import time 4 | 5 | if __name__ == "__main__": 6 | main = fb.Surface() 7 | 8 | window = fb.Surface((100,100),(400,400)) 9 | 10 | window.store() 11 | 12 | for r in range(0,100): 13 | window.clear() 14 | window.restore() 15 | window.circle((0.5,0.5),r/200.0,100, fb.Colors.grey, fb.Styles.solid) 16 | window.update() 17 | time.sleep(0.01) 18 | 19 | fb.Surface.close() 20 | -------------------------------------------------------------------------------- /examples/grab.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | 4 | class Flashtext(object): 5 | 6 | def __init__(self, tekst, surface): 7 | self.tekst = tekst 8 | self.surface = surface 9 | 10 | 11 | def grababunch(self): 12 | for i in range(30): 13 | self.surface.grabsequence("/dev/shm/tmp/test") 14 | 15 | def draw(self): 16 | N=25 17 | 18 | self.snow() 19 | 20 | for i in range(N): 21 | self.surface.clear() 22 | self.surface.printxy((300,300),self.tekst, fb.Color(60,60,i,0), fb.Colors.black, 2) 23 | self.surface.update() 24 | self.surface.focus = N-i-1 25 | 26 | self.surface.grabsequence("/dev/shm/tmp/test") 27 | 28 | self.grababunch() 29 | 30 | for i in range(N): 31 | self.surface.clear() 32 | self.surface.printxy((300,300),self.tekst, fb.Color(0,50-2*i,50-2*i,0), fb.Colors.black, 2) 33 | self.surface.update() 34 | self.surface.focus = i 35 | 36 | self.surface.grabsequence("/dev/shm/tmp/test") 37 | 38 | def snow(self): 39 | self.surface.focus = 1 40 | for i in range(10): 41 | self.surface.clear() 42 | self.surface.snow() 43 | self.surface.update() 44 | 45 | self.surface.grabsequence("/dev/shm/tmp/test") 46 | 47 | self.surface.focus = 25 48 | 49 | if __name__ == '__main__': 50 | win = fb.Surface() 51 | 52 | N = 25 53 | 54 | win.clear() 55 | win.blur = 2 56 | win.focus = N 57 | 58 | flash = Flashtext("Hello world!!!", win) 59 | flash.draw() 60 | flash.tekst = "from fbpy..." 61 | flash.draw() 62 | flash.tekst = "the new Python framebuffer module for linux" 63 | flash.draw() 64 | flash.tekst = "by Noisegate (c) 2014..." 65 | flash.draw() 66 | 67 | s=raw_input() 68 | 69 | win.close() 70 | 71 | -------------------------------------------------------------------------------- /examples/grid0.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /examples/informdriver.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import pdb 3 | 4 | if __name__ == '__main__': 5 | main = fb.Surface() 6 | sub = fb.Surface((100,100),(100,100)) 7 | pdb.set_trace() 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/models.txt: -------------------------------------------------------------------------------- 1 | http://www.sharecg.com/v/33487/gallery/11/Poser/Cylon-PC 2 | http://www.sharecg.com/v/66446/view/11/Poser/TOS-cylon-Raider 3 | 4 | -------------------------------------------------------------------------------- /examples/n: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/piclockdemo.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | 4 | class Clock(object): 5 | 6 | def __init__(self): 7 | self.win = fb.Surface() 8 | self.cwin = fb.Surface((10,10),(600,100)) 9 | self.win.clear() 10 | self.win.printxy((0.5,0.9),"fb python iface by Noisegate 2014",1) 11 | self.cwin.clear() 12 | self.win.update() 13 | self.cwin.update() 14 | 15 | def start(self): 16 | while True: 17 | self.cwin.clear() 18 | self.cwin.printxy((0,0),time.ctime(),2) 19 | self.cwin.update() 20 | time.sleep(1) 21 | 22 | if __name__ == "__main__": 23 | myclock = Clock() 24 | myclock.start() 25 | 26 | -------------------------------------------------------------------------------- /examples/pisphere.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | from fbpy.obj import Ddd 3 | import numpy as np 4 | import time 5 | 6 | if __name__ == '__main__': 7 | 8 | main = fb.Surface() 9 | sub = fb.Surface((1,1),(679,479)) 10 | sub.pixelstyle.color = fb.Color(10,40,10,0) 11 | sub.pixelstyle.style = fb.Styles.solid 12 | sub.pixelstyle.blur=1 13 | sfeer = Ddd('./sphere0.obj',200) 14 | sfeer.open() 15 | spacecraft = fb.DDDObject(sfeer.x, sfeer.y, sfeer.z,sub) 16 | sub.dddtrafo.ex=-250 17 | sub.dddtrafo.ey=-250 18 | sub.dddtrafo.tetax=0.0 19 | sub.dddtrafo.tetay=0.0 20 | sub.dddtrafo.ez=155 21 | sub.dddtrafo.cz=400 22 | #camera 23 | 24 | for i in np.arange(0,6*np.pi,0.01): 25 | sub.dddtrafo.tetax = i*3 26 | sub.dddtrafo.ctetay = -(i) 27 | sub.dddtrafo.cx = -450*np.sin(i) 28 | sub.dddtrafo.cz = 450*np.cos(i) 29 | sub.dddtrafo.cy = 180 30 | sub.clear() 31 | spacecraft.draw() 32 | sub.update() 33 | #sub.grabsequence('/dev/shm/voyager') 34 | time.sleep(0.001) 35 | 36 | -------------------------------------------------------------------------------- /examples/pitesthigh.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import numpy as np 3 | import time 4 | 5 | if __name__ == '__main__': 6 | 7 | win = fb.Surface() 8 | win.clear() 9 | win.update() 10 | subwin2 = fb.Surface((10,200),(200,200)) 11 | subwin3 = fb.Surface((300,200),(200,200)) 12 | subwin4 = fb.Surface((110,100),(600,24)) 13 | graticule = fb.Surface((200,200),(200,200)) 14 | graticule.clear() 15 | graticule.pixelstyle.colors = fb.Color(40,40,40,0) 16 | graticule.pixelstyle.color = fb.Colors.darkgrey 17 | graticule.fillrect((0.0,0.0),(1.0,1.0)) 18 | graticule.pixelstyle.color = fb.Colors.grey 19 | graticule.graticule((0.0,0.0),(1.0,1.0)) 20 | sprite = graticule.get_raw() 21 | backgrnd = subwin4.get_raw() 22 | 23 | subwin3.pixelstyle.blur = 2 24 | subwin3.pixelstyle.blurradius = 2 25 | subwin3.pixelstyle.sigma = 2 26 | subwin3.pixelstyle.color = fb.Color(10,30,30,100) 27 | 28 | for j in range(1): 29 | t = np.arange(0, 1, 0.01, dtype=np.float) 30 | x = np.cos(2*t*2*np.pi)*0.5+0.5 31 | for i in range(600): 32 | subwin3.clear() 33 | subwin2.clear() 34 | subwin4.clear() 35 | subwin2.set_raw(sprite) 36 | subwin3.set_raw(sprite) 37 | subwin4.set_raw(backgrnd) 38 | subwin3.pixelstyle.sigma=1 39 | subwin3.printxy((0,0),"Phase:{0}".format(i*0.03), 1) 40 | subwin4.printxy((2+i,2),time.ctime(), 2) 41 | y = np.sin(3*t*2*np.pi-(i*0.03))*0.5+0.5 42 | subwin2.set_dotstyle(2,1) 43 | subwin2.poly(x, y) 44 | subwin2.set_dotstyle(0,1) 45 | subwin3.set_dotstyle(2, 1) 46 | subwin3.pixelstyle.sigma=2 47 | subwin3.poly(t, y) 48 | subwin3.set_dotstyle(0, 1) 49 | 50 | subwin4.update() 51 | subwin3.update() 52 | subwin2.update() 53 | time.sleep(.001) 54 | #subwin3.grabsequence("/dev/shm/test") 55 | 56 | s = raw_input() 57 | 58 | fb.Surface.close() 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /examples/polys.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import fbpy.svg as svg 3 | import numpy as np 4 | 5 | if __name__ == '__main__': 6 | main = fb.Surface() 7 | win = fb.Surface((00,00),(1300,400)) 8 | win.pixelstyle = fb.Pixelstyles.faint 9 | win.pixelstyle.blurradius = 4 10 | win.pixelstyle.color = fb.Color(0,40,0,100) 11 | textl1 = svg.Text((10,10),"TESTING FBPY V 0_1;",1.5,win) 12 | textl2 = svg.Text((10,32),"THIS IS WHAT IT LOOKS LIKE :)",1.5,win) 13 | textl3 = svg.Text((10,54),"(DO NEED SOME WORK ON THE CHAR GEN ##)",1.5,win) 14 | textl4 = svg.Text((10,76),"$OTHERWISE QUIET FUNCTIONAL$",1.5,win) 15 | textl5 = svg.Text((10,98),"2014_JUN",1.5,win) 16 | textl6 = svg.Text((10,132),"NOISEGATE IS HAVING A BLAST",1.5,win) 17 | 18 | win.clear() 19 | s = raw_input() 20 | fb.Surface.close() 21 | 22 | -------------------------------------------------------------------------------- /examples/primitives.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/examples/primitives.png -------------------------------------------------------------------------------- /examples/primitives.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | from fbpy.obj import Ddd 3 | import numpy as np 4 | import time 5 | 6 | if __name__ == '__main__': 7 | 8 | main = fb.Surface() 9 | sub = fb.Surface((400,200),(500,500)) 10 | sub.pixelstyle.color = fb.Color(10,40,10,0) 11 | sub.pixelstyle.style = fb.Styles.solid 12 | sub.pixelstyle.blur=1 13 | 14 | objdata = Ddd('./grid0.obj',100) 15 | objdata.open() 16 | grid = fb.DDDObject(objdata.x, objdata.y,objdata.z, sub) 17 | grid.tetax = 0 18 | grid.tetay = 0 19 | grid.tetaz = 0 20 | grid.dx = 00 21 | grid.dy = 0 22 | grid.dz = 0 23 | objdata = Ddd('./cube0.obj',100) 24 | objdata.open() 25 | cube = fb.DDDObject(objdata.x,objdata.y,objdata.z,sub) 26 | cube.dx=200 27 | cube.tetay=1.2 28 | cube.dy = 150 29 | objdata = Ddd('./sphere0.obj',100) 30 | objdata.open() 31 | sphere = fb.DDDObject(objdata.x,objdata.y,objdata.z,sub) 32 | sphere.dx=200 33 | sphere.tetay=0.2 34 | sphere.dy = 350 35 | objdata = Ddd('./cone0.obj',100) 36 | objdata.open() 37 | cone = fb.DDDObject(objdata.x,objdata.y,objdata.z,sub) 38 | cone.dx=100 39 | cone.tetay=1.6 40 | cone.dy = 150 41 | 42 | sub.dddtrafo.ex=-250 43 | sub.dddtrafo.ey=-250 44 | sub.dddtrafo.tetax=0.0 45 | sub.dddtrafo.tetay=0.0 46 | sub.dddtrafo.ez=155 47 | sub.dddtrafo.cy=180 48 | sub.dddtrafo.cz=400 49 | 50 | #camera 51 | 52 | for i in np.arange(0,6*np.pi,0.01): 53 | #sub.dddtrafo.tetax = i*3 54 | sub.dddtrafo.ctetay = -(i) 55 | sub.dddtrafo.cx = -450*np.sin(i) 56 | sub.dddtrafo.cz = 450*np.cos(i) 57 | sub.dddtrafo.cy = 180 58 | sub.clear() 59 | sub.pixelstyle.color = fb.Color(10,40,10,0) 60 | grid.draw() 61 | cube.draw() 62 | sphere.draw() 63 | cone.draw() 64 | sub.update() 65 | #sub.grabsequence('/dev/shm/voyager') 66 | time.sleep(0.01) 67 | 68 | 69 | -------------------------------------------------------------------------------- /examples/raider.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 3 3 | 4 | newmtl Cylon_Raider_classic_black 5 | Ns 96.078431 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ni 1.000000 10 | d 1.000000 11 | illum 2 12 | 13 | newmtl Cylon_Raider_classic_engine 14 | Ns 96.078431 15 | Ka 0.000000 0.000000 0.000000 16 | Kd 0.640000 0.640000 0.640000 17 | Ks 0.500000 0.500000 0.500000 18 | Ni 1.000000 19 | d 1.000000 20 | illum 2 21 | 22 | newmtl Cylon_Raider_classic_hull 23 | Ns 96.078431 24 | Ka 0.000000 0.000000 0.000000 25 | Kd 0.640000 0.640000 0.640000 26 | Ks 0.500000 0.500000 0.500000 27 | Ni 1.000000 28 | d 1.000000 29 | illum 2 30 | -------------------------------------------------------------------------------- /examples/readpng.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | 3 | if __name__ == '__main__': 4 | 5 | main = fb.Surface() 6 | 7 | main.clear() 8 | main.blit("./cylon.png") 9 | 10 | main.pixelstyle.color = fb.Color(40,40,60,100) 11 | main.pixelstyle.blur=2 12 | main.pixelstyle.blurradius=4 13 | main.pixelstyle.sigma=1 14 | 15 | main.printxy((0.3,0.5),"fbpy: by your command...",2) 16 | main.update() 17 | 18 | main.grab("byyrcmnd.png") 19 | 20 | fb.Surface.close() 21 | 22 | s = raw_input() 23 | -------------------------------------------------------------------------------- /examples/scaledornot.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | 3 | #In this example I show the abilty of surface 4 | #gemoetries to accept scaled coordinates and 5 | #absolute coordinates, or a combination. 6 | 7 | 8 | 9 | if __name__ == "__main__": 10 | main = fb.Surface() 11 | 12 | #make a subwindow 13 | window = fb.Surface((400,400),(200,200)) 14 | 15 | #show it 16 | window.clear() 17 | window.rect((0.0, 0.0),(1.0,1.0), fb.Colors.white, fb.Styles.solid) 18 | window.update() 19 | 20 | #now we want to draw an inner rect precicely 21 | #two pixels away from the outer. 22 | #scaled coordinates are not so convenient for 23 | #this purpose... 24 | window.rect((2,2),(197,197), fb.Colors.white, fb.Styles.solid) 25 | window.update() 26 | 27 | #using integers will tell the Surface object 28 | #we want to use pixel coordinates 29 | #floats will invoke the automatic scaler... 30 | 31 | s = raw_input("hit enter to close") 32 | 33 | fb.Surface.close() 34 | -------------------------------------------------------------------------------- /examples/scope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/examples/scope.png -------------------------------------------------------------------------------- /examples/scope.py: -------------------------------------------------------------------------------- 1 | import fbpy.audioscope as audioscope 2 | import fbpy.fb as fb 3 | 4 | if __name__ == '__main__': 5 | main = fb.Surface() 6 | scope = audioscope.Scope((800,10),(350,350)) 7 | 8 | -------------------------------------------------------------------------------- /examples/scope2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/examples/scope2.png -------------------------------------------------------------------------------- /examples/scopedemo.py: -------------------------------------------------------------------------------- 1 | import fbpy.audioscope as audioscope 2 | import fbpy.fb as fb 3 | 4 | if __name__ == '__main__': 5 | main = fb.Surface() 6 | scope = audioscope.Scope((800,10),(350,350)) 7 | scope.start() 8 | 9 | -------------------------------------------------------------------------------- /examples/scopedemorasp.py: -------------------------------------------------------------------------------- 1 | import fbpy.audioscope as audioscope 2 | import fbpy.fb as fb 3 | 4 | if __name__ == '__main__': 5 | main = fb.Surface() 6 | scope = audioscope.Scope((10,10),(300,200)) 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/snow.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | 4 | main = fb.Surface() 5 | win = fb.Surface((100,100),(300,200)) 6 | win.pixelstyle = fb.Pixelstyles.faint 7 | win.pixelstyle.sigma = 2 8 | win.pixelstyle.color.r = 3 9 | win.pixelstyle.color.g = 3 10 | win.pixelstyle.color.b = 3 11 | 12 | for i in range(30): 13 | win.clear() 14 | print win.winsize 15 | win.snow() 16 | win.update() 17 | win.grabsequence("/dev/shm/snow") 18 | 19 | s=raw_input() 20 | 21 | main.close() 22 | win.close() 23 | -------------------------------------------------------------------------------- /examples/sphere.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /examples/sphere.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | from fbpy.obj import Ddd 3 | import numpy as np 4 | import time 5 | 6 | if __name__ == '__main__': 7 | 8 | main = fb.Surface() 9 | sub = fb.Surface((1,1),(270,270)) 10 | sub.pixelstyle.color = fb.Color(10,40,10,0) 11 | sub.pixelstyle.style = fb.Styles.solid 12 | sub.pixelstyle.blur=1 13 | print "1" 14 | sfeer = Ddd('./raider2.obj',30) 15 | sfeer.open() 16 | print "2" 17 | spacecraft = fb.DDDObject(sfeer.x, sfeer.y, sfeer.z,sub) 18 | sub.dddtrafo.ex=-250 19 | sub.dddtrafo.ey=-250 20 | sub.dddtrafo.tetax=0.0 21 | sub.dddtrafo.tetay=0.0 22 | sub.dddtrafo.ez=155 23 | sub.dddtrafo.cz=400 24 | #camera 25 | print "3" 26 | 27 | for i in np.arange(0,6*np.pi,0.01): 28 | sub.dddtrafo.tetax = i*3 29 | sub.dddtrafo.ctetay = -(i) 30 | sub.dddtrafo.cx = -450*np.sin(i) 31 | sub.dddtrafo.cz = 450*np.cos(i) 32 | sub.dddtrafo.cy = 180 33 | sub.clear() 34 | spacecraft.draw() 35 | sub.update() 36 | #sub.grabsequence('/dev/shm/voyager') 37 | time.sleep(0.001) 38 | 39 | -------------------------------------------------------------------------------- /examples/sphere0.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /examples/sphererasp.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | from fbpy.obj import Ddd 3 | import numpy as np 4 | import time 5 | 6 | if __name__ == '__main__': 7 | 8 | main = fb.Surface() 9 | sub = fb.Surface((1,1),(270,270)) 10 | sub.pixelstyle.color = fb.Color(10,40,10,100) 11 | sub.pixelstyle.style = fb.Styles.solid 12 | sub.pixelstyle.blur=1 13 | print "1" 14 | sfeer = Ddd('./sphere.obj',30) 15 | sfeer.open() 16 | print "2" 17 | spacecraft = fb.DDDObject(sfeer.x, sfeer.y, sfeer.z,sub) 18 | sub.dddtrafo.ex=-25 19 | sub.dddtrafo.ey=-25 20 | sub.dddtrafo.tetax=0.0 21 | sub.dddtrafo.tetay=0.0 22 | sub.dddtrafo.ez=155 23 | sub.dddtrafo.cz=40 24 | #camera 25 | print "3" 26 | 27 | for i in np.arange(0,6*np.pi,0.01): 28 | sub.dddtrafo.tetax = i*3 29 | sub.dddtrafo.ctetay = -(i) 30 | sub.dddtrafo.cx = -45*np.sin(i) 31 | sub.dddtrafo.cz = 45*np.cos(i) 32 | sub.dddtrafo.cy = 18 33 | sub.clear() 34 | spacecraft.draw() 35 | sub.update() 36 | #sub.grabsequence('/dev/shm/voyager') 37 | time.sleep(0.001) 38 | 39 | -------------------------------------------------------------------------------- /examples/sysinfo.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | import subprocess 4 | 5 | #just a demo of some cool stuff 6 | #you can do with the framebuffer library 7 | 8 | class Systeminfo(object): 9 | 10 | def __init__(self): 11 | self.temp1 =-1 12 | self.temp2 =-1 13 | self.uptime = -1 14 | 15 | def update(self): 16 | temp = subprocess.check_output(['sensors']) 17 | uptime = subprocess.check_output(['uptime']) 18 | dummy = temp.splitlines() 19 | 20 | self.temp1 = dummy[2] 21 | self.temp2 = dummy[3] 22 | 23 | dummy = uptime.split(",") 24 | self.uptime = ".".join([dummy[-3], dummy[-2], dummy[-1]]) 25 | 26 | return 0 27 | 28 | if __name__ == "__main__": 29 | 30 | systeminfo = Systeminfo() 31 | main = fb.Surface() 32 | win = fb.Surface((main.width-300,0),(300,42)) 33 | 34 | while(True): 35 | grey = fb.Colors.grey 36 | darkgrey = fb.Colors.darkgrey 37 | grey.alpha = 100 38 | darkgrey.alpha = 4 39 | 40 | try: 41 | win.clear() 42 | win.printxy((2,2),time.ctime(), 1) 43 | 44 | systeminfo.update() 45 | 46 | win.printxy((2,12), systeminfo.temp1, 1) 47 | win.printxy((2,22), systeminfo.temp2, 1) 48 | 49 | win.printxy((2,32), systeminfo.uptime, 1) 50 | 51 | win.rect((0.0,0.0),(1.0,1.0)) 52 | 53 | win.update() 54 | 55 | time.sleep(1) 56 | 57 | 58 | except (KeyboardInterrupt, SystemExit): 59 | fb.Surface.close() 60 | print "exitted correctly..." 61 | 62 | -------------------------------------------------------------------------------- /examples/test.old.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 17 | 20 | 23 | 26 | 27 | 29 | 30 | 32 | image/svg+xml 33 | 35 | 36 | 37 | 38 | 39 | 43 | 47 | 51 | 55 | 56 | -------------------------------------------------------------------------------- /examples/test.sh: -------------------------------------------------------------------------------- 1 | clear 2 | python ./testhigh.py > /dev/null 3 | 4 | -------------------------------------------------------------------------------- /examples/testhigh.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import numpy as np 3 | import time 4 | 5 | if __name__ == '__main__': 6 | 7 | win = fb.Surface() 8 | win.clear() 9 | #win.fillrect((1,1),(1365,767)) 10 | win.update() 11 | subwin = fb.Surface((10,10),(300,300)) 12 | subwin2 = fb.Surface((400,400),(200,200)) 13 | subwin3 = fb.Surface((800,400),(200,200)) 14 | subwin4 = fb.Surface((410,100),(800,24)) 15 | #subwin.fillrect((0,0,0,0),(1.0,1.0)) 16 | backgrnd0 = subwin.get_raw() 17 | subwin.update() 18 | graticule = fb.Surface((400,400),(200,200)) 19 | graticule.clear() 20 | graticule.pixelstyle.colors = fb.Color(40,40,40,0) 21 | graticule.pixelstyle.color = fb.Colors.darkgrey 22 | graticule.fillrect((0.0,0.0),(1.0,1.0)) 23 | graticule.pixelstyle.color = fb.Colors.grey 24 | graticule.graticule((0.0,0.0),(1.0,1.0)) 25 | sprite = graticule.get_raw() 26 | #subwin4.fillrect((0.0,0.0),(1.0,1.0)) 27 | backgrnd = subwin4.get_raw() 28 | 29 | subwin3.pixelstyle.blur = 2 30 | subwin3.pixelstyle.blurradius = 2 31 | subwin3.pixelstyle.sigma = 2 32 | subwin3.pixelstyle.color = fb.Color(10,30,30,100) 33 | subwin.pixelstyle.blur = 0 34 | subwin.pixelstyle.blurradius = 7 35 | subwin.pixelstyle.sigma = 3 36 | subwin.pixelstyle.color = fb.Colors.magenta 37 | 38 | 39 | for j in range(1): 40 | t = np.arange(0, 1, 0.01, dtype=np.float) 41 | x = np.cos(2*t*2*np.pi)*0.5+0.5 42 | for i in range(600): 43 | subwin3.clear() 44 | subwin2.clear() 45 | subwin.clear() 46 | subwin4.clear() 47 | subwin2.set_raw(sprite) 48 | subwin3.set_raw(sprite) 49 | subwin4.set_raw(backgrnd) 50 | subwin.set_raw(backgrnd0) 51 | subwin3.pixelstyle.sigma=1 52 | subwin3.printxy((0,0),"Phase:{0}".format(i*0.03), 1) 53 | subwin4.printxy((2+i,2),time.ctime(), 2) 54 | y = np.sin(3*t*2*np.pi-(i*0.03))*0.5+0.5 55 | subwin2.set_dotstyle(2,1) 56 | subwin2.poly(x, y) 57 | subwin2.set_dotstyle(0,1) 58 | subwin3.set_dotstyle(2, 1) 59 | subwin3.pixelstyle.sigma=2 60 | subwin3.poly(t, y) 61 | subwin3.set_dotstyle(0, 1) 62 | subwin.rect((0.0,0.0),(1.0,1.0)) 63 | subwin.arc((0.5,0.5),np.sin(np.pi*i/300.0),np.sin(np.pi*i/300.0),0, 100, 100) 64 | 65 | subwin4.update() 66 | subwin3.update() 67 | subwin2.update() 68 | subwin.update() 69 | time.sleep(.01) 70 | #subwin3.grabsequence("/dev/shm/test") 71 | 72 | s = raw_input() 73 | 74 | fb.Surface.close() 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /examples/testsprite.py: -------------------------------------------------------------------------------- 1 | import fbpy.sprite 2 | import fbpy.fb as fb 3 | import numpy as np 4 | import time 5 | 6 | if __name__ == "__main__": 7 | 8 | #need it, else sprite will give typerror 9 | main = fb.Surface() 10 | 11 | timew = fb.Surface((0,0),(300,10)) 12 | 13 | sprite = fbpy.sprite.Sprite((0,0),(150,157)) 14 | sprite.surface.clear() 15 | sprite.surface.blit("./fighter_viper_mk1small.png") 16 | sprite.save() 17 | for i in range(160): 18 | 19 | sprite.surface.clear() 20 | sprite.surface.blit("./fighter_viper_mk1small.png") 21 | sprite.surface.trafo.identity() 22 | sprite.surface.trafo.rotate(6.28/160.0*i) 23 | sprite.surface.styledredraw() 24 | sprite.save() 25 | 26 | main.keepbackground() 27 | main.blit("./stars.png") 28 | main.update() 29 | 30 | tnull = time.time() 31 | #make it move and debug 32 | counter = 0 33 | nom=0 34 | for j in range(3): 35 | for i in range(0,301,1): 36 | t0 = time.time() 37 | 38 | t = i/300.0*2*np.pi 39 | x = -200*np.cos(t)+600 40 | y = 20*np.sin(t)+300 41 | 42 | nom = int(i/300.0*160) 43 | sprite.moveto((x,y), nom) 44 | 45 | counter +=1 46 | 47 | if not (counter % 50): 48 | timew.clear() 49 | timew.printxy((3,3),"runtime = {0} s".format(time.time()-tnull),1) 50 | timew.update() 51 | 52 | while((time.time()-t0)<0.005): 53 | pass 54 | ra = [700] 55 | ra.extend(range(350,-200,-1)) 56 | ra.extend(range(800,1366,1)) 57 | for i in ra: 58 | sprite.moveto((i,300),1) 59 | time.sleep(0.001) 60 | ra = [300] 61 | ra.extend(range(300,-100,-1)) 62 | ra.extend(range(300,766,1)) 63 | for i in ra: 64 | sprite.moveto((400,i),1) 65 | time.sleep(0.001) 66 | ra = [400] 67 | ra.extend(range(400,-2,-1)) 68 | for i in ra: 69 | sprite.moveto((1366-i,768-i),1) 70 | time.sleep(0.001) 71 | ra = [400] 72 | ra.extend(range(400,-200,-1)) 73 | for i in ra: 74 | sprite.moveto((i,i),1) 75 | time.sleep(0.001) 76 | ra = [400] 77 | ra.extend(range(400,-200,-1)) 78 | for i in ra: 79 | sprite.moveto((1366-i,i-157),1) 80 | time.sleep(0.001) 81 | ra = [400] 82 | ra.extend(range(400,-200,-1)) 83 | for i in ra: 84 | sprite.moveto((i-150,-i+768),1) 85 | time.sleep(0.001) 86 | 87 | 88 | sprite.hide() 89 | -------------------------------------------------------------------------------- /examples/transform.py: -------------------------------------------------------------------------------- 1 | import fbpy.fb as fb 2 | import time 3 | 4 | if __name__ == '__main__': 5 | 6 | main = fb.Surface() 7 | 8 | sub = fb.Surface((300,300),(400,400)) 9 | 10 | R = fb.Trafo() 11 | S = fb.Trafo() 12 | 13 | sub.trafo.stretch(0.05,0.05) 14 | R.rotate(0.08) 15 | S.stretch(1.02,1.02) 16 | 17 | for i in range(1,1200): 18 | 19 | sub.clear() 20 | 21 | sub.trafo*=R 22 | if i<200: 23 | sub.trafo*=S 24 | 25 | if i==1199: 26 | sub.trafo.identity() 27 | 28 | sub.rect((0.4,0.4),(0.6,0.6)) 29 | sub.printxy((.4,0.5),"hahahahihi",1) 30 | sub.arc((0.5,0.5),60,40,0,100,100) 31 | sub.update() 32 | time.sleep(0.01) 33 | #sub.grabsequence("/dev/shm/rot") 34 | 35 | -------------------------------------------------------------------------------- /fbpy/__init__.py: -------------------------------------------------------------------------------- 1 | #import fb 2 | -------------------------------------------------------------------------------- /fbpy/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/__init__.pyc -------------------------------------------------------------------------------- /fbpy/audioscope.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/audioscope.pyc -------------------------------------------------------------------------------- /fbpy/fb.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/fb.pyc -------------------------------------------------------------------------------- /fbpy/jack.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # untitled.py 5 | # 6 | # Copyright 2014 marcell 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 21 | # MA 02110-1301, USA. 22 | import fblib 23 | import numpy as np 24 | 25 | class Jackaudio(object): 26 | 27 | def __init__(self): 28 | audio = np.zeros(1024) 29 | self.dataL = np.array(audio, dtype=np.float64) 30 | self.dataR = np.array(audio, dtype=np.float64) 31 | 32 | def jackon(self): 33 | r=fblib.fbjackon() 34 | if r==-1: 35 | print ("SORRY: only one instance allowed at the moment") 36 | print ("Hey, this is pre-alpha...") 37 | return -1 38 | 39 | def jackoff(self): 40 | fblib.fbjackoff() 41 | 42 | def jackread(self): 43 | fblib.fbreadjack(self.dataL, self.dataR) 44 | 45 | @property 46 | def channels(self): 47 | self.jackread() 48 | return (self.dataL, self.dataR) 49 | 50 | if __name__ == '__main__': 51 | pass 52 | -------------------------------------------------------------------------------- /fbpy/jack.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/jack.pyc -------------------------------------------------------------------------------- /fbpy/obj.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class Ddd(object): 4 | 5 | def __init__(self, filename, scale): 6 | self.filename = filename 7 | self.xcrds = [] 8 | self.ycrds = [] 9 | self.zcrds = [] 10 | self.x=[] 11 | self.y=[] 12 | self.z=[] 13 | self.scale = scale 14 | 15 | def open(self): 16 | 17 | f = open(self.filename,'r') 18 | 19 | lines = f.readlines() 20 | f.close() 21 | x=[] 22 | y=[] 23 | z=[] 24 | for i, l in enumerate(lines): 25 | if 'v ' in l: 26 | crd = l.strip('v') 27 | xyz = crd.split(' ') 28 | self.xcrds.append(self.scale*float(xyz[1])) 29 | self.ycrds.append(self.scale*float(xyz[2])) 30 | self.zcrds.append(self.scale*float(xyz[3])) 31 | 32 | for i, l in enumerate(lines): 33 | if 'f ' in l: 34 | poly = l.strip('f') 35 | indi = poly.split(' ') 36 | x=[] 37 | y=[] 38 | z=[] 39 | for j, index in enumerate(indi): 40 | try: 41 | iindex = int(index) 42 | x.append(self.xcrds[iindex-1]) 43 | y.append(self.ycrds[iindex-1]) 44 | z.append(self.zcrds[iindex-1]) 45 | 46 | except: 47 | pass 48 | x.append(x[0]) 49 | y.append(y[0]) 50 | z.append(z[0]) 51 | self.x.append(np.array(x,dtype=np.int32)) 52 | self.y.append(np.array(y,dtype=np.int32)) 53 | self.z.append(np.array(z,dtype=np.int32)) 54 | 55 | if __name__ == '__main__': 56 | 57 | instance = Ddd('../examples/sphere.obj',1) 58 | instance.open() 59 | print(instance.x) 60 | 61 | 62 | -------------------------------------------------------------------------------- /fbpy/sprite.py: -------------------------------------------------------------------------------- 1 | # * sprite.py module for pythons fbpy package. Draws sprites without 2 | # * using hw blitterzz 3 | # * Copyright (C) 2014 Marcell Marosvolgyi aka noisegate 4 | # * 5 | # * This program is free software; you can redistribute it and/or 6 | # * modify it under the terms of the GNU General Public License 7 | # * as published by the Free Software Foundation; either version 2 8 | # * of the License, or (at your option) any later version. 9 | # * 10 | # * This program is distributed in the hope that it will be useful, 11 | # * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # * GNU General Public License for more details. 14 | # * 15 | # * You should have received a copy of the GNU General Public License 16 | # * along with this program; if not, write to the Free Software 17 | # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # * 19 | # version: 0.1 20 | # profanities included 4 xtra powerimport fbpy.fb as fb 21 | 22 | import fbpy.fb as fb 23 | import copy 24 | import numpy as np 25 | import time 26 | 27 | class Needmain(type): 28 | """ 29 | Dont instantiate the sprite if 30 | there is no main surface. 31 | 32 | 33 | """ 34 | def __call__(self, *args, **kwargs): 35 | if fb.Surface.isalive(): 36 | return super(Needmain, self).__call__(*args, **kwargs) 37 | else: 38 | raise TypeError("Need main surface") 39 | 40 | class Sprite(object): 41 | """ 42 | A drawing surface, which can be moved around 43 | without destructing the background. 44 | 45 | Full example: 46 | 47 | .. doctest:: 48 | >>> import fbpy.fb 49 | 50 | >>> import fbpy.sprite 51 | 52 | 53 | 54 | """ 55 | 56 | __metaclass__ = Needmain 57 | 58 | def __init__(self, x_y, w_h): 59 | x,y = x_y 60 | w,h = w_h 61 | self.surface = fb.Surface((x,y),(w,h)) 62 | self.backgr = fb.Surface((x,y),(w,h)) 63 | self.newstamp = None 64 | self.spritedata = [] 65 | self.oldR = (x,y) 66 | self.R = (x,y) 67 | self.backgr.keepbackground() 68 | self.oldstamp = self.backgr.get_raw() 69 | #self.oldstamp = np.zeros(w*h*4,dtype=np.int8) 70 | 71 | 72 | def moveto(self, R, sprite_no): 73 | """ 74 | move to new position using 75 | FTL drive 76 | it jumps. for smooth moves, fast 77 | a low level iface will be implemented 78 | 79 | moveto(, sprite_nr) 80 | """ 81 | 82 | self.R = R 83 | 84 | self.surface.origo = self.R 85 | res = self.surface.overlay(self.oldstamp,self.spritedata[sprite_no], self.oldR[0], self.oldR[1], 1) 86 | 87 | if res == 0 : self.oldR = self.R 88 | 89 | def save(self): 90 | """ 91 | save current surface to list 92 | """ 93 | self.spritedata.append(self.surface.get_raw()) 94 | 95 | def hide(self): 96 | """ 97 | hide this sprite 98 | 99 | """ 100 | self.surface.overlay(self.oldstamp,self.spritedata[0], self.oldR[0],self.oldR[1], 0) 101 | 102 | @property 103 | def x(self): 104 | return self.surface.origo[0] 105 | 106 | @x.setter 107 | def x(self,x): 108 | temp = self.surface.origo 109 | temp = (x, temp[0]) 110 | 111 | @property 112 | def y(self): 113 | return self.surface.origo[1] 114 | 115 | @y.setter 116 | def y(self,y): 117 | temp = self.surface.origo 118 | temp = (y, temp[1]) 119 | 120 | def redraw(self): 121 | pass 122 | 123 | if __name__ == '__main__': 124 | main = fb.Surface() 125 | 126 | sprite = Sprite((10,10),(100,100)) 127 | sprite.surface.clear() 128 | sprite.surface.line((0,0),(100,100)) 129 | sprite.moveto(20,20) 130 | 131 | fb.Surface.close() 132 | 133 | -------------------------------------------------------------------------------- /fbpy/sprite.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/sprite.pyc -------------------------------------------------------------------------------- /fbpy/svg.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/svg.pyc -------------------------------------------------------------------------------- /fbpy/utils/.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/.swp -------------------------------------------------------------------------------- /fbpy/utils/Makefile: -------------------------------------------------------------------------------- 1 | all: fblib.so 2 | 3 | fblib.c: fblib.pyx 4 | cython fblib.pyx 5 | 6 | fbutils.o: fbutils.c fbutils.h font.h 7 | gcc -g -O2 -fpic -c fbutils.c -lm -lpng -o fbutils.o 8 | 9 | fblib.o: fblib.c 10 | gcc -g -O2 -fpic -c fblib.c -o fblib.o `python-config --cflags` 11 | 12 | fblib.so: fblib.o fbutils.o 13 | gcc -shared -o fblib.so fbutils.o fblib.o `python-config --libs` 14 | 15 | clean: 16 | rm fblib.so fblib.o fbutils.o fblib.c 17 | 18 | -------------------------------------------------------------------------------- /fbpy/utils/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Some docu here then... 3 | """ 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /fbpy/utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/__init__.pyc -------------------------------------------------------------------------------- /fbpy/utils/audio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * audio.h 3 | * 4 | * Copyright 2014 marcell 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 19 | * MA 02110-1301, USA. 20 | */ 21 | #ifndef __AUDIO_H__ 22 | #define __AUDIO_H__ 23 | 24 | #include 25 | 26 | jack_port_t *input_portL; 27 | jack_port_t *input_portR; 28 | jack_port_t *output_portL; 29 | jack_port_t *output_portR; 30 | jack_client_t *client; 31 | jack_default_audio_sample_t *OUTL; 32 | jack_default_audio_sample_t *OUTR; 33 | int nframez; 34 | int process (jack_nframes_t nframes, void *arg); 35 | void jack_shutdown (void *arg); 36 | int mainz(); 37 | 38 | #endif //__AUDIO_H__ 39 | -------------------------------------------------------------------------------- /fbpy/utils/fblib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/fblib.o -------------------------------------------------------------------------------- /fbpy/utils/fbutils.h: -------------------------------------------------------------------------------- 1 | #ifndef __FBUTILS_H__ 2 | #define __FBUTILS_H__ 3 | 4 | extern struct Color { 5 | unsigned char r; 6 | unsigned char g; 7 | unsigned char b; 8 | unsigned char a; 9 | }; 10 | 11 | extern struct Trafo { 12 | float m11; 13 | float m12; 14 | float m21; 15 | float m22; 16 | char unity; 17 | }; 18 | 19 | extern struct TrafoL { 20 | double tetax; 21 | double tetay; 22 | double tetaz; 23 | int dx; 24 | int dy; 25 | int dz; 26 | int *order; 27 | int numtrafos; 28 | }; 29 | 30 | extern struct Trafo3 { 31 | double tetax; 32 | double tetay; 33 | double tetaz; 34 | double ctetax; 35 | double ctetay; 36 | double ctetaz; 37 | double ex; 38 | double ey; 39 | double ez; 40 | double cx; 41 | double cy; 42 | double cz; 43 | }; 44 | 45 | extern int setup(void); 46 | extern int swappage(int i); 47 | extern int setblurrad(int r); 48 | extern int settrafo(struct Trafo *); 49 | extern int settrafo3(struct Trafo3 *); 50 | extern int settrafoL(double, double, double, int, int, int, int *, int); 51 | extern int setwinparams(int x, int y, int width, int height, 52 | unsigned char r, unsigned char g, unsigned char b, 53 | unsigned char a, 54 | unsigned char linestyle, 55 | int blur_, int blurrad, int sigma); 56 | extern int getwinparams(int *x, int *y, int *wi, int *he); 57 | extern int keepcurrent(); 58 | extern int clearbuffer(char *buffy); 59 | extern int cleartmpbuffer(); 60 | extern int clearscreen(); 61 | extern int update(void); 62 | extern int closefb(void); 63 | extern int get_pixel(int x, int y, struct Color* tmpclr, char *buffer); 64 | extern int kernel(); 65 | extern int plot(int x, int y); 66 | extern int plot_(int x, int y); 67 | extern int plotalpha_(int x, int y); 68 | extern int plotblurred_(int x, int y); 69 | extern int fillrect(int x0, int y0, int w, int h); 70 | extern int snow(); 71 | extern int matrixvec3(double m[9], int *x, int *y, int *z); 72 | extern int rotate(double angle, int *x, int *y, int *z, char direction); 73 | extern int project(int *x, int *y, int *z); 74 | extern int poly(int *x, int *y, int l); 75 | extern int poly3d(int *x, int *y, int *z, int l); 76 | extern int drawpolys(Polys *); 77 | extern int draw3dpolys(Polys *); 78 | extern int identity(int *, int *, int*); 79 | extern int translateX(int *x, int *y, int *z); 80 | extern int translateY(int *x, int *y, int *z); 81 | extern int translateZ(int *x, int *y, int *z); 82 | extern int rotateX(int *x, int *y, int *z); 83 | extern int rotateY(int *x, int *y, int *z); 84 | extern int rotateZ(int *x, int *y, int *z); 85 | //extern int transform3d(Polys *, struct TrafoL *, int *order, int numt); 86 | extern int memblockcpy(char *sprite, int l, char DIRECTION); 87 | extern int overlay(char *res_buf, char *sprite, int xo, int yo, char sprmode); 88 | extern int get_raw(char *sprite, int l); 89 | extern int set_raw(char *sprite, int l); 90 | extern int line(int x0, int y0, int x1, int y1); 91 | extern int arc(int x0, int y0, int r1, int r2, int startseg, int endseg, int segs); 92 | extern int circle(int x0, int y0, int r1, int segs); 93 | extern int printxy(int x0, int y0, char string[], int size_); 94 | extern int graticule(int x0, int y0, int w, int h); 95 | extern int getHeight(); 96 | extern int getWidth(); 97 | extern int styledredraw(); 98 | extern int helloworld (int x, int y); 99 | extern int read_PNG(char *filename); 100 | extern int write_PNG(char *filename, int interlace, char borfb); 101 | #endif //__FBUTILS_H__ 102 | -------------------------------------------------------------------------------- /fbpy/utils/fbutils.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/fbutils.o -------------------------------------------------------------------------------- /fbpy/utils/font.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/font.h -------------------------------------------------------------------------------- /fbpy/utils/print.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void main() 4 | { 5 | start: 6 | printf("Hello world!\n"); 7 | goto start; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /fbpy/utils/svg.py: -------------------------------------------------------------------------------- 1 | #http://stackoverflow.com/questions/15857818/python-svg-parser 2 | from xml.dom import minidom 3 | import re 4 | 5 | class Poly(object): 6 | 7 | def __init__(self): 8 | self.x = [] 9 | self.y = [] 10 | self.z = [] 11 | 12 | class Svg2Poly(object): 13 | 14 | def __init__(self, filename, layer): 15 | self.filename = filename 16 | self.path_strings = '' 17 | self.polys = [] 18 | self.layer = layer 19 | self.fetch() 20 | self.parse() 21 | 22 | def fetch(self): 23 | doc = minidom.parse("./test.svg") # parseString also exists 24 | self.path_strings = [path.getAttribute('d') for path in doc.getElementsByTagName('path')] 25 | doc.unlink() 26 | 27 | def parse(self): 28 | for i, l in enumerate(self.path_strings): 29 | print("Item {0}:".format(i)) 30 | self.polys.append(Poly()) 31 | currentpoly = self.polys[-1] 32 | crds = re.findall("([0-9]+(\.[0-9]+)?|\.[0-9]+),([0-9]+(\.[0-9]+)?|\.[0-9]+)", l) 33 | for j, m in enumerate(crds): 34 | print("Coordinate {0}".format(j), 35 | currentpoly.x.append(float(m[0])), 36 | currentpoly.y.append(float(m[2])), 37 | currentpoly.z.append(float(self.layer))) 38 | 39 | def report(self): 40 | s="" 41 | s+="svg poly container object\n" 42 | s+="file {0}\n".format(self.filename) 43 | s+="number of polys {0}\n".format(len(self.polys)) 44 | return s 45 | 46 | def __repr__(self): 47 | return self.report() 48 | 49 | def __str__(self): 50 | return self.report() 51 | 52 | 53 | if __name__ == '__main__': 54 | converter = Svg2Poly("./test.svg",1) 55 | print(converter) 56 | 57 | 58 | -------------------------------------------------------------------------------- /fbpy/utils/test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/test -------------------------------------------------------------------------------- /fbpy/utils/test.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_H__ 2 | #define __TEST_H__ 3 | 4 | typedef struct _Polys{ 5 | int **x; 6 | int **y; 7 | int **z; 8 | int *polyl; //length of each 9 | int polyc; //number of polies 10 | }; 11 | 12 | typedef struct _Polys Polys; 13 | 14 | FILE *debug; 15 | char dbgrdr; 16 | int visits; 17 | 18 | int addpoly(Polys *, int x[], int y[], int z[], int lenxy); 19 | int setpms(int dbgrdr_, int visits_); 20 | int delpolys(Polys *); 21 | 22 | #endif //__TEST_H__ 23 | -------------------------------------------------------------------------------- /fbpy/utils/test.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/fbpy/utils/test.o -------------------------------------------------------------------------------- /font/35.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 66 | 71 | 76 | 77 | -------------------------------------------------------------------------------- /font/36.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 66 | 71 | 72 | -------------------------------------------------------------------------------- /font/40.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | -------------------------------------------------------------------------------- /font/41.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | -------------------------------------------------------------------------------- /font/45.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | -------------------------------------------------------------------------------- /font/54.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/55.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/56.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/57.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/58.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 66 | 67 | -------------------------------------------------------------------------------- /font/59.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 62 | 68 | 69 | -------------------------------------------------------------------------------- /font/64.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 66 | 67 | -------------------------------------------------------------------------------- /font/65.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /font/66.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /font/67.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/68.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/69.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 59 | 69 | 79 | 83 | 86 | 92 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /font/70.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /font/71.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/72.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 66 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /font/73.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/74.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/75.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 66 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /font/76.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/77.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/78.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/79.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/80.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/81.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /font/82.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 16 | 18 | 19 | 21 | image/svg+xml 22 | 24 | 25 | 26 | 27 | 28 | 31 | 41 | 51 | 55 | 58 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /font/90.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 41 | 48 | 49 | 51 | 53 | 54 | 56 | image/svg+xml 57 | 59 | 60 | 61 | 62 | 63 | 68 | 80 | 92 | 96 | 99 | 104 | 105 | 106 | 107 | 108 | -------------------------------------------------------------------------------- /font/95.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 41 | 42 | 44 | 46 | 47 | 49 | image/svg+xml 50 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | python setup.py install 2 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/setup.cfg -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from distutils.extension import Extension 3 | from Cython.Build import cythonize 4 | from Cython.Distutils import build_ext 5 | 6 | 7 | sourcefiles = ['./fbpy/utils/fblib.pyx'] 8 | 9 | extensions = [ 10 | Extension( "fblib", 11 | libraries = ['png','jack'], 12 | sources = [ './fbpy/utils/fblib.pyx', 13 | './fbpy/utils/fbutils.c', 14 | './fbpy/utils/test.c', 15 | './fbpy/utils/audio.c'] 16 | ) 17 | ] 18 | 19 | setup( name='fbpy', 20 | version='0.1', 21 | author='marcell marosvolgyi', 22 | author_email='marcell@noisegate.org', 23 | url='http://transistorlove.wordpress.com', 24 | packages=['fbpy','fbpy.utils'], 25 | cmdclass = { 'build_ext' : build_ext }, 26 | #ext_modules = cythonize([module0, module1]) 27 | ext_modules = cythonize(extensions) 28 | ) 29 | 30 | -------------------------------------------------------------------------------- /test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/test.png -------------------------------------------------------------------------------- /tests.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noisegate/fbpy/8a42cfe5013bfdb08d1ac58ea766e57c2950e38d/tests.txt -------------------------------------------------------------------------------- /tests/hash1.txt: -------------------------------------------------------------------------------- 1 | 54ef5d999428b58f024946a73c2e61d34c8afe55 --------------------------------------------------------------------------------