⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 txt2tif.h

📁 把文本文件转化成TIF文件的函数基本上传真专用的
💻 H
字号:
//
// class CTextToG3 definition
// Text to G3 Format tiff
//
#include <stdio.h>
#include <string.h>

#ifdef DEBUG
  #undef DEBUG
#endif

#define     CODELEN		105
#define		PAGEWIDTH	1728
#define		PAGEHEIGHT	2291 
#define 	MAXWIDTH	1728/8
#define 	MAXLENGTH	64
#define 	MAXLINE		70
#define 	TRUE 		1
#define 	FALSE 		0
#define		MAX(x,y) 	(((x)>(y))?(x):(y))

#define		MAXNUMHZK	7
#define     TAGNUM    16
#define     __int8    char
#define     __int16   short
#define     __int32   long
#define     WORD      short
//#define     DWORD     long


struct Hufm_BIT {
	unsigned int nNumber;
	char bLen;
	unsigned int bDat;
	char wLen;
	unsigned int wDat;
};


struct HZBLOCK{
	int nLength;
	char HZK_FILE[9];
};


struct TIFF_FIELD{
	__int16 tag_types;
	__int16 number_size;
	__int32 length;
	__int32 offset;
};


	// change txt file to TIFF format file
	// return 1 if can't open text file
	// return 2 if can't open tiff file
	// return 0 if success
	// int Txt2Tiff(char *cTxtName,char *cTiffName, short nPageLines);

	// about hufm coder
	unsigned int Img2G3(unsigned char *imgbuff,unsigned char *g3buff);
	void fill(unsigned char *g3buff);
	void GetSer(unsigned char *g3buff);

	// about change
	void zoutch(int x,int y,unsigned char *ch,int zt);
	void zouttext(int x,int y,unsigned char *textstring,int zt);
	void zoutasc(int x, int y,unsigned char ch,int zt);
	unsigned char ReverseByte(unsigned char c);
	void get_line(FILE *fp,unsigned char *cTextLine);
	int WriteG3Line(FILE *fp,unsigned char *cTextLine,int zt);

	void WriteTiffHead(FILE *fp);

	// about hufm coder
	//static Hufm_BIT bit[CODELEN];
	unsigned int imgPoint;
	unsigned int g3Point;
	unsigned char g3Bit;
	char  bw; //0--white,1--black

	// about change
	unsigned char img_buff[2291][MAXWIDTH];

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -