home *** CD-ROM | disk | FTP | other *** search
- Path: comp-sources-3b1
- From: krf1061@ultb.isc.rit.edu (K.R. Flanagan)
- Subject: v02i039: consix - An LA100 - SIXEL Converter, Part01/01
- Newsgroups: comp.sources.3b1
- Approved: dave@galaxia.network23.com
- X-Checksum-Snefru: 21a1e788 1d557ae4 dbabe554 76cde34f
-
- Submitted-by: krf1061@ultb.isc.rit.edu (K.R. Flanagan)
- Posting-number: Volume 2, Issue 39
- Archive-name: consix/part01
-
- [ I almost rejected this because it has also been posted to alt.sources, ]
- [ but then I decided there might be people who get comp.sources.3b1 that ]
- [ don't get alt.sources so I am letting it go through. -- Dave ]
-
- Consix will convert pbm files to sixel format, Which is
- printable by DIGITAL LA100 series printers and should be printable
- by la50, and la75 printers also. I'm posting it since my inquires
- into drivers for la100's showed that there where a few 3b1 users in
- the same boat. Is it possible to do a screen capture and save it into
- a file instead of having it ported off to the printer, then convert it
- into some form thats hackable by the pbmtools package?
- -Kevin Flanagan
- krf1061@ritvax.isc.rit.edu
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: COPYRIGHT Makefile README Thanks consix.1 consix.c
- # consixi.c giffer giftosix sixinv.1 sixinv.c
- # Wrapped by dave@galaxia on Mon Mar 15 23:13:47 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'COPYRIGHT' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'COPYRIGHT'\"
- else
- echo shar: Extracting \"'COPYRIGHT'\" \(476 characters\)
- sed "s/^X//" >'COPYRIGHT' <<'END_OF_FILE'
- X Consix, Consixi, Sixinv
- X
- X AUTHOR
- X Copyright (C) 1993 by Kevin R. Flanagan.
- X
- X Permission to use, copy, modify, and distribute this
- X software and its documentation for any purpose and without
- X fee is hereby granted, provided that the above copyright
- X notice appear in all copies and that both that copyright
- X notice and this permission notice appear in supporting
- X documentation. This software is provided "as is" without
- X express or implied warranty.
- END_OF_FILE
- if test 476 -ne `wc -c <'COPYRIGHT'`; then
- echo shar: \"'COPYRIGHT'\" unpacked with wrong size!
- fi
- chmod +x 'COPYRIGHT'
- # end of 'COPYRIGHT'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(950 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X#
- X# makefile for consix, consixi, sixinv
- X# by: Kevin Flanagan
- X#
- X#CC = gcc
- XCC = cc
- X
- XSRC = consix.c consixi.c sixinv.c
- XOBJ = consix.o consixi.o sixinv.o
- XDOC = consix.1
- X
- Xall : consix consixi sixinv
- X
- X
- Xconsix : consix.c
- X $(CC) -O consix.c -s -o consix
- X
- Xconsixi : consixi.c
- X $(CC) -O consixi.c -s -o consixi
- X
- Xsixinv : sixinv.c
- X $(CC) -O sixinv.c -s -o sixinv
- X
- X#
- X# Consix, Consixi, Sixinv
- X#
- X# AUTHOR
- X# Copyright (C) 1993 by Kevin R. Flanagan.
- X#
- X# Permission to use, copy, modify, and distribute this
- X# software and its documentation for any purpose and without
- X# fee is hereby granted, provided that the above copyright
- X# notice appear in all copies and that both that copyright
- X# notice and this permission notice appear in supporting
- X# documentation. This software is provided "as is" without
- X# express or implied warranty.
- X#
- X# Send any comments, bugs, hate mail, bomb threats, to;
- X# -Kevin R. Flanagan
- X# krf1061@ritvax.isc.rit.edu
- END_OF_FILE
- if test 950 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(2967 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- XI'm most likely reinventing the wheel here but, I couldn't find anything in FTP
- Xland that suited my needs on this topic. ppmtosixel didn't work as desired
- Xfor my purposes.
- X
- X
- X Consix, Consixi
- X
- X AUTHOR
- X Copyright (C) 1993 by Kevin R. Flanagan.
- X
- X Permission to use, copy, modify, and distribute this
- X software and its documentation for any purpose and without
- X fee is hereby granted, provided that the above copyright
- X notice appear in all copies and that both that copyright
- X notice and this permission notice appear in supporting
- X documentation. This software is provided "as is" without
- X express or implied warranty.
- X
- X This program(s) (actually program, consixi just has some numbers
- X reversed from consix) will take a pbm file and convert it to a "sixel"
- X format. The qualifier on sixel is, I have nothing in what I've looked
- X through to indicate it is actually "sixel". This program takes raw pbm
- X and converts it to a form printable by DEC la100's ("sixel"). The output
- X is also directly viewable on vt240, vt340 terminals, along with DEC's
- X X windowing DECterms. This should also work on la75, la50 printers,
- X I don't have one I can test it on.
- X
- X Use is simple,
- X consix <file.pbm
- X consix <file.pbm >file.six
- X consix <file.pbm |lpr -P printer.name
- X
- X There are some limitations, it will not work with a file of more than
- X 1280 pixels (this size can be changed, by editing consix.c and consixi.c,
- X the version posted to alt.sources is limited to 2048) horizontally. And
- X errors are handled ungracefully, with either a core dump or a garbage
- X output (just as bad). It does not handle, ppm, pgm, or ascii pbm files.
- X This program has been compiled on a 3b1 (stock(non ansii) and gcc 1.41),
- X DEC risk 5000 (stock and gcc), and SUN SPARC 4.1.1 (stock and gcc).
- X This program has also worked on pbm files created from Jef Poskanzers
- X pbmplus package and raw pbm files created from the ever popular xv,
- X John Bradley. With the PBMplus package you can print out almost
- X any picture format (including gif) on a la100 series printer, and it
- X should work other dec laXX series printers. I would love to hear about
- X these since besides la100's every thing I have access to are non DEC
- X or Laser printers.
- X
- X Also included are sixinv, a program to make a negative of the of
- X sixel file (thus invert it :) ) and two shell scripts; giftosix and
- X giffer. These assuming you have the pbmplus package and will convert
- X gifs into a format that is printable on la100's or viewable on DIGITAL
- X graphics terminals. A small bug, you cannot pipe the output of giffer
- X to sixinv (giffer foo.gif|sixinv). Note these will be monochrome images!
- X
- X Please send all bug reports, congrads., job offers, hate mail,
- X ideas, comments, fixxes, modifications, etc...to;
- X
- X -Kevin Flanagan
- X krf1061@ritvax.isc.rit.edu
- X
- X I'll be sure to forward them to where they belong...
- END_OF_FILE
- if test 2967 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- chmod +x 'README'
- # end of 'README'
- fi
- if test -f 'Thanks' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Thanks'\"
- else
- echo shar: Extracting \"'Thanks'\" \(630 characters\)
- sed "s/^X//" >'Thanks' <<'END_OF_FILE'
- X Special thanks to;
- X
- X The comp.sys.3b1 news group for the technical support that
- X has kept my 3b1 running...the platform this was developed for and on.
- X
- X Mark Schroeder "mas7480@ritvax.isc.rit.edu" for technical help with
- X the RIT ULTRIX systems, and continued maintenance of the software that I
- X used to create and test the pbm files I used.
- X
- X The ritvax.isc.rit.edu notes group "UNIX" that helped me solve many of
- X the problems I had with the Makefile...
- X
- X Anyone that sends me bug reports and ideas on how to improve
- X the performance of these programs.
- X
- X -Kevin Flanagan
- X krf1061@ritvax.isc.rit.edu
- X
- END_OF_FILE
- if test 630 -ne `wc -c <'Thanks'`; then
- echo shar: \"'Thanks'\" unpacked with wrong size!
- fi
- # end of 'Thanks'
- fi
- if test -f 'consix.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'consix.1'\"
- else
- echo shar: Extracting \"'consix.1'\" \(2431 characters\)
- sed "s/^X//" >'consix.1' <<'END_OF_FILE'
- X.TH Consix "6 March 1993"
- X.SH NAME
- Xconsix, consixi -graphical front end for la100 series printers
- X.SH DESCRIPTION
- XConsix is a front end for digital LA100 series printers that converts
- Xraw PBM format bitmaps into digitals black and white sixel format.
- XConsixi produces a inverse sixel image for the printer.
- X.IP - 2
- XThe pbm file's magic number is the two characters "P4". "P1" files are
- Xin ascii format, and not readable by this version. The raw pbm format
- Xis 8 times smaller than the ascii format.
- X.IP - 2
- XThe DEC sixel format for la100's has 6 bits in each horizontal byte,
- Xrepresenting 6 vertical pixels on the paper. An actual sixel byte is
- Xthe the six on off bits from BIT0 -BIT5, plus a offset of 077 octal (63
- Xdec). Each line of bytes is followed by a graphical line feed and
- Xcarriage return (044 & 055 octal). The program works on a line by line
- Xbasis, outputting each line of data for every 6 lines of pbm data
- Xreceive to cut down on memory requirements. Once the EOF is detected a
- Xreset (ESC 134 octal) is sent to the printer to set it back to ascii
- Xmode.
- X.IP - 2
- XThis version does allow a single comment line starting with a '#'
- Xbetween the P4 and x,y size of the file, as is done with the pbm raw
- Xformat in the popular program xv.
- X.IP - 2
- Xfor more information on pbm (pnm,ppm,pgm) see Jef Poskanzers PBMplus package.
- X.SH "USAGE"
- X.IP - 2
- Xconsix <infile.pbm
- X.IP - 2
- Xconsix <infile.pbm >outfile.six
- X.IP - 2
- Xconsix <infile.pbm |lpr -P printer
- X.SH "BUGS"
- XConsix may truncate the last line if it is one bit out of sync. for
- Xmore information on pbm (pnm,ppm,pgm) see .SH "BUGS" Consix may truncate
- Xthe last line if it is one bit out of sync. Consix does not enforce
- Xerror checking at any level, feeding a pnm type file of any other format
- Xwill most likely result in garbage out. feeding a non P* file type will
- Xmost likely result in a core dump. This filter was written using the
- Xunix 10% , 90% rule. 10% of the effort solves 90% of the problem.
- X.SH "SEE ALSO"
- Xpnm(5), pgm(5), ppm(5), pbm(5)
- X.SH AUTHOR
- XCopyright (C) 1993 by Kevin R. Flanagan.
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted, provided
- Xthat the above copyright notice appear in all copies and that both that
- Xcopyright notice and this permission notice appear in supporting
- Xdocumentation. This software is provided "as is" without express or
- Ximplied warranty.
- END_OF_FILE
- if test 2431 -ne `wc -c <'consix.1'`; then
- echo shar: \"'consix.1'\" unpacked with wrong size!
- fi
- chmod +x 'consix.1'
- # end of 'consix.1'
- fi
- if test -f 'consix.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'consix.c'\"
- else
- echo shar: Extracting \"'consix.c'\" \(3678 characters\)
- sed "s/^X//" >'consix.c' <<'END_OF_FILE'
- X#include <stdio.h>
- X /* Consix V1.01 */
- X/* consix, converts a pbm file to a DEC LA100's sixel format */
- X/* By: Kevin Flanagan */
- X/* on: 3 - 7 - 1993 */
- X/* bug fixed: 3 - 11 - 1993 */
- X
- Xmain ()
- X{
- X char c,nill,six;
- X int hi,h[10],huh;
- X int Bin, A[8],x,x2,x3,x4;
- X int B[1350][6],ci,sixi,xdimen;
- X /* The first dimension on B[] can be made as large as your system will
- Xsupport, This is just done to make sure that it compiles on some of
- Xthe older pre-ansii systems, like my 3b1 (limit around 1350), It has been
- Xtested out to 4000, only, a la100 will not support much more than 1800 pixels */
- X
- X
- X /* read's the pbm header, P4 */
- X
- X/* this receives the P4 Cr from the pbm file */
- X
- X while (getchar() != 'P')
- X {
- X }
- X nill = getchar();
- X nill = getchar();
- X
- X/* this removes any comments from the header */
- X
- X if ((c = getchar() ) == '#')
- X {
- X while (getchar() != '\n')
- X {
- X }
- X c = getchar();
- X }
- X
- X /* this now gets the x dimension */
- X
- X/* This reads the X dimension out of the ascii header of the input */
- X
- X h[0] = c - 48;
- X x = 1;
- X while ( x <= 10 )
- X {
- X if ((c = getchar() ) != ' ')
- X {
- X h[x] = c - 48;
- X }
- X else
- X {
- X x2 = x;
- X x = 10;
- X }
- X x = x + 1;
- X }
- X while ((c = getchar()) != '\n')
- X {
- X }
- X
- X/* obtain's the x dimension */
- X
- X xdimen = 0;
- X x = 0;
- X while (x <= x2)
- X {
- X x3 = x2 - x;
- X for (huh = 1; x3 > 0; --x3)
- X huh = huh * 10;
- X xdimen = xdimen + (h[x]*huh);
- X x = x + 1;
- X }
- X xdimen = xdimen / 10;
- X
- X /* sixel printing control characters to insert it in graphics mode */
- X
- X/* ESC */
- X c = 27;
- X putchar (c);
- X/* P */
- X c = 80;
- X putchar (c);
- X/* 1 */
- X c = 49;
- X putchar (c);
- X/* q */
- X c = 113;
- X putchar (c);
- X
- X /* converts the raw pbm data into sixel and outputs it as stdio */
- X
- X x2 = 0;
- X hi = 0;
- X while ((ci = getchar()) != EOF)
- X {
- X x = 7;
- X Bin = 1;
- X
- X/* Decompress's each raw byte into 1's and 0's */
- X
- X while ( x >= 0)
- X {
- X if ( (ci & Bin) != 0)
- X A[x] = 1;
- X else
- X A[x] = 0;
- X x = x - 1;
- X Bin = Bin * 2;
- X }
- X x = 0;
- X
- X/* Stores the pbm bytes for conversion to sixel (guts of program) */
- X
- X while (x <= 7)
- X {
- X
- X B[x2][hi] = A[x];
- X x = x + 1;
- X x2 = x2 + 1;
- X if (x2 == xdimen)
- X {
- X x2 = 0;
- X
- X/* this gets around a nasty feature involving pbm raw files not writing
- X the second bit in each to 2 bit sequence at a line break */
- X
- X if ((x = 1)|(x = 3)|(x = 5)|(x = 7))
- X x = x + 1;
- X
- X/* besides which line in the array it is reading */
- X
- X if (hi != 5)
- X hi = hi + 1;
- X else
- X
- X/* This section outputs each line of sixel, as it goes through it */
- X
- X {
- X hi = 0;
- X x3 = 0;
- X while (x3 < xdimen)
- X {
- X
- X/* adds 6 lines of decompressed PBM to produce one line of sixel */
- X
- X sixi = B[x3][0] + 2*B[x3][1] + 4*B[x3][2] + 8*B[x3][3];
- X sixi = sixi + 63 + 16*B[x3][4] + 32*B[x3][5];
- X six = sixi;
- X/* outputs each 6 pixel vertical column as it creates it */
- X putchar (six);
- X x3 = x3 + 1;
- X }
- X
- X/* produces a graphical carriage return after each line */
- X
- X/* graphical carriage return */
- X c = 36;
- X putchar (c);
- X/* graphical line feed */
- X c = 45;
- X putchar (c);
- X }
- X }
- X }
- X }
- X/* resets the printer, terminal to ascii mode */
- X/* ESC */
- X c = 27;
- X putchar (c);
- X/* slash */
- X c = 92;
- X putchar (c);
- X}
- X
- X
- X/* Copyright (C) 1993 by Kevin R. Flanagan.
- X
- X Permission to use, copy, modify, and distribute this
- X software and its documentation for any purpose and without
- X fee is hereby granted, provided that the above copyright
- X notice appear in all copies and that both that copyright
- X notice and this permission notice appear in supporting
- X documentation. This software is provided "as is" without
- X express or implied warranty. */
- END_OF_FILE
- if test 3678 -ne `wc -c <'consix.c'`; then
- echo shar: \"'consix.c'\" unpacked with wrong size!
- fi
- chmod +x 'consix.c'
- # end of 'consix.c'
- fi
- if test -f 'consixi.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'consixi.c'\"
- else
- echo shar: Extracting \"'consixi.c'\" \(3680 characters\)
- sed "s/^X//" >'consixi.c' <<'END_OF_FILE'
- X#include <stdio.h>
- X /* Consixi V1.01 */
- X/* consixi, converts a pbm file to a DEC LA100's sixel format */
- X/* By: Kevin Flanagan */
- X/* on: 3 - 7 - 1993 */
- X/* bug fixed: 3 - 11 - 1993 */
- X
- Xmain ()
- X{
- X char c,nill,six;
- X int hi,h[10],huh;
- X int Bin, A[8],x,x2,x3,x4;
- X int B[1350][6],ci,sixi,xdimen;
- X /* The first dimension on B[] can be made as large as your system will
- Xsupport, This is just done to make sure that it compiles on some of
- Xthe older pre-ansii systems, like my 3b1 (limit around 1350), It has been
- Xtested out to 4000, only, a la100 will not support much more than 1800 pixels */
- X
- X
- X /* read's the pbm header, P4 */
- X
- X/* this receives the P4 Cr from the pbm file */
- X
- X while (getchar() != 'P')
- X {
- X }
- X nill = getchar();
- X nill = getchar();
- X
- X/* this removes any comments from the header */
- X
- X if ((c = getchar() ) == '#')
- X {
- X while (getchar() != '\n')
- X {
- X }
- X c = getchar();
- X }
- X
- X /* this now gets the x dimension */
- X
- X/* This reads the X dimension out of the ascii header of the input */
- X
- X h[0] = c - 48;
- X x = 1;
- X while ( x <= 10 )
- X {
- X if ((c = getchar() ) != ' ')
- X {
- X h[x] = c - 48;
- X }
- X else
- X {
- X x2 = x;
- X x = 10;
- X }
- X x = x + 1;
- X }
- X while ((c = getchar()) != '\n')
- X {
- X }
- X
- X/* obtain's the x dimension */
- X
- X xdimen = 0;
- X x = 0;
- X while (x <= x2)
- X {
- X x3 = x2 - x;
- X for (huh = 1; x3 > 0; --x3)
- X huh = huh * 10;
- X xdimen = xdimen + (h[x]*huh);
- X x = x + 1;
- X }
- X xdimen = xdimen / 10;
- X
- X /* sixel printing control characters to insert it in graphics mode */
- X
- X/* ESC */
- X c = 27;
- X putchar (c);
- X/* P */
- X c = 80;
- X putchar (c);
- X/* 1 */
- X c = 49;
- X putchar (c);
- X/* q */
- X c = 113;
- X putchar (c);
- X
- X /* converts the raw pbm data into sixel and outputs it as stdio */
- X
- X x2 = 0;
- X hi = 0;
- X while ((ci = getchar()) != EOF)
- X {
- X x = 7;
- X Bin = 1;
- X
- X/* Decompress's each raw byte into 1's and 0's */
- X
- X while ( x >= 0)
- X {
- X if ( (ci & Bin) != 0)
- X A[x] = 0;
- X else
- X A[x] = 1;
- X x = x - 1;
- X Bin = Bin * 2;
- X }
- X x = 0;
- X
- X/* Stores the pbm bytes for conversion to sixel (guts of program) */
- X
- X while (x <= 7)
- X {
- X
- X B[x2][hi] = A[x];
- X x = x + 1;
- X x2 = x2 + 1;
- X if (x2 == xdimen)
- X {
- X x2 = 0;
- X
- X/* this gets around a nasty feature involving pbm raw files not writing
- X the second bit in each to 2 bit sequence at a line break */
- X
- X if ((x = 1)|(x = 3)|(x = 5)|(x = 7))
- X x = x + 1;
- X
- X/* besides which line in the array it is reading */
- X
- X if (hi != 5)
- X hi = hi + 1;
- X else
- X
- X/* This section outputs each line of sixel, as it goes through it */
- X
- X {
- X hi = 0;
- X x3 = 0;
- X while (x3 < xdimen)
- X {
- X
- X/* adds 6 lines of decompressed PBM to produce one line of sixel */
- X
- X sixi = B[x3][0] + 2*B[x3][1] + 4*B[x3][2] + 8*B[x3][3];
- X sixi = sixi + 63 + 16*B[x3][4] + 32*B[x3][5];
- X six = sixi;
- X/* outputs each 6 pixel vertical column as it creates it */
- X putchar (six);
- X x3 = x3 + 1;
- X }
- X
- X/* produces a graphical carriage return after each line */
- X
- X/* graphical carriage return */
- X c = 36;
- X putchar (c);
- X/* graphical line feed */
- X c = 45;
- X putchar (c);
- X }
- X }
- X }
- X }
- X/* resets the printer, terminal to ascii mode */
- X/* ESC */
- X c = 27;
- X putchar (c);
- X/* slash */
- X c = 92;
- X putchar (c);
- X}
- X
- X
- X/* Copyright (C) 1993 by Kevin R. Flanagan.
- X
- X Permission to use, copy, modify, and distribute this
- X software and its documentation for any purpose and without
- X fee is hereby granted, provided that the above copyright
- X notice appear in all copies and that both that copyright
- X notice and this permission notice appear in supporting
- X documentation. This software is provided "as is" without
- X express or implied warranty. */
- END_OF_FILE
- if test 3680 -ne `wc -c <'consixi.c'`; then
- echo shar: \"'consixi.c'\" unpacked with wrong size!
- fi
- chmod +x 'consixi.c'
- # end of 'consixi.c'
- fi
- if test -f 'giffer' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'giffer'\"
- else
- echo shar: Extracting \"'giffer'\" \(386 characters\)
- sed "s/^X//" >'giffer' <<'END_OF_FILE'
- XFIRST=1
- Xfor FILE
- Xdo
- X if test $FIRST -eq 0; then
- X echo "--More--(Next file: $FILE)"
- X echo " "
- X fi
- X echo "------> $FILE <------"
- X giftoppm $FILE |ppmtopgm|pgmtopbm|consix
- X if test -t; then
- X FIRST=0
- X fi
- Xdone
- X# This script gives a brief file descriptor between each file your loading
- X# giffer
- X# by: Kevin Flanagan
- X# on:3-13-1993
- X
- X#
- X# Note, sixinv will not work with this shell script.
- X#
- END_OF_FILE
- if test 386 -ne `wc -c <'giffer'`; then
- echo shar: \"'giffer'\" unpacked with wrong size!
- fi
- chmod +x 'giffer'
- # end of 'giffer'
- fi
- if test -f 'giftosix' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'giftosix'\"
- else
- echo shar: Extracting \"'giftosix'\" \(39 characters\)
- sed "s/^X//" >'giftosix' <<'END_OF_FILE'
- Xgiftoppm $1 |ppmtopgm|pgmtopbm|consixi
- END_OF_FILE
- if test 39 -ne `wc -c <'giftosix'`; then
- echo shar: \"'giftosix'\" unpacked with wrong size!
- fi
- chmod +x 'giftosix'
- # end of 'giftosix'
- fi
- if test -f 'sixinv.1' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sixinv.1'\"
- else
- echo shar: Extracting \"'sixinv.1'\" \(1137 characters\)
- sed "s/^X//" >'sixinv.1' <<'END_OF_FILE'
- X.TH Sixinv "11 March 1993"
- X.SH NAME
- XSixinv -produces a negative sixel image of a sixel image
- X.SH "USAGE"
- X.IP - 2
- Xsixinv <infile.sixel
- X.IP - 2
- Xsixinv <infile.sixel >outfile.sixel
- X.IP - 2
- Xfoo.sixoutput |sixinv >outfile.sixel
- X.IP - 2
- Xsixinv <infile.sixel |lpr -P printer
- X.SH "BUGS"
- XSixinv does not enforce error checking at any level, feeding a non sixel
- Ximage into it will most likely result in garbage out. If any text is
- Xfed into sixinv before the header the header that defines a sixel file
- Xas sixel will be lost. Embedded escape sequences of more than two
- Xcharacters will be mangled. This filter was written using the unix 10%,
- X90% rule. 10% of the effort solves 90% of the problem.
- X.SH "SEE ALSO"
- Xconsix(1)
- X.SH AUTHOR
- XCopyright (C) 1993 by Kevin R. Flanagan.
- X
- XPermission to use, copy, modify, and distribute this software and its
- Xdocumentation for any purpose and without fee is hereby granted, provided
- Xthat the above copyright notice appear in all copies and that both that
- Xcopyright notice and this permission notice appear in supporting
- Xdocumentation. This software is provided "as is" without express or
- Ximplied warranty.
- END_OF_FILE
- if test 1137 -ne `wc -c <'sixinv.1'`; then
- echo shar: \"'sixinv.1'\" unpacked with wrong size!
- fi
- chmod +x 'sixinv.1'
- # end of 'sixinv.1'
- fi
- if test -f 'sixinv.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'sixinv.c'\"
- else
- echo shar: Extracting \"'sixinv.c'\" \(1517 characters\)
- sed "s/^X//" >'sixinv.c' <<'END_OF_FILE'
- X#include <stdio.h>
- X /* Sixinv V1.0 */
- X/* Sixinv makes a negative of a Sixel image */
- X/* By: Kevin Flanagan */
- X/* on: 3 - 11 - 1993 */
- X
- Xmain ()
- X{
- X int c;
- X char ci;
- X
- X /* preserves the header, does not do any error checking */
- X/* reads the first 4 characters that define a sixel file, ESC, P, 1, q */
- X
- X ci = getchar();
- X putchar(ci);
- X ci = getchar();
- X putchar(ci);
- X ci = getchar();
- X putchar(ci);
- X ci = getchar();
- X putchar(ci);
- X
- X/* starts the loop for making a negative */
- X
- X while ((c=getchar()) != EOF)
- X {
- X/* checks for a graphical carriage return, line feed, esc sequence */
- X/* 27 = ESC, 36 = graph line feed, 45 = graph return, 92 = reset */
- X
- X if ((c == 36) | (c == 45))
- X putchar(c);
- X else
- X {
- X/* propperly handles single character escape sequences */
- X if ( c == 27)
- X {
- X putchar (c);
- X c = getchar();
- X putchar (c);
- X }
- X else
- X {
- X/* code to invert the sixel part of the image, inefficient but easy to read */
- X
- X c = c - 63;
- X c = 63 - c;
- X ci = c + 63;
- X putchar(ci);
- X }
- X }
- X }
- X}
- X
- X/* Copyright (C) 1993 by Kevin R. Flanagan.
- X
- X Permission to use, copy, modify, and distribute this
- X software and its documentation for any purpose and without
- X fee is hereby granted, provided that the above copyright
- X notice appear in all copies and that both that copyright
- X notice and this permission notice appear in supporting
- X documentation. This software is provided "as is" without
- X express or implied warranty. */
- X
- X
- X/* wow some actually read more than the make file :) */
- END_OF_FILE
- if test 1517 -ne `wc -c <'sixinv.c'`; then
- echo shar: \"'sixinv.c'\" unpacked with wrong size!
- fi
- chmod +x 'sixinv.c'
- # end of 'sixinv.c'
- fi
- echo shar: End of shell archive.
- exit 0
- --
- David H. Brierley
- Home: dave@galaxia.network23.com; Work: dhb@quahog.ssd.ray.com
- Send comp.sources.3b1 submissions to comp-sources-3b1@galaxia.network23.com
- %% Pardon me Professor, can I be excused, my brain is full. **
-