X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bigscreen%2Ftinyptc%2Fpython_test.py;fp=bigscreen%2Ftinyptc%2Fpython_test.py;h=0000000000000000000000000000000000000000;hb=478ab340150034e545e3ed551ff068607d49d35b;hp=6e9d08ef84d105b45928525ceda7bb4686fe883a;hpb=8596d4aa3654710fb225c08c4d7235b74362561e;p=ccbs diff --git a/bigscreen/tinyptc/python_test.py b/bigscreen/tinyptc/python_test.py deleted file mode 100644 index 6e9d08e..0000000 --- a/bigscreen/tinyptc/python_test.py +++ /dev/null @@ -1,51 +0,0 @@ -#! /usr/bin/env python - -# TinyPTC x11 v0.7.3 Python example -# Copyright (C) 2002 Alessandro Gatti -# -# http://www.sourceforge.net/projects/tinyptc/ -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2 of the License, or (at your -# option) any later version. -# -# This library is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License -# for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -import TinyPTC - -WIDTH = 320 -HEIGHT = 200 -SIZE = (WIDTH * HEIGHT) -noise = None -carry = None -counter = None -pixel = None -seed = 0x12345 - -if not TinyPTC.ptc_open("Test", 320, 200): - raise Exception, "Can't open window!" - -pixel = TinyPTC.pixel_array(SIZE) - -while True: - for counter in range(SIZE): - noise = seed - noise = noise >> 3 - noise = noise ^ seed - carry = noise & 1 - noise = noise >> 1 - seed = seed >> 1 - seed = seed | (carry << 30) - noise = noise & 0xFF - pixel[counter] = (noise << 16) | (noise << 8) | noise - TinyPTC.ptc_update(pixel) - -TinyPTC.ptc_close()