/* * main program to drive CCITT Group 4 decompression */ #include "g4codec.h" #include #include #include #include #include #define _BYTE_ASCII #ifdef _BYTE_ASCII #define _BYTE_ZERO 0x30 #define _BYTE_ONE 0x31 #else #define _BYTE_ZERO 0x00 // _BYTE_BINARY #define _BYTE_ONE 0x01 // _BYTE_BINARY #endif /* * This Program extracts a compressed image from the file pointer passed, * stripping the file header and loads it into memory. It gets the * dimensions of the resultant pixrect image from the compressed header * and allocates the pixrect structure. It reverses the bits in the * compressed image and calls decompress4() for decompression. The * pixrect structure is used so the image can be displayed. */ int convertFromByte(char *inData, char *outData, int total, int width, int height) { int in, out, maxOut; char outByte; int inVal; maxOut = width * height; outByte = 0; out = 0; for (in=0; in