Article 54 of unix-pc.sources: Path: tut!osu-cis!cbosgd!mtune!codas!flnexus!kimbal!rick From: rick@kimbal.UUCP (Rick Kimball) Newsgroups: unix-pc.sources Subject: showPaint - UNIX-PC program to display MacPaint Files Message-ID: <400@kimbal.UUCP> Date: 18 Jan 88 23:06:38 GMT Distribution: na Organization: Mac Source BBS, Altamonte Spgs, FL Lines: 1637 [ showPaint - UNIX-PC pgram to display MacPaint Files ] Included is the source to showPaint. It allows you to display MacPaint Files on the UNIX-PC console. It understands MacBinary files and data forks of a MacPaint File. No scrolling or screen ratio conversion in this version. Rick Kimball UUCP: codas!flnexus!kimbal!rick -------------------------- Cut Here --------------------------- #!bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # README # showPaint.mk # showPaint.c # UnPackBits.c # InvertBits.c # demo.uuencode # echo shar: extracting README '(1120 characters)' sed 's/^X//' << \SHAR_EOF > README X"showPaint" displays MacPaint pictures on a UNIX-PC screen. X XThe source is divided into three files. "showPaint.c" contains the Xdriver source. "UnPackBits.c" is an implementation of the Macintosh Xtoolbox call UnpackBits(). "InvertBits.c" is a functions that swaps Xthe bits in an array of shorts. To run showPaint, upload a XMacintosh MacPaint file to the 3b1. Execute the command: X X $ showPaint paintFile X Xwhere "paintFile" is the MacPaint file. It will locate the data Xfork, unpack and invert the picture, then display the top 300 lines Xcentered on the screen. X XIncluded is a sample MacPaint file called "demo.pntg". It is a snapshot Xof my Mac screen while running a program available from the Boston XComputer Society called "Vanlandingham" (the Mac equivilent to Amiga X"Boing Demo"). You will see I don't try and compensate for the Xacspect ratio (1.5 wide by 1 high ) on the 3b1. But the results are Xquite nice anyways. X XI have compiled this on a 3b1 with version 3.51 of the development Xsystem. I am not sure if it works with other versions. Let me know. X XRick Kimball X XUUCP:codas!flnexus!kimbal!rick SHAR_EOF if test 1120 -ne `wc -c < README` then echo shar: error transmitting README 'expected 1120 characters' fi echo shar: extracting showPaint.mk '(512 characters)' sed 's/^X//' << \SHAR_EOF > showPaint.mk X#------------------------------------------------------------ X# showPaint.mk - UNIX-PC only X#------------------------------------------------------------ X Xinclude $(MAKEINC)/Makepre.h X XCFLAGS = -O X XLDFLAGS = -s X XSRC = showPaint.c UnPackBits.c InvertBits.c X XOBJS = showPaint.o UnPackBits.o InvertBits.o X Xall: showPaint demo.pntg X XshowPaint: $(OBJS) X $(LD) $(SHAREDLIB) $(LDFLAGS) -o $@ $(OBJS) X Xdemo.pntg: X uudecode showPaint.c X/* X Name: showPaint.c X X Machine: UNIX-PC X X Description: This program takes a MacPaint file and displays X it on the UNIX-PC console. It recognizes MacBinary X files (like those stored on CompuServe in the X Macintosh Users Group Data Libraries) and the data X fork from a MacPaint file (like those from usenet). X X Author: Rick Kimball X X UUCP: codas!flnexus!kimbal!rick X X Date: Mon Jan 11 20:37:00 EST 1988 X X This software is Copyright (c) 1988 by Rick Kimball. X X Permission is hereby granted to copy, reproduce, redistribute or X otherwise use this software as long as: there is no monetary X profit gained specifically from the use or reproduction or this X software, it is not sold, rented, traded or otherwise marketed, and X this copyright notice is included prominently in any copy X made. X X The author make no claims as to the fitness or correctness of X this software for any use whatsoever, and it is provided as is. X Any use of this software is at the user's own risk. X X How to do it: X X Given a MacPaint picture named PinUp.MPTG ( either MacBinary X format or the data fork of a MacPaint file), type the X following command to display it on the UNIX-PC console: X X $ showPaint PinUp.MPTG X X*/ X X/* X XINCLUDE FILES X X*/ X X#include X#include X#include X#include X#include X#include X X/* X XDEFINES X X*/ X X/* MacPaint Picture defines */ X X#define MAC_WIDTH 576 /* 576 pixels */ X#define ROW_BYTES 72 /* 576 pixels wide / 8 */ X#define NO_OF_LINES 720 /* 720 line */ X#define MAX_MACPAINT_SIZE 51840L /* ROW_BYTES * NO_OF_LINES */ X X#define CursorOff(w) wprintf(w, "\033[=1C") X X/* X XGLOBALS X X*/ X Xextern int errno, sys_nerr; X Xextern char *sys_errlist[]; X Xchar inputBuffer[MAX_MACPAINT_SIZE]; X Xchar outPutBitImage[MAX_MACPAINT_SIZE]; X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X short width = ROW_BYTES * 8; /* # of pixels colums in a mac pixture */ X short offset = (WINWIDTH/2)-(MAC_WIDTH/2); /* center the pict and scrn */ X short height = WINHEIGHT; /* # of pixel rows on a 25 line screen */ X X /* create a new window just for us */ X X Init(); X X /* Open the MacPaint file and run UnPackBits on it */ X X UnPackPaint(argv[1],inputBuffer); X X /* X Invert the bits in every short. On the Mac the X first pixel is in bit 15 of the first short the X second pixel is in bit 14 and so on. On the X UNIX-PC it is just the opposite, the first pixel is X in bit 0 and the second pixel in bit 1. So you X see, we must flip each bit. X */ X X printf("Inverting BitMap . . .\n"); X X InvertBits((long *)inputBuffer,(long *)outPutBitImage,MAX_MACPAINT_SIZE); X X Show((unsigned short *)outPutBitImage,width,height,offset); X X wexit(0); X} X XInit() X{ X X close(0); close(1); close(2); X if ( (open("/dev/window", O_RDWR)) < 0 ) X { X exit(666); X } X dup(0); dup(0); X X /* Make sure they are on the console */ X X winit(); X X if ( !iswind() ) X { X fprintf(stderr, "Sorry, you must be on the bit-mapped diplay\n"); X wexit(1); X } X} X XUnPackPaint(fileName, outputBuff) Xchar *fileName; Xchar outputBuff[]; X{ X static char workBuffer[MAX_MACPAINT_SIZE + 200]; X FILE *macPaintFP; X long size, SizeFile(); X char **srcPtr, **dstPtr; X int macFD, i; X X if ( (macPaintFP = fopen(fileName,"r")) == NULL ) X { X perror("showPaint: can't open MacPaint file"); X wexit(1); X } X X macFD = fileno(macPaintFP); X X size = SizeFile(fileName); X X if ( (size < 512 ) || (size > MAX_MACPAINT_SIZE) ) X { X fprintf(stderr,"Error: Are you sure %s is a MacPaint file\n", X fileName); X wexit(1); X } X X if ( (read(macFD, workBuffer, size)) != size ) X { X perror("showPaint: error reading MacPaint file"); X wexit(1); X } X X fclose(macPaintFP); X X if ( (strncmp(&workBuffer[65], "PNTGMPNT", 8)) == 0 ) X { X /* X This is a MacBinary file. There is an X additional 128 byte header before the X actual data fork. X */ X srcPtr = (char **)&workBuffer[128 + 512]; X } X else X { X /* X Hopefully this is the data fork of a MacPaint X File. Note we are skipping the patterns (first 512 X bytes) we usually don't need them. X */ X srcPtr = (char **)&workBuffer[512]; X } X X dstPtr = (char **)&outputBuff[0]; X X printf("UnPacking MacPaint Picture . . .\n"); X X for ( i = 0; i < 720; i++) X { X UnPackBits(&srcPtr,&dstPtr,ROW_BYTES); X } X} X Xlong XSizeFile(filen) Xchar *filen; X{ X struct stat buf; X X if (stat(filen, &buf) != 0) X { X perror("showPaint: error in stat"); X wexit(1); X } X return(buf.st_size); X} X XShow(bitImage,width,height,offset) Xunsigned short*bitImage; Xshort width, height, offset; X{ X extern unsigned short patwhite[]; X int w; X int keyPressed; X int returnCode; X X if ( (w = wcreate(0,0,25,80,1)) < 0) X { X perror("showPaint: creating new window "); X wexit(1); X } X X CursorOff(w); X X clear(); X X returnCode = wrastop(w, bitImage, /* srcbase */ X ROW_BYTES, /* srcwidth */ X 0, /* dstbase (screen) */ X 0, /* dstwidth (screen Row Bytes) */ X 0, 0, /* src h, v */ X offset, 0, /* dst h, v */ X width, height, /* width, height */ X SRCXOR, DSTSRC, X patwhite); X if ( returnCode != 0 ) X { X perror("showPaint: error performing raster operation"); X wexit(1); X } X X wprompt( w, "Press any key to continue..."); X X /* wait for the user to press a key */ X X keyPressed = wgetc(w); X X wdelete(w); X} SHAR_EOF if test 6067 -ne `wc -c < showPaint.c` then echo shar: error transmitting showPaint.c 'expected 6067 characters' fi echo shar: extracting UnPackBits.c '(1967 characters)' sed 's/^X//' << \SHAR_EOF > UnPackBits.c X/* X Name: UnPackBits.c X X Synopsis: UnPackBits( char **src, **dst, short rowBytes ); X X Description: See Apple Tech Notes: X #86: MacPaint Document Format X #171: PackBits Data Format X X This software is Copyright (c) 1987 by Rick Kimball. X X Permission is hereby granted to copy, reproduce, redistribute or X otherwise use this software as long as: there is no monetary X profit gained specifically from the use or reproduction or this X software, it is not sold, rented, traded or otherwise marketed, and X this copyright notice is included prominently in any copy X made. X X The author make no claims as to the fitness or correctness of X this software for any use whatsoever, and it is provided as is. X Any use of this software is at the user's own risk. X X Sample Call Sequence: X X char **srcPtr, **dstPtr; X char macPaintFile[(576/8)*720]; X char bitImage[51840]; X X ... X srcPtr = (char **)&macPaintFile[512]; X dstPtr = (char **)&bitImage[0]; X X for( x = 0; x < 720; x++) X { X UnPackBits(&srcPtr,&dstPtr, 576/8); X } X ... X X X*/ X X#define HIGH_BIT_ON 0x80 X XUnPackBits(src, dst, cnt) Xregister unsigned char **src; Xregister unsigned char **dst; Xregister short cnt; X{ X register short noOfBytes; X register unsigned char bit15;; X X if ( cnt <= 0 ) X return(0); X X bit15 = HIGH_BIT_ON; X X while ( cnt ) X { X if ( **src & bit15 ) /* Is High bit set ? */ X { X noOfBytes = abs((char)*(*src)++); X cnt -= ++noOfBytes; X while( noOfBytes-- ) X { X *(*dst)++ = **src; X } X (*src)++; X } X else /* It is a normal zero based counter */ X { X noOfBytes = (char)*(*src)++; X cnt -= ++noOfBytes; X while( noOfBytes-- ) X { X *(*dst)++ = *(*src)++; X } X } X } X return(0); X} SHAR_EOF if test 1967 -ne `wc -c < UnPackBits.c` then echo shar: error transmitting UnPackBits.c 'expected 1967 characters' fi echo shar: extracting InvertBits.c '(2793 characters)' sed 's/^X//' << \SHAR_EOF > InvertBits.c X/* X X Name: InvertBits.c X X Synopsis: InvertBits( unsigned long *src,*dst, int noOfBytes ); X src - input array of shorts; X dst - output array of shorts; X noOfBytes - is the number of characters in the src array; X X Description: This functions is used to convert Apple X Macintosh bit images to UNIX-PC bit images. On a X Mac a bitmap consists of an array of unsigned X shorts. The left most pixel on the first line is in X bit 15 of the first short. The second pixel is in X bit 14 and so on. However, it is just the X opposite on the UNIX-PC. The left most pixel on X the first line for a UNIX-PC is stored in bit 0 X and the next in bit 1 and so on. The purpose of X this function is to swap bit for bit each pixel. X X This software is Copyright (c) 1987 by Rick Kimball. X X Permission is hereby granted to copy, reproduce, redistribute or X otherwise use this software as long as: there is no monetary X profit gained specifically from the use or reproduction or this X software, it is not sold, rented, traded or otherwise marketed, and X this copyright notice is included prominently in any copy X made. X X The author make no claims as to the fitness or correctness of X this software for any use whatsoever, and it is provided as is. X Any use of this software is at the user's own risk. X X Sample Call Sequence: X X X #define MAC_PAINT_SIZE 51840 X ... X X char macPaintImage[MAC_PAINT_SIZE]; X char unixpcBitImage[MAC_PAINT_SIZE]; X X InvertBits((long*)macPaintImage,(long*)unixpcBitImage, MAC_PAINT_SIZE); X ... X X*/ X XInvertBits(srcPtr,dstPtr,noOfBytes) Xregister long *srcPtr, *dstPtr; Xregister long noOfBytes; X{ X register long ONES; X register short bitCnt; X register long tempLong; X X if ( noOfBytes < 0 ) /* Just return if count < 0 */ X return(0); X X noOfBytes = noOfBytes / 4; /* Assuming the size of the array is % 4 */ X X ONES = 0x00010001; /* Let's deal with the short as longs */ X /* to make this go faster */ X while( noOfBytes-- ) X { X *dstPtr = 0L; /* Zero the destination array[x] */ X bitCnt = 15; /* Let's loop through the bits */ X while(bitCnt--) X { X tempLong = *srcPtr & ONES; /* See if this bit is on */ X *dstPtr |= tempLong; X *srcPtr >>= 1; /* lets look at the next bit from the left */ X *dstPtr <<= 1; /* push the result bit it to the left */ X } X tempLong = *srcPtr++ & ONES; X *dstPtr++ |= tempLong; /* deal with the last bit */ X } X return(0); X} SHAR_EOF if test 2793 -ne `wc -c < InvertBits.c` then echo shar: error transmitting InvertBits.c 'expected 2793 characters' fi echo shar: extracting demo.uuencode '(16956 characters)' sed 's/^X//' << \SHAR_EOF > demo.uuencode Xbegin 0 demo.pntg XM ID96UO3BYP;G1G XM !03E1'35!.5 $ /\ (0 "\V XM )X2Z':>$NAW ! "!@=U, XM XM XM XM XM XM XM XM XM XM XM XM /#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___ XMO__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[ XM___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^_ XM__[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O_ XM_^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L XM__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;__ XM_O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___ XM[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^ XM___[___O__^___[___O__^___[_L__#_ (#A _[/_P_R&___[___O__^__ XM_[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__ XM^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___ XMJJJN___[___O__^_[/_P_R&___[___O__^___[___O__^___[__U%5547__[ XM___O__^_[/_P_Q2___[___O__^___[___O__^___[__\J@?_^___[___O^S_ XM\/\AO__^___[___O__^___[___O\ 'U51555%5?^___[___O^S_\/\4O__^ XM___[___O__^___[___N^ !N_*H'J_O__^___[_L__#_(;___O__^___[___ XMO__^___X8 Q45551557O__^___[_L__#_%;___O__^___[___O__^__^/ XM^ ?+\J@:K___O__^_[/_P_R&___[___O__^___[___O_X?_X !_^^%554 XM5553___O__^_[/_P_Q:___[___O__^___[___O_#__\#___@RORJ!?__[___ XMO^S_\/\/O__^___[___O__^___[_'_S_#/ )551555%__^___[_L__#_%K__ XM_O__^___[___O__^_'___@____P _*H%K__O__^_[/_P_Q*___[___O__^__ XM_[___N/___ '_O\+ %5455515__O__^_[/_P_Q>___[___O__^___[___H__ XM_X !___P/_K]J@6K_^___[_L__#_(;___O__^___[___O___/__^ !__X ? XM^51555%5?^___[_L__#_%[___O__^___[___O__X?__X ?_ '^?RJ!+_O XM__^_[/_P_R&___[___O__^___[___O__X #_ ?!4555155_O__^_[/_P XM_QB___[___O__^___[__^'__@ X &!J_:H$K^___[_L__#_ (#U +P XM'_[Y P^0 /^S_\/\/O__^___[___O__^__L '_/X !0/ !P&ORJ ^__ XM_[_L__#_#[___O__^___[___O_^ ?#^ X/X _!Q555%556___[_L__#_ XM#[___O__^___[___O_\ .#^ 4?^ !_@[\J@.O__^_[/_P_P^___[___O_ XM_^___[_L ! _@ .?_X _^/%551555/__^_[/_P_P^___[___O__^___[_X XM #P_@ %__^ !__O_*H#K___O^S_\/\AO__^___[___O__^_\ !_ ___ XMP __]]5545551___O^S_\/\9O__^___[___O__^_X '_@ !___\ __^\K] XMJ@.K__^_[/_P_R&___[___O__^___[_ __@ /___\'__XY551555%__^_ XM[/_P_QF___[___O__^___[\ !__X ?___^/__X,ORJ O__O^S_\/\2O__^ XM___[___O__^^ ___@ ?_S_"?@)55%5545__[_L__#_$;___O__^___[___ XMO ?__\ /W_ Q__^ #\J@*__[_L__#_#;___O__^___[___N _O\ ?W_ XM"P?_^ )5455515__O^S_\/\-O__^___[___O___X '^_P##_O\$_@/_^ /\ XMJ@*__[_L__#_#;___O__^___[___L #_O\ Y_[_#/P __@!]5%5545?_[_L XM__#_#;___O__^___[___ '_O\ ]_[_!?P /_@!^OVJ J__O^S_\/\-O__^ XM___[___O__\X _^_P#A_O\,^ /^ #U455515?_O^S_\/\-O__^___[___O XM__Y^ !_^_PG ?___\ '^ #Z_:H"J_^_[/_P_PV___[___O__^___/\ /_[_ XM$( ____@ 'X 'U1555%5?^_[/_P_PV___[___O__^__^/_ ?_[_"0 /___@ XM !X 'S\J@'_O^S_\/\ @/@ @G_\/[_"OX ___P $ !^^P /^S_\/\, XMO__^___[___O__/__?[_!?P /__@/T 3\J_:H!_[_L__#_#+___O__^___ XM[__G__W^_Q'X !__X P /Q%55455?[_L__#_%+___O__^___[__G__Q_ XM___P ?__X @\ /_RJ ;^_[/_P_Q2___[___O__^__S__X'___\ !_[^ XM D/@!^1555%55^_[/_P_Q2___[___O__^__G__P!___X _[^ ,/X!_* XM_:H!O[_L__#_$+___O__^___[_^?_^ #___ _@ _/X "1_X'\%554557[_L XM__#_$+___O__^___[_\__^ __^ _@ ./X Q_^'^+]J@&OO^S_\/\/O__^ XM___[___O_S__P ___T C^ D?_P_A555%55>_[/_P_P^___[___O__^_^ XM?_^ _^_0 "/X Q__S_+]J@&OO^S_\/\/O__^___[___O_G__@ '_OT XM ![^ D____Q555%55>_[/_P_P^___[___O__^_\__\ '\_0 ''X #__ XM\_C]J@&KO^S_\/\+O__^___[___O_/_^_@ >/T #3_@ ___'Y555%556_ XM[/_P_PN___[___O__^_Y__[^ P_0 '?_ #__\'C]J@&KO^S_\/\+O__^ XM___[___O^?_\^0 -?_P '__^!Q554555;_L__#_"[___O__^___[_/__/X XM !S] C__P ?__X#"K]J@"_[/_P_PN___[___O__^_S__C^ __@ . ?__ XMP !___@"555%556_[/_P_PN___[___O__^_W__#^ T_@ ?__X !___@! XM*OVJ +_L__#_"[___O__^___[^?_\/X $G_@ #___X /__^ '5545553_L XM__#_"[___O__^___[^__X/X #?_X '___^ /__^ 'J_:H O^S_\/\ @/D XM D__X/X !/_^ '_O\% /__^ #@_0 /^S_\/\3O__^___[___O[__ ! XM__\ _^_P7!___X .K]J@"_[/_P_Q.___[___O__^_O_\ /__\ #_[_ XM"O'___@ ]55%554_[/_P_Q.___[___O__^_C_\ /___ '_[_!?W___@ XM>OVJ +_L__#_$[___O__^___[^#_@ !____ __O\*_?__^ !U545551_L XM__#_$[___O__^___[\ _@ !____@ __O\%_'__^ !Z_:H O^S_\/\*O__^ XM___[___OP!_^ /_O\!@'_^_PK\'__X '551555'^S_\/\*O__^___[___O XMP ?^ ?_O\!X'_^_P7X!__X 'K]J@"_[/_P_PF___[___O__^_ _0 '_[_ XM /#]_PKX __X #U51555'^S_\/\*O__^___[___O@ '^ __O\ _?W_!? XM__@ .OVJ *_L__#_#K___O__^___[X !P /_[_ /[]_PKP #_X #U51555 XM'^S_\/\.O__^___[___O@ /P !__O\!_#_^_P7P _X #[]J@"O[/_P_PZ_ XM__[___O__^^ _P '_^_P'\'_[_"N !_@ /55%554?[/_P_PV___[___O_ XM_^\ _X /W_ ?@'_O\%X !\ ^_:H K^S_\/\-O__^___[___O ?_@ #] XM_P'P ?[_"L ' /55%554?[/_P_PV___[___O__^\ !__@ ?W_"O ?___ XMP , ^_:H K^S_\/\-O__^___[___O ?_^ ']_P7@ #___X#] 4]5455 XM51?L__#_#;___O__^___[P /__P#_?\*X /__^ , #[]J@"O[/_P_PV_ XM__[___O__^\ #___ _W_#\ ___@ #P ?545551?L__#_#;___O__^___ XM[@ /___'_?\$@ ___^ (?@![]J@"O[/_P_P" ^@ %!@ /___W_?\$@ XM?__^ (?X![] 7[/_P_PV___[___O__^X '___]_W__@ !'_[^ (?^![] XMJ@"O[/_P_PV___[___O__^X '___\?W__@ !!_[^ ?__X /_VJ :^_[/_P_P" ^0 &"" XM?___X?W_!X ?__@ !__ /^S_\/\0O__^___[___O_! ?___X'_^_P< XM !__P ?OVJ :^_[/_P_R&___[___O__^_\# !____ /____@ #_^ #_ XM555%55^_[/_P_QN___[___O__^_^#@!____ #____ _^ #^_:H!O[_L XM__#_$[___O__^___[_X/@'___X #___\_@ *_P ?U55455?[_L__#_$[__ XM_O__^___[_\'X'___X ___X_@ $?@ _K]J@&_O^S_\/\3O__^___[___O XM_P?X?___ !___#^ H> #^555155_O^S_\/\3O__^___[___O_X?\?___ XM ?_^#^ 0$ '^OVJ ?^_[/_P_Q.___[___O__^__@_]___X ?_P/X XM"@8 ?Q555%5?^_[/_P_Q.___[___O__^__P_^___X '_P/X ! \ _J XM_JH"J_^_[/_P_PZ___[___O__^__X?^/__S^ '_@/X "A_ !_1555%5_^_ XM[/_P_PZ___[___O__^__X?^'__S^ __0 $'_ '^K^J@*K_[_L__#_#K__ XM_O__^___[__Q_X'_^/X [] H__ _T55515?_O^S_\/\.O__^___[___O XM__C_@'_X_@ !/T W_^ '_]J@*O_[_L__#_#K___O__^___[__X_X _^/X XM +] K__X#_455515__O^S_\/\.O__^___[___O__Q_P _P_@ (!X '_ XM_^#^_:H"O_^_[/_P_PZ___[___O__^___G_ _#^ \/X ___^?U1555% XM?_^_[/_P_PZ___[___O__^___S_ .#^ 0?\ !_[_ /K]J@+__[_L__#_ XM#K___O__^___[___'\ 8/X #S_\ /___X_5%5547__[_L__#_#K___O__ XM^___[___G\ (/X "'__ ?___P.OZJ ZO__[_L__#_ (#W -/P X_@ ' XM___ #___^#Z _[/_P_QJ___[___O__^___[?@ #X '__^ ?___P"K^ XMJ@.O__^_[/_P_Q6___[___O__^___[O@ '\ /___@ _O\(@%51555/__^_ XM[/_P_Q6___[___O__^___[S@ '_ ?___X!_O\ /VJ Z___[_L__#_$;__ XM_O__^___[___OG __ #_[_# /___X!55%556___[_L__#_$;___O__^___ XM[___OQ __P '_[_!,?___P"_:H#[___O^S_\/\1O__^___[___O__^_" #_ XM_@ __O\,[___^ 554555[___O^S_\/\1O__^___[___O__^_A@'__X!__O\$ XMP___\ K^J@2K[___O^S_\/\0O__^___[___O__^_QP'__^#]_PR!___@%551 XM55?O__^_[/_P_Q"___[___O__^___[_CP?__\_[_!?X ?_^ *OZJ!*_O__^_ XM[/_P_Q"___[___O__^___[_Y\___^_[_#?P '_\ 555157_O__^_[/_P_PR_ XM__[___O__^___[_]_O\ \/[_!/ !_X _:H$_^___[_L__#_(;___O__^___ XM[___O_[]___ /___X #^ !555%5_^___[_L__#_&+___O__^___[___O__\ XM?_^ '___@ \ K^J@6K_^___[_L__#_$[___O__^___[___O__X'_X !___ XM_0 )%%5545__[___O^S_\/\3O__^___[___O__^___@/_ !__S^ %P*OZJ XM!;__[___O^S_\/\AO__^___[___O__^___@#\ ?_ 'X5%554?__[___ XMO^S_\/\7O__^___[___O__^___X @ /\ ?^_JH&J___[___O^S_\/\2 XMO__^___[___O__^___Z#P #OX "Q_U5%556___[___O^S_\/\2O__^___[ XM___O__^___[_X !/X 7_J_JH&^___[___O^S_\/\ @/0 " _X !_ ! XM__< #_L__#_%K___O__^___[___O__^__X _^ ?^_JH'K_O__^___[_L XM__#_(;___O__^___[___O__^_\> ___@ #_U5515__O__^___[_L__#_%;__ XM_O__^___[___O__^__ ____X ?_^J@BO__O__^___[_L__#_(;___O__^___ XM[___O__^__X/___\#_^U55;___O__^___[_L__#_(;___O__^___[___O__^ XM___C___^__^___[___O__^___[_L__#_(;___O__^___[___O__^___Z?_\ XM/_^___[___O__^___[_L__#_(;___O__^___[___O__^___[_ !__^___[_ XM__O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___ XMO__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[ XM___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^_ XM__[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O_ XM_^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L XM__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;__ XM_O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___ XM[___O__^___[___O__^___[___O__^___[_L__#_ (#A _[/_P_R&___[_ XM__O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^__ XM_[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__ XM^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___ XMO__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[ XM___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[___O__^_ XM[/_P_R&___[___O__^___[___O__^___[___O__^___[___O__^_[/_P_R&_ XM__[___O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O_ XM_^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[__ XM_O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___ XM[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^ XM___[___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[___O XM__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[___O__^_[/_P XM_R&___[___O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[_ XM__O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^__ XM_[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__ XM^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___ XMO__^___[___O__^_[/_P_P" X0 /^S_\/\AO__^___[___O__^___[___O_ XM_^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[__ XM_O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___ XM[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_ XM\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^ XM___[___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[___O XM__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[___O__^___[_ XM__O__^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^__ XM_[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__ XM^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___ XMO^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_\/\A XMO__^___[___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[ XM___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[___O__^_ XM__[___O__^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O_ XM_^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[__ XM_O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___ XM[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_ XM\/\ @.$ #_L__#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___ XMO__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[ XM___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^_ XM__[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O_ XM_^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L XM__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;__ XM_O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___ XM[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^ XM___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O XM__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[_ XM__O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_ (#A _[/_Q_R+\ XM?__Y___G___?__]___W___O___?__]___W___/__\___Q^S_\?\BX___Y___ XMW___O__^___]___[___W___O__^___]___S___CL__'_(Y___Q___S___G__ XM_?__^___^___^___]___S___G___'___/^W_\O\D_'___/___/___?__^___ XM^___^___^___^___]___Y___Y___Q^W_\O\D\___\___\___^___]___^___ XM^___^____?__^___^?__^?__^>W_\O\EC___S___[___]___[___]___^___ XM_?___O___?___O___G___C_N__/_)OQ___\___^?___/___O___W___[___] XM___^___^?___/___G___Q^[_\_\6\___^/___G___[___]___^____O___[^ XM_PQ___^____/___C___Y[O_S_P:/___G___]_O\,?___O___[___^____O[_ XM#;___]____?___S___X_[__T_P#\V@ !^__]/\-\____G___\____O___[^ XM_P/?___[_O\0?___[___^____G___\____GO__3_ X____G^_P8____W___] XM_O\#W___^_[_!G____?___W^_P>?___S___^/_#_]?\'_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[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_ XMN?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y_[G_N?^Y XM_[G_N?^Y_[G_N?^Y_[G_N?^Y_P XM X# X Xend SHAR_EOF if test 16956 -ne `wc -c < demo.uuencode` then echo shar: error transmitting demo.uuencode 'expected 16956 characters' fi Path: kimbal!rick From: rick@kimbal.UUCP (Rick Kimball) Newsgroups: unix-pc.sources,comp.sources.misc Subject: showPaint - show MacPaint Pics on 3b1 Message-ID: <397@kimbal.UUCP> Date: 16 Jan 88 22:34:53 GMT Organization: Mac Source BBS, Altamonte Spgs, FL Lines: 809 Keywords: source Xref: kimbal unix-pc.sources:3 comp.sources.misc:1 Enclosed is a program to display MacPaint pictures on a UNIX-PC. Rick Kimball UUCP:codas!flnexus!kimbal!rick --- Cut Here --- #!bin/sh # shar: Shell Archiver # Run the following text with /bin/sh to create: # README # showPaint.mk # showPaint.c # UnPackBits.c # InvertBits.c # demo.uuencode # echo shar: extracting README '(1120 characters)' sed 's/^X//' << \SHAR_EOF > README X"showPaint" displays MacPaint pictures on a UNIX-PC screen. X XThe source is divided into three files. "showPaint.c" contains the Xdriver source. "UnPackBits.c" is an implementation of the Macintosh Xtoolbox call UnpackBits(). "InvertBits.c" is a functions that swaps Xthe bits in an array of shorts. To run showPaint, upload a XMacintosh MacPaint file to the 3b1. Execute the command: X X $ showPaint paintFile X Xwhere "paintFile" is the MacPaint file. It will locate the data Xfork, unpack and invert the picture, then display the top 300 lines Xcentered on the screen. X XIncluded is a sample MacPaint file called "demo.pntg". It is a snapshot Xof my Mac screen while running a program available from the Boston XComputer Society called "Vanlandingham" (the Mac equivilent to Amiga X"Boing Demo"). You will see I don't try and compensate for the Xacspect ratio (1.5 wide by 1 high ) on the 3b1. But the results are Xquite nice anyways. X XI have compiled this on a 3b1 with version 3.51 of the development Xsystem. I am not sure if it works with other versions. Let me know. X XRick Kimball X XUUCP:codas!flnexus!kimbal!rick SHAR_EOF if test 1120 -ne `wc -c < README` then echo shar: error transmitting README 'expected 1120 characters' fi echo shar: extracting showPaint.mk '(512 characters)' sed 's/^X//' << \SHAR_EOF > showPaint.mk X#------------------------------------------------------------ X# showPaint.mk - UNIX-PC only X#------------------------------------------------------------ X Xinclude $(MAKEINC)/Makepre.h X XCFLAGS = -O X XLDFLAGS = -s X XSRC = showPaint.c UnPackBits.c InvertBits.c X XOBJS = showPaint.o UnPackBits.o InvertBits.o X Xall: showPaint demo.pntg X XshowPaint: $(OBJS) X $(LD) $(SHAREDLIB) $(LDFLAGS) -o $@ $(OBJS) X Xdemo.pntg: X uudecode showPaint.c X/* X Name: showPaint.c X X Machine: UNIX-PC X X Description: This program takes a MacPaint file and displays X it on the UNIX-PC console. It recognizes MacBinary X files (like those stored on CompuServe in the X Macintosh Users Group Data Libraries) and the data X fork from a MacPaint file (like those from usenet). X X Author: Rick Kimball X X UUCP: codas!flnexus!kimbal!rick X X Date: Mon Jan 11 20:37:00 EST 1988 X X This software is Copyright (c) 1988 by Rick Kimball. X X Permission is hereby granted to copy, reproduce, redistribute or X otherwise use this software as long as: there is no monetary X profit gained specifically from the use or reproduction or this X software, it is not sold, rented, traded or otherwise marketed, and X this copyright notice is included prominently in any copy X made. X X The author make no claims as to the fitness or correctness of X this software for any use whatsoever, and it is provided as is. X Any use of this software is at the user's own risk. X X How to do it: X X Given a MacPaint picture named PinUp.MPTG ( either MacBinary X format or the data fork of a MacPaint file), type the X following command to display it on the UNIX-PC console: X X $ showPaint PinUp.MPTG X X*/ X X/* X XINCLUDE FILES X X*/ X X#include X#include X#include X#include X#include X#include X X/* X XDEFINES X X*/ X X/* MacPaint Picture defines */ X X#define MAC_WIDTH 576 /* 576 pixels */ X#define ROW_BYTES 72 /* 576 pixels wide / 8 */ X#define NO_OF_LINES 720 /* 720 line */ X#define MAX_MACPAINT_SIZE 51840L /* ROW_BYTES * NO_OF_LINES */ X X#define CursorOff(w) wprintf(w, "\033[=1C") X X/* X XGLOBALS X X*/ X Xextern int errno, sys_nerr; X Xextern char *sys_errlist[]; X Xchar inputBuffer[MAX_MACPAINT_SIZE]; X Xchar outPutBitImage[MAX_MACPAINT_SIZE]; X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X short width = ROW_BYTES * 8; /* # of pixels colums in a mac pixture */ X short offset = (WINWIDTH/2)-(MAC_WIDTH/2); /* center the pict and scrn */ X short height = WINHEIGHT; /* # of pixel rows on a 25 line screen */ X X /* create a new window just for us */ X X Init(); X X /* Open the MacPaint file and run UnPackBits on it */ X X UnPackPaint(argv[1],inputBuffer); X X /* X Invert the bits in every short. On the Mac the X first pixel is in bit 15 of the first short the X second pixel is in bit 14 and so on. On the X UNIX-PC it is just the opposite, the first pixel is X in bit 0 and the second pixel in bit 1. So you X see, we must flip each bit. X */ X X printf("Inverting BitMap . . .\n"); X X InvertBits((long *)inputBuffer,(long *)outPutBitImage,MAX_MACPAINT_SIZE); X X Show((unsigned short *)outPutBitImage,width,height,offset); X X wexit(0); X} X XInit() X{ X X close(0); close(1); close(2); X if ( (open("/dev/window", O_RDWR)) < 0 ) X { X exit(666); X } X dup(0); dup(0); X X /* Make sure they are on the console */ X X winit(); X X if ( !iswind() ) X { X fprintf(stderr, "Sorry, you must be on the bit-mapped diplay\n"); X wexit(1); X } X} X XUnPackPaint(fileName, outputBuff) Xchar *fileName; Xchar outputBuff[]; X{ X static char workBuffer[MAX_MACPAINT_SIZE + 200]; X FILE *macPaintFP; X long size, SizeFile(); X char **srcPtr, **dstPtr; X int macFD, i; X X if ( (macPaintFP = fopen(fileName,"r")) == NULL ) X { X perror("showPaint: can't open MacPaint file"); X wexit(1); X } X X macFD = fileno(macPaintFP); X X size = SizeFile(fileName); X X if ( (size < 512 ) || (size > MAX_MACPAINT_SIZE) ) X { X fprintf(stderr,"Error: Are you sure %s is a MacPaint file\n", X fileName); X wexit(1); X } X X if ( (read(macFD, workBuffer, size)) != size ) X { X perror("showPaint: error reading MacPaint file"); X wexit(1); X } X X fclose(macPaintFP); X X if ( (strncmp(&workBuffer[65], "PNTGMPNT", 8)) == 0 ) X { X /* X This is a MacBinary file. There is an X additional 128 byte header before the X actual data fork. X */ X srcPtr = (char **)&workBuffer[128 + 512]; X } X else X { X /* X Hopefully this is the data fork of a MacPaint X File. Note we are skipping the patterns (first 512 X bytes) we usually don't need them. X */ X srcPtr = (char **)&workBuffer[512]; X } X X dstPtr = (char **)&outputBuff[0]; X X printf("UnPacking MacPaint Picture . . .\n"); X X for ( i = 0; i < 720; i++) X { X UnPackBits(&srcPtr,&dstPtr,ROW_BYTES); X } X} X Xlong XSizeFile(filen) Xchar *filen; X{ X struct stat buf; X X if (stat(filen, &buf) != 0) X { X perror("showPaint: error in stat"); X wexit(1); X } X return(buf.st_size); X} X XShow(bitImage,width,height,offset) Xunsigned short*bitImage; Xshort width, height, offset; X{ X extern unsigned short patwhite[]; X int w; X int keyPressed; X int returnCode; X X if ( (w = wcreate(0,0,25,80,1)) < 0) X { X perror("showPaint: creating new window "); X wexit(1); X } X X CursorOff(w); X X clear(); X X returnCode = wrastop(w, bitImage, /* srcbase */ X ROW_BYTES, /* srcwidth */ X 0, /* dstbase (screen) */ X 0, /* dstwidth (screen Row Bytes) */ X 0, 0, /* src h, v */ X offset, 0, /* dst h, v */ X width, height, /* width, height */ X SRCXOR, DSTSRC, X patwhite); X if ( returnCode != 0 ) X { X perror("showPaint: error performing raster operation"); X wexit(1); X } X X wprompt( w, "Press any key to continue..."); X X /* wait for the user to press a key */ X X keyPressed = wgetc(w); X X wdelete(w); X} SHAR_EOF if test 6067 -ne `wc -c < showPaint.c` then echo shar: error transmitting showPaint.c 'expected 6067 characters' fi echo shar: extracting UnPackBits.c '(1967 characters)' sed 's/^X//' << \SHAR_EOF > UnPackBits.c X/* X Name: UnPackBits.c X X Synopsis: UnPackBits( char **src, **dst, short rowBytes ); X X Description: See Apple Tech Notes: X #86: MacPaint Document Format X #171: PackBits Data Format X X This software is Copyright (c) 1987 by Rick Kimball. X X Permission is hereby granted to copy, reproduce, redistribute or X otherwise use this software as long as: there is no monetary X profit gained specifically from the use or reproduction or this X software, it is not sold, rented, traded or otherwise marketed, and X this copyright notice is included prominently in any copy X made. X X The author make no claims as to the fitness or correctness of X this software for any use whatsoever, and it is provided as is. X Any use of this software is at the user's own risk. X X Sample Call Sequence: X X char **srcPtr, **dstPtr; X char macPaintFile[(576/8)*720]; X char bitImage[51840]; X X ... X srcPtr = (char **)&macPaintFile[512]; X dstPtr = (char **)&bitImage[0]; X X for( x = 0; x < 720; x++) X { X UnPackBits(&srcPtr,&dstPtr, 576/8); X } X ... X X X*/ X X#define HIGH_BIT_ON 0x80 X XUnPackBits(src, dst, cnt) Xregister unsigned char **src; Xregister unsigned char **dst; Xregister short cnt; X{ X register short noOfBytes; X register unsigned char bit15;; X X if ( cnt <= 0 ) X return(0); X X bit15 = HIGH_BIT_ON; X X while ( cnt ) X { X if ( **src & bit15 ) /* Is High bit set ? */ X { X noOfBytes = abs((char)*(*src)++); X cnt -= ++noOfBytes; X while( noOfBytes-- ) X { X *(*dst)++ = **src; X } X (*src)++; X } X else /* It is a normal zero based counter */ X { X noOfBytes = (char)*(*src)++; X cnt -= ++noOfBytes; X while( noOfBytes-- ) X { X *(*dst)++ = *(*src)++; X } X } X } X return(0); X} SHAR_EOF if test 1967 -ne `wc -c < UnPackBits.c` then echo shar: error transmitting UnPackBits.c 'expected 1967 characters' fi echo shar: extracting InvertBits.c '(2793 characters)' sed 's/^X//' << \SHAR_EOF > InvertBits.c X/* X X Name: InvertBits.c X X Synopsis: InvertBits( unsigned long *src,*dst, int noOfBytes ); X src - input array of shorts; X dst - output array of shorts; X noOfBytes - is the number of characters in the src array; X X Description: This functions is used to convert Apple X Macintosh bit images to UNIX-PC bit images. On a X Mac a bitmap consists of an array of unsigned X shorts. The left most pixel on the first line is in X bit 15 of the first short. The second pixel is in X bit 14 and so on. However, it is just the X opposite on the UNIX-PC. The left most pixel on X the first line for a UNIX-PC is stored in bit 0 X and the next in bit 1 and so on. The purpose of X this function is to swap bit for bit each pixel. X X This software is Copyright (c) 1987 by Rick Kimball. X X Permission is hereby granted to copy, reproduce, redistribute or X otherwise use this software as long as: there is no monetary X profit gained specifically from the use or reproduction or this X software, it is not sold, rented, traded or otherwise marketed, and X this copyright notice is included prominently in any copy X made. X X The author make no claims as to the fitness or correctness of X this software for any use whatsoever, and it is provided as is. X Any use of this software is at the user's own risk. X X Sample Call Sequence: X X X #define MAC_PAINT_SIZE 51840 X ... X X char macPaintImage[MAC_PAINT_SIZE]; X char unixpcBitImage[MAC_PAINT_SIZE]; X X InvertBits((long*)macPaintImage,(long*)unixpcBitImage, MAC_PAINT_SIZE); X ... X X*/ X XInvertBits(srcPtr,dstPtr,noOfBytes) Xregister long *srcPtr, *dstPtr; Xregister long noOfBytes; X{ X register long ONES; X register short bitCnt; X register long tempLong; X X if ( noOfBytes < 0 ) /* Just return if count < 0 */ X return(0); X X noOfBytes = noOfBytes / 4; /* Assuming the size of the array is % 4 */ X X ONES = 0x00010001; /* Let's deal with the short as longs */ X /* to make this go faster */ X while( noOfBytes-- ) X { X *dstPtr = 0L; /* Zero the destination array[x] */ X bitCnt = 15; /* Let's loop through the bits */ X while(bitCnt--) X { X tempLong = *srcPtr & ONES; /* See if this bit is on */ X *dstPtr |= tempLong; X *srcPtr >>= 1; /* lets look at the next bit from the left */ X *dstPtr <<= 1; /* push the result bit it to the left */ X } X tempLong = *srcPtr++ & ONES; X *dstPtr++ |= tempLong; /* deal with the last bit */ X } X return(0); X} SHAR_EOF if test 2793 -ne `wc -c < InvertBits.c` then echo shar: error transmitting InvertBits.c 'expected 2793 characters' fi echo shar: extracting demo.uuencode '(16956 characters)' sed 's/^X//' << \SHAR_EOF > demo.uuencode Xbegin 0 demo.pntg XM ID96UO3BYP;G1G XM !03E1'35!.5 $ /\ (0 "\V XM )X2Z':>$NAW ! "!@=U, XM XM XM XM XM XM XM XM XM XM XM XM /#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___ XMO__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[ XM___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^_ XM__[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O_ XM_^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L XM__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;__ XM_O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___ XM[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^ XM___[___O__^___[___O__^___[_L__#_ (#A _[/_P_R&___[___O__^__ XM_[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__ XM^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___ XMJJJN___[___O__^_[/_P_R&___[___O__^___[___O__^___[__U%5547__[ XM___O__^_[/_P_Q2___[___O__^___[___O__^___[__\J@?_^___[___O^S_ XM\/\AO__^___[___O__^___[___O\ 'U51555%5?^___[___O^S_\/\4O__^ XM___[___O__^___[___N^ !N_*H'J_O__^___[_L__#_(;___O__^___[___ XMO__^___X8 Q45551557O__^___[_L__#_%;___O__^___[___O__^__^/ XM^ ?+\J@:K___O__^_[/_P_R&___[___O__^___[___O_X?_X !_^^%554 XM5553___O__^_[/_P_Q:___[___O__^___[___O_#__\#___@RORJ!?__[___ XMO^S_\/\/O__^___[___O__^___[_'_S_#/ )551555%__^___[_L__#_%K__ XM_O__^___[___O__^_'___@____P _*H%K__O__^_[/_P_Q*___[___O__^__ XM_[___N/___ '_O\+ %5455515__O__^_[/_P_Q>___[___O__^___[___H__ XM_X !___P/_K]J@6K_^___[_L__#_(;___O__^___[___O___/__^ !__X ? XM^51555%5?^___[_L__#_%[___O__^___[___O__X?__X ?_ '^?RJ!+_O XM__^_[/_P_R&___[___O__^___[___O__X #_ ?!4555155_O__^_[/_P XM_QB___[___O__^___[__^'__@ X &!J_:H$K^___[_L__#_ (#U +P XM'_[Y P^0 /^S_\/\/O__^___[___O__^__L '_/X !0/ !P&ORJ ^__ XM_[_L__#_#[___O__^___[___O_^ ?#^ X/X _!Q555%556___[_L__#_ XM#[___O__^___[___O_\ .#^ 4?^ !_@[\J@.O__^_[/_P_P^___[___O_ XM_^___[_L ! _@ .?_X _^/%551555/__^_[/_P_P^___[___O__^___[_X XM #P_@ %__^ !__O_*H#K___O^S_\/\AO__^___[___O__^_\ !_ ___ XMP __]]5545551___O^S_\/\9O__^___[___O__^_X '_@ !___\ __^\K] XMJ@.K__^_[/_P_R&___[___O__^___[_ __@ /___\'__XY551555%__^_ XM[/_P_QF___[___O__^___[\ !__X ?___^/__X,ORJ O__O^S_\/\2O__^ XM___[___O__^^ ___@ ?_S_"?@)55%5545__[_L__#_$;___O__^___[___ XMO ?__\ /W_ Q__^ #\J@*__[_L__#_#;___O__^___[___N _O\ ?W_ XM"P?_^ )5455515__O^S_\/\-O__^___[___O___X '^_P##_O\$_@/_^ /\ XMJ@*__[_L__#_#;___O__^___[___L #_O\ Y_[_#/P __@!]5%5545?_[_L XM__#_#;___O__^___[___ '_O\ ]_[_!?P /_@!^OVJ J__O^S_\/\-O__^ XM___[___O__\X _^_P#A_O\,^ /^ #U455515?_O^S_\/\-O__^___[___O XM__Y^ !_^_PG ?___\ '^ #Z_:H"J_^_[/_P_PV___[___O__^___/\ /_[_ XM$( ____@ 'X 'U1555%5?^_[/_P_PV___[___O__^__^/_ ?_[_"0 /___@ XM !X 'S\J@'_O^S_\/\ @/@ @G_\/[_"OX ___P $ !^^P /^S_\/\, XMO__^___[___O__/__?[_!?P /__@/T 3\J_:H!_[_L__#_#+___O__^___ XM[__G__W^_Q'X !__X P /Q%55455?[_L__#_%+___O__^___[__G__Q_ XM___P ?__X @\ /_RJ ;^_[/_P_Q2___[___O__^__S__X'___\ !_[^ XM D/@!^1555%55^_[/_P_Q2___[___O__^__G__P!___X _[^ ,/X!_* XM_:H!O[_L__#_$+___O__^___[_^?_^ #___ _@ _/X "1_X'\%554557[_L XM__#_$+___O__^___[_\__^ __^ _@ ./X Q_^'^+]J@&OO^S_\/\/O__^ XM___[___O_S__P ___T C^ D?_P_A555%55>_[/_P_P^___[___O__^_^ XM?_^ _^_0 "/X Q__S_+]J@&OO^S_\/\/O__^___[___O_G__@ '_OT XM ![^ D____Q555%55>_[/_P_P^___[___O__^_\__\ '\_0 ''X #__ XM\_C]J@&KO^S_\/\+O__^___[___O_/_^_@ >/T #3_@ ___'Y555%556_ XM[/_P_PN___[___O__^_Y__[^ P_0 '?_ #__\'C]J@&KO^S_\/\+O__^ XM___[___O^?_\^0 -?_P '__^!Q554555;_L__#_"[___O__^___[_/__/X XM !S] C__P ?__X#"K]J@"_[/_P_PN___[___O__^_S__C^ __@ . ?__ XMP !___@"555%556_[/_P_PN___[___O__^_W__#^ T_@ ?__X !___@! XM*OVJ +_L__#_"[___O__^___[^?_\/X $G_@ #___X /__^ '5545553_L XM__#_"[___O__^___[^__X/X #?_X '___^ /__^ 'J_:H O^S_\/\ @/D XM D__X/X !/_^ '_O\% /__^ #@_0 /^S_\/\3O__^___[___O[__ ! XM__\ _^_P7!___X .K]J@"_[/_P_Q.___[___O__^_O_\ /__\ #_[_ XM"O'___@ ]55%554_[/_P_Q.___[___O__^_C_\ /___ '_[_!?W___@ XM>OVJ +_L__#_$[___O__^___[^#_@ !____ __O\*_?__^ !U545551_L XM__#_$[___O__^___[\ _@ !____@ __O\%_'__^ !Z_:H O^S_\/\*O__^ XM___[___OP!_^ /_O\!@'_^_PK\'__X '551555'^S_\/\*O__^___[___O XMP ?^ ?_O\!X'_^_P7X!__X 'K]J@"_[/_P_PF___[___O__^_ _0 '_[_ XM /#]_PKX __X #U51555'^S_\/\*O__^___[___O@ '^ __O\ _?W_!? XM__@ .OVJ *_L__#_#K___O__^___[X !P /_[_ /[]_PKP #_X #U51555 XM'^S_\/\.O__^___[___O@ /P !__O\!_#_^_P7P _X #[]J@"O[/_P_PZ_ XM__[___O__^^ _P '_^_P'\'_[_"N !_@ /55%554?[/_P_PV___[___O_ XM_^\ _X /W_ ?@'_O\%X !\ ^_:H K^S_\/\-O__^___[___O ?_@ #] XM_P'P ?[_"L ' /55%554?[/_P_PV___[___O__^\ !__@ ?W_"O ?___ XMP , ^_:H K^S_\/\-O__^___[___O ?_^ ']_P7@ #___X#] 4]5455 XM51?L__#_#;___O__^___[P /__P#_?\*X /__^ , #[]J@"O[/_P_PV_ XM__[___O__^\ #___ _W_#\ ___@ #P ?545551?L__#_#;___O__^___ XM[@ /___'_?\$@ ___^ (?@![]J@"O[/_P_P" ^@ %!@ /___W_?\$@ XM?__^ (?X![] 7[/_P_PV___[___O__^X '___]_W__@ !'_[^ (?^![] XMJ@"O[/_P_PV___[___O__^X '___\?W__@ !!_[^ ?__X /_VJ :^_[/_P_P" ^0 &"" XM?___X?W_!X ?__@ !__ /^S_\/\0O__^___[___O_! ?___X'_^_P< XM !__P ?OVJ :^_[/_P_R&___[___O__^_\# !____ /____@ #_^ #_ XM555%55^_[/_P_QN___[___O__^_^#@!____ #____ _^ #^_:H!O[_L XM__#_$[___O__^___[_X/@'___X #___\_@ *_P ?U55455?[_L__#_$[__ XM_O__^___[_\'X'___X ___X_@ $?@ _K]J@&_O^S_\/\3O__^___[___O XM_P?X?___ !___#^ H> #^555155_O^S_\/\3O__^___[___O_X?\?___ XM ?_^#^ 0$ '^OVJ ?^_[/_P_Q.___[___O__^__@_]___X ?_P/X XM"@8 ?Q555%5?^_[/_P_Q.___[___O__^__P_^___X '_P/X ! \ _J XM_JH"J_^_[/_P_PZ___[___O__^__X?^/__S^ '_@/X "A_ !_1555%5_^_ XM[/_P_PZ___[___O__^__X?^'__S^ __0 $'_ '^K^J@*K_[_L__#_#K__ XM_O__^___[__Q_X'_^/X [] H__ _T55515?_O^S_\/\.O__^___[___O XM__C_@'_X_@ !/T W_^ '_]J@*O_[_L__#_#K___O__^___[__X_X _^/X XM +] K__X#_455515__O^S_\/\.O__^___[___O__Q_P _P_@ (!X '_ XM_^#^_:H"O_^_[/_P_PZ___[___O__^___G_ _#^ \/X ___^?U1555% XM?_^_[/_P_PZ___[___O__^___S_ .#^ 0?\ !_[_ /K]J@+__[_L__#_ XM#K___O__^___[___'\ 8/X #S_\ /___X_5%5547__[_L__#_#K___O__ XM^___[___G\ (/X "'__ ?___P.OZJ ZO__[_L__#_ (#W -/P X_@ ' XM___ #___^#Z _[/_P_QJ___[___O__^___[?@ #X '__^ ?___P"K^ XMJ@.O__^_[/_P_Q6___[___O__^___[O@ '\ /___@ _O\(@%51555/__^_ XM[/_P_Q6___[___O__^___[S@ '_ ?___X!_O\ /VJ Z___[_L__#_$;__ XM_O__^___[___OG __ #_[_# /___X!55%556___[_L__#_$;___O__^___ XM[___OQ __P '_[_!,?___P"_:H#[___O^S_\/\1O__^___[___O__^_" #_ XM_@ __O\,[___^ 554555[___O^S_\/\1O__^___[___O__^_A@'__X!__O\$ XMP___\ K^J@2K[___O^S_\/\0O__^___[___O__^_QP'__^#]_PR!___@%551 XM55?O__^_[/_P_Q"___[___O__^___[_CP?__\_[_!?X ?_^ *OZJ!*_O__^_ XM[/_P_Q"___[___O__^___[_Y\___^_[_#?P '_\ 555157_O__^_[/_P_PR_ XM__[___O__^___[_]_O\ \/[_!/ !_X _:H$_^___[_L__#_(;___O__^___ XM[___O_[]___ /___X #^ !555%5_^___[_L__#_&+___O__^___[___O__\ XM?_^ '___@ \ K^J@6K_^___[_L__#_$[___O__^___[___O__X'_X !___ XM_0 )%%5545__[___O^S_\/\3O__^___[___O__^___@/_ !__S^ %P*OZJ XM!;__[___O^S_\/\AO__^___[___O__^___@#\ ?_ 'X5%554?__[___ XMO^S_\/\7O__^___[___O__^___X @ /\ ?^_JH&J___[___O^S_\/\2 XMO__^___[___O__^___Z#P #OX "Q_U5%556___[___O^S_\/\2O__^___[ XM___O__^___[_X !/X 7_J_JH&^___[___O^S_\/\ @/0 " _X !_ ! XM__< #_L__#_%K___O__^___[___O__^__X _^ ?^_JH'K_O__^___[_L XM__#_(;___O__^___[___O__^_\> ___@ #_U5515__O__^___[_L__#_%;__ XM_O__^___[___O__^__ ____X ?_^J@BO__O__^___[_L__#_(;___O__^___ XM[___O__^__X/___\#_^U55;___O__^___[_L__#_(;___O__^___[___O__^ XM___C___^__^___[___O__^___[_L__#_(;___O__^___[___O__^___Z?_\ XM/_^___[___O__^___[_L__#_(;___O__^___[___O__^___[_ !__^___[_ XM__O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___ XMO__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[ XM___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^_ XM__[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O_ XM_^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L XM__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;__ XM_O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___ XM[___O__^___[___O__^___[___O__^___[_L__#_ (#A _[/_P_R&___[_ XM__O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^__ XM_[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__ XM^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___ XMO__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[ XM___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[___O__^_ XM[/_P_R&___[___O__^___[___O__^___[___O__^___[___O__^_[/_P_R&_ XM__[___O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O_ XM_^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[__ XM_O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___ XM[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^ XM___[___O__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[___O XM__^_[/_P_R&___[___O__^___[___O__^___[___O__^___[___O__^_[/_P XM_R&___[___O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[_ XM__O__^___[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^__ XM_[___O__^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__ XM^___[___O__^___[___O__^_[/_P_R&___[___O__^___[___O__^___[___ XMO__^___[___O__^_[/_P_P" X0 /^S_\/\AO__^___[___O__^___[___O_ XM_^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[__ XM_O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___ XM[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_ XM\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^ XM___[___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[___O XM__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[___O__^___[_ XM__O__^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^__ XM_[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__ XM^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___ XMO^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_\/\A XMO__^___[___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[ XM___O__^___[___O__^___[___O__^___[___O^S_\/\AO__^___[___O__^_ XM__[___O__^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O_ XM_^___[___O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[__ XM_O__^___[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___ XM[___O^S_\/\AO__^___[___O__^___[___O__^___[___O__^___[___O^S_ XM\/\ @.$ #_L__#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___ XMO__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[ XM___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^_ XM__[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O_ XM_^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L XM__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;__ XM_O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___ XM[___O__^___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^ XM___[___O__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O XM__^___[___O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[_ XM__O__^___[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^__ XM_[_L__#_(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_ XM(;___O__^___[___O__^___[___O__^___[___O__^___[_L__#_(;___O__ XM^___[___O__^___[___O__^___[___O__^___[_L__#_ (#A _[/_Q_R+\ XM?__Y___G___?__]___W___O___?__]___W___/__\___Q^S_\?\BX___Y___ XMW___O__^___]___[___W___O__^___]___S___CL__'_(Y___Q___S___G__ XM_?__^___^___^___]___S___G___'___/^W_\O\D_'___/___/___?__^___ XM^___^___^___^___]___Y___Y___Q^W_\O\D\___\___\___^___]___^___ XM^___^____?__^___^?__^?__^>W_\O\EC___S___[___]___[___]___^___ XM_?___O___?___O___G___C_N__/_)OQ___\___^?___/___O___W___[___] XM___^___^?___/___G___Q^[_\_\6\___^/___G___[___]___^____O___[^ XM_PQ___^____/___C___Y[O_S_P:/___G___]_O\,?___O___[___^____O[_ XM#;___]____?___S___X_[__T_P#\V@ !^__]/\-\____G___\____O___[^ XM_P/?___[_O\0?___[___^____G___\____GO__3_ X____G^_P8____W___] XM_O\#W___^_[_!G____?___W^_P>?___S___^/_#_]?\'_'___\?___[^_P// XM___[_O\#O___^_[_$;____O___Y____O___\?___Q_#_]?\ \_[_ S____G^ XM_P.____W_O\#O___^_[_ [____W^_P.____S_O\#G___^?#_]?\#C____/[_ XM .?^_P-____W_O\#?___^_[_ ]____W^_P/?___\_O\$Y____C_Q__;_!/Y_ XM___S_O\#G____O[_ ._^_P-____[_O\#W____O[_ ._^_P,____Y_O\ S_'_ XM]O\ \?[_ ,_^_P-____Y_O\#W____O[_ /O^_P#O_O\#?___\_[_!]____Y_ XM___Q\?_V_P>/___^/____/[_ /?^_P.____^_O\ ^_[_ ._^_P.____]_O\ XMY_[_!(____X_\O_W_P3^?___^?[_ //^_P#O_O\#?____O[_ /O^_P#O_O\# XMW____O[_ /G^_P#S_O\ S_+_]_\ \-0 'R__?_ (_^_P"?_O\ O_[_ W__ XM__W^_P#]_O\ ^_[_ /?^_P#W_O\ W_[_ +_^_P0____^/_/_^/\,_G____Y_ XM___^?____O[_ /W^_P#[_O\ ^_[_ /O^_P#W_O\ [_[_ ,_^_P#/_O\ S_/_ XM^/\ \?[_ /'^_P#Y_O\ ^?[_ /O^_P#[_O\ ^_[_ /O^_P#[_O\ \_[_ //^ XM_P#Q_O\ \?/_^/\ C_[_ ,_^_P#W_O\ ]_[_ /?^_P#W_O\ ^_[_ /W^_P#] XM_O\ _?[_ /W^_P7^?____C_T__G_ ?Y__O\ /_[_ ,_^_P#O_O\ [_[_ /?^ XM_P#[_O\ _?[_ /[^_P#^_O\!_G_^_P"?_O\ S_3_^?\ \?[_ /S]_P __O\ XMW_[_ -_^_P#W_O\ ^_[_ /W]_P!__O\ ?_[_ )_^_P#G_O\ \?3_N?^Y_[G_ XMN?^Y_[G_N?^Y_[G_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