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

📄 sample.c

📁 JPEG解压软件,包含PC端的测试程序,程序结构比较清晰
💻 C
字号:

#include "sample.h"

#define ResampleOneLine() {\
	out			= outData ;\
	in			= inData + ( * addrH ++ ) * lineBytes;\
	addrWx		= addrW ;\
	j			= lWidthx ;\
	while( --j >= 0 ) {\
		out[0]	= in[ addrWx[0] ] ;\
		out[1]	= in[ addrWx[1] ] ;\
		out[2]	= in[ addrWx[2] ] ;\
		out[3]	= in[ addrWx[3] ] ;\
		out		+= 4;\
		addrWx	+= 4;\
	}\
	outData		+= lWidth ;\
}

void resample( register MShort * addrW, register MShort * addrH, MByte *inData, register MByte *outData, int lineBytes, int LineCount, register int lWidth ) {

	register int j ;
	register MByte * out ;
	register MByte * in ;
	register MShort * addrWx ;

	register int lWidthx	= lWidth >> 2 ;

	switch (lWidth & 3) {
	case 0:
		while ( -- LineCount >= 0 ) {
			ResampleOneLine();
		}
		break;
	case 1:
		while ( -- LineCount >= 0 ) {
			ResampleOneLine();
			out[0]	= in[ addrWx[0] ] ;
		}
		break;
	case 2:
		while ( -- LineCount >= 0 ) {
			ResampleOneLine();
			out[0]	= in[ addrWx[0] ] ;
			out[1]	= in[ addrWx[1] ] ;
		}
		break;
	default:
		while ( -- LineCount >= 0 ) {
			ResampleOneLine();
			out[0]	= in[ addrWx[0] ] ;
			out[1]	= in[ addrWx[1] ] ;
			out[2]	= in[ addrWx[2] ] ;
		}
		break;
	}
}

⌨️ 快捷键说明

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