2 * TinyPTC x11 v0.7.3 Example file
3 * Copyright (C) 2001-2002 Alessandro Gatti <a.gatti@tiscali.it>
4 * Copyright (C) 2000-2001 Glenn Fiedler <gaffer@gaffer.org>
6 * http://www.sourceforge.net/projects/tinyptc/
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library 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 GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #define SIZE WIDTH*HEIGHT
35 static int seed = 0x12345;
36 static int pixel[SIZE];
39 ptc_cleanup_callback (void)
41 fprintf (stderr, "Callback!\n");
47 if (!ptc_open ("test", WIDTH, HEIGHT))
51 for (counter = 0; counter < SIZE; counter++)
59 seed |= (carry << 30);
61 pixel[counter] = (noise << 16) | (noise << 8) | noise;