1
0
mirror of synced 2026-04-13 07:34:19 +00:00
Files
brouhaha.tumble/bitblt_table_gen.c

60 lines
1.8 KiB
C

/*
* t2p: Create a PDF file from the contents of one or more TIFF
* bilevel image files. The images in the resulting PDF file
* will be compressed using ITU-T T.6 (G4) fax encoding.
*
* bitblt table generator
* $Id: bitblt_table_gen.c,v 1.1 2003/02/19 02:14:44 eric Exp $
* Copyright 2001, 2002, 2003 Eric Smith <eric@brouhaha.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. Note that permission is
* not granted to redistribute this program under the terms of any
* other version of the General Public License.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA
*/
#include <stdio.h>
int main (int argc, char *argv[])
{
int i, j;
printf ("/* This file is automatically generated; do not edit */\n");
printf ("\n");
printf ("static const uint8_t bit_reverse_byte [0x100] =\n");
printf ("{\n");
for (i = 0; i < 0x100; i++)
{
if ((i & 7) == 0)
printf (" ");
j = (((i & 0x01) << 7) |
((i & 0x02) << 5) |
((i & 0x04) << 3) |
((i & 0x08) << 1) |
((i & 0x10) >> 1) |
((i & 0x20) >> 3) |
((i & 0x40) >> 5) |
((i & 0x80) >> 7));
printf ("0x%02x", j);
if (i != 0xff)
printf (",");
if ((i & 7) == 7)
printf ("\n");
else
printf (" ");
}
printf ("};\n");
return (0);
}