亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? transform.c

?? 可以在msdos下用bc3編譯通過的, 上面1中的代碼是無法編譯通過的, 在MSDOS下學(xué)習(xí)的可以下載這個版本, 可以省去不少在MSDOS編譯時的痛苦時光.
?? C
字號:
/* * transform.c * Calculate coefficients for tranformation equation * Copyright (C) 1999 Bradley D. LaRonde <brad@ltc.com> * * This program is free software; you may redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#include "windows.h"#include "mou_tp.h"#include "transform.h"int CalcTransformationCoefficientsSimple(CALIBRATION_PAIRS *pcp, TRANSFORMATION_COEFFICIENTS *ptc){	/*	 * This is my simple way of calculating some of the coefficients -	 * enough to do a simple scale and translate.	 * It ignores any dependencies between axiis (rotation and/or skew).	 */	int min_screen_x = pcp->ul.screen.x;	int min_screen_y = pcp->ul.screen.y;	int max_screen_x = pcp->lr.screen.x;	int max_screen_y = pcp->lr.screen.y;	int min_device_x = pcp->ul.device.x;	int min_device_y = pcp->ul.device.y;	int max_device_x = pcp->lr.device.x;	int max_device_y = pcp->lr.device.y;	ptc->s = (1 << 16);	ptc->a = ptc->s * (min_screen_x - max_screen_x) / (min_device_x - max_device_x);	ptc->b = 0;	ptc->c = (ptc->a * -min_device_x) + (ptc->s * min_screen_x);	ptc->d = 0;	ptc->e = ptc->s * (min_screen_y - max_screen_y) / (min_device_y - max_device_y);	ptc->f = (ptc->e * -min_device_y) + (ptc->s * min_screen_y);	return 0;}int CalcTransformationCoefficientsBetter(CALIBRATION_PAIRS *pcp, TRANSFORMATION_COEFFICIENTS *ptc){	/*	 * Janus (the man) <janus@place.org> came up with a much better way	 * to figure the coefficients.  His original algorithm was written in MOO.	 * Jay Carlson <> did the translation to C.	 * This way takes into account inter-axis dependency like rotation and skew.	 */	double vector[3][2] =	{		{pcp->ul.screen.x, pcp->ul.screen.y},		{pcp->ur.screen.x, pcp->ur.screen.y},		{pcp->lr.screen.x, pcp->lr.screen.y}	};	double matrix[3][3] =	{		{pcp->ul.device.x, pcp->ul.device.y, 1.0},		{pcp->ur.device.x, pcp->ur.device.y, 1.0},		{pcp->lr.device.x, pcp->lr.device.y, 1.0}	};	int i, j, r, k;	double p, q;    	for (i = 0; i < 3; i++) {          p = matrix[i][i];                    for (j = 0; j < 3; j++) {               matrix[i][j] = matrix[i][j] / p;          }                    for (j = 0; j < 2; j++) {               vector[i][j] = vector[i][j] / p;          }          for (r = 0; r < 3; r++) {               if (r != i) {                    q = matrix[r][i];                                        matrix[r][i] = 0.0;                                        for (k = i + 1; k < 3; k++) {                         matrix[r][k] = matrix[r][k] - (q * matrix[i][k]);                    }                                        for (k = 0; k < 2; k++) {                         vector[r][k] = vector[r][k] - (q * vector[i][k]);                    }               }          }	}	ptc->s = 1 << 16;	ptc->a = vector[0][0] * ptc->s;	ptc->b = vector[1][0] * ptc->s;	ptc->c = vector[2][0] * ptc->s;	ptc->d = vector[0][1] * ptc->s;	ptc->e = vector[1][1] * ptc->s;	ptc->f = vector[2][1] * ptc->s;	return 0;}int CalcTransformationCoefficientsEvenBetter(CALIBRATION_PAIRS *pcp, TRANSFORMATION_COEFFICIENTS *ptc){	/*	 * Mike Klar <> added the an xy term to correct for trapezoidial distortion.	 */	double vector[4][2] =	{		{pcp->ul.screen.x, pcp->ul.screen.y},		{pcp->ur.screen.x, pcp->ur.screen.y},		{pcp->lr.screen.x, pcp->lr.screen.y},		{pcp->ll.screen.x, pcp->ll.screen.y}	};	double matrix[4][4] =	{		{pcp->ul.device.x, pcp->ul.device.x * pcp->ul.device.y, pcp->ul.device.y, 1.0},		{pcp->ur.device.x, pcp->ur.device.x * pcp->ur.device.y, pcp->ur.device.y, 1.0},		{pcp->lr.device.x, pcp->lr.device.x * pcp->lr.device.y, pcp->lr.device.y, 1.0},		{pcp->ll.device.x, pcp->ll.device.x * pcp->ll.device.y, pcp->ll.device.y, 1.0}	};	int i, j, r, k;	double p, q;    	for (i = 0; i < 4; i++) {          p = matrix[i][i];                    for (j = 0; j < 4; j++) {               matrix[i][j] = matrix[i][j] / p;          }                    for (j = 0; j < 2; j++) {               vector[i][j] = vector[i][j] / p;          }          for (r = 0; r < 4; r++) {               if (r != i) {                    q = matrix[r][i];                                        matrix[r][i] = 0.0;                                        for (k = i + 1; k < 4; k++) {                         matrix[r][k] = matrix[r][k] - (q * matrix[i][k]);                    }                                        for (k = 0; k < 2; k++) {                         vector[r][k] = vector[r][k] - (q * vector[i][k]);                    }               }          }	}	/* I just drop the xy coefficient since it is so small. */	ptc->s = 1 << 16;	ptc->a = vector[0][0] * ptc->s;	ptc->b = vector[2][0] * ptc->s;	ptc->c = vector[3][0] * ptc->s;	ptc->d = vector[0][1] * ptc->s;	ptc->e = vector[2][1] * ptc->s;	ptc->f = vector[3][1] * ptc->s;	return 0;}int CalcTransformationCoefficientsBest(CALIBRATION_PAIRS *pcp, TRANSFORMATION_COEFFICIENTS *ptc){	/*	 * Mike Klar <> came up with a best-fit solution that works best.	 */	const int first_point = 0;	const int last_point = 4;	int i;	double Sx=0, Sy=0, Sxy=0, Sx2=0, Sy2=0, Sm=0, Sn=0, Smx=0, Smy=0, Snx=0, Sny=0, S=0;	double t1, t2, t3, t4, t5, t6, q;	/* cast the struct to an array - hacky but ok */	CALIBRATION_PAIR *cp = (CALIBRATION_PAIR*)pcp;	/*	 * Do a best-fit calculation for as many points as we want, as	 * opposed to an exact fit, which can only be done against 3 points.	 *	 * The following calculates various sumnations of the sample data	 * coordinates.  For purposes of naming convention, x and y	 * refer to device coordinates, m and n refer to screen	 * coordinates, S means sumnation.  x2 and y2 are x squared and	 * y squared, S by itself is just a count of points (= sumnation	 * of 1).	 */	for (i = first_point; i < last_point + 1; i++) {		Sx += cp[i].device.x;		Sy += cp[i].device.y;		Sxy += cp[i].device.x * cp[i].device.y;		Sx2 += cp[i].device.x * cp[i].device.x;		Sy2 += cp[i].device.y * cp[i].device.y;		Sm += cp[i].screen.x;		Sn += cp[i].screen.y;		Smx += cp[i].screen.x * cp[i].device.x;		Smy += cp[i].screen.x * cp[i].device.y;		Snx += cp[i].screen.y * cp[i].device.x;		Sny += cp[i].screen.y * cp[i].device.y;		S += 1;	}#if 0	printf("%f, %f, %f, %f, "	       "%f, %f, %f, %f, "	       "%f, %f, %f, %f\n",	        Sx, Sy, Sxy, Sx2, Sy2, Sm, Sn, Smx, Smy, Snx, Sny, S);#endif	/*	 * Next we solve the simultaneous equations (these equations minimize	 * the sum of the square of the m and n error):	 *	 *    | Sx2 Sxy Sx |   | a d |   | Smx Snx |	 *    | Sxy Sy2 Sy | * | b e | = | Smy Sny |	 *    | Sx  Sy  S  |   | c f |   | Sm  Sn  |	 *	 * We could do the matrix solution in code, but that leads to several	 * divide by 0 conditions for cases where the data is truly solvable	 * (becuase those terms cancel out of the final solution), so we just	 * give the final solution instread.  t1 through t6 and q are just	 * convenience variables for terms that are used repeatedly - we could	 * calculate each of the coefficients directly at this point with a	 * nasty long equation, but that would be extremly inefficient.	 */	t1 = Sxy * Sy - Sx * Sy2;	t2 = Sxy * Sx - Sx2 * Sy;	t3 = Sx2 * Sy2 - Sxy * Sxy;	t4 = Sy2 * S - Sy * Sy;	t5 = Sx * Sy - Sxy * S;	t6 = Sx2 * S - Sx * Sx;	q = t1 * Sx + t2 * Sy + t3 * S;	/*	 * If q = 0, then the data is unsolvable.  This should only happen	 * when there are not enough unique data points (less than 3 points	 * will give infinite solutions), or at least one of the 	 * coefficients is infinite (which would indicate that the same	 * device point represents an infinite area of the screen, probably	 * as a result of the same device data point given for 2 different	 * screen points).  The first condition should never happen, since	 * we're always feeding in at least 3 unique screen points.  The	 * second condition would probably indicate bad user input or the	 * touchpanel device returning bad data.	 */	if (q == 0)		return -1;	ptc->s = 1 << 16;	ptc->a = ((t4 * Smx + t5 * Smy + t1 * Sm) / q + 0.5/65536) * ptc->s;	ptc->b = ((t5 * Smx + t6 * Smy + t2 * Sm) / q + 0.5/65536) * ptc->s;	ptc->c = ((t1 * Smx + t2 * Smy + t3 * Sm) / q + 0.5/65536) * ptc->s;	ptc->d = ((t4 * Snx + t5 * Sny + t1 * Sn) / q + 0.5/65536) * ptc->s;	ptc->e = ((t5 * Snx + t6 * Sny + t2 * Sn) / q + 0.5/65536) * ptc->s;	ptc->f = ((t1 * Snx + t2 * Sny + t3 * Sn) / q + 0.5/65536) * ptc->s;	/*	 * Finally, we check for overflow on the fp to integer conversion,	 * which would also probably indicate bad data.	 */	if ( (ptc->a == 0x80000000) || (ptc->b == 0x80000000) ||	     (ptc->c == 0x80000000) || (ptc->d == 0x80000000) ||	     (ptc->e == 0x80000000) || (ptc->f == 0x80000000) )		return -1;		return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆传媒一区二区三区| 欧美一级二级三级乱码| 制服丝袜激情欧洲亚洲| 国产精品免费久久| 日本成人在线不卡视频| 色婷婷精品久久二区二区蜜臂av | 国产精品国产三级国产普通话99| 亚洲国产欧美在线| 99在线精品免费| 欧美国产亚洲另类动漫| 久久电影网站中文字幕| 欧美高清你懂得| 亚洲综合色区另类av| 成人av在线影院| 国产亚洲一区字幕| 国产综合一区二区| 日韩视频免费观看高清完整版在线观看 | 麻豆成人久久精品二区三区红| 91黄色免费看| 亚洲天堂网中文字| 成人性生交大片免费看中文| 久久久久久一级片| 国产在线视频一区二区| 欧美成人一级视频| 九色综合狠狠综合久久| 日韩欧美国产综合| 久久99国产精品免费网站| 欧美一区二区久久久| 天堂一区二区在线免费观看| 欧美日韩精品欧美日韩精品一| 亚洲一区二区三区中文字幕在线| 在线亚洲一区观看| 亚洲国产一区二区在线播放| 欧美在线影院一区二区| 亚洲一区二区三区四区五区黄| 在线免费观看日韩欧美| 一区二区三区在线观看欧美| 欧美系列在线观看| 日本免费在线视频不卡一不卡二 | 精品一区二区三区久久| 欧美va亚洲va香蕉在线| 国产精品一区二区三区网站| 国产拍揄自揄精品视频麻豆| 99视频有精品| 亚洲在线成人精品| 3751色影院一区二区三区| 美女网站在线免费欧美精品| 久久人人超碰精品| 91原创在线视频| 亚洲高清视频在线| 日韩精品在线一区| 成人综合婷婷国产精品久久蜜臀| 亚洲欧美一区二区三区国产精品| 在线精品视频一区二区三四| 日本不卡中文字幕| 国产人久久人人人人爽| 色综合天天综合给合国产| 肉丝袜脚交视频一区二区| 26uuu另类欧美亚洲曰本| 成人av网在线| 亚洲www啪成人一区二区麻豆| 欧美成人伊人久久综合网| 成人黄色小视频| 午夜一区二区三区视频| 久久精品欧美日韩精品| 欧美午夜精品久久久久久孕妇| 久久 天天综合| 亚洲制服丝袜一区| 久久综合99re88久久爱| 欧美午夜电影网| 国产成人欧美日韩在线电影| 午夜精彩视频在线观看不卡| 欧美激情在线一区二区| 91精品国产综合久久香蕉的特点| 福利一区福利二区| 日本成人在线看| 一区二区三区日韩精品视频| 精品久久久久99| 在线观看中文字幕不卡| 国产精品综合二区| 亚洲线精品一区二区三区八戒| 国产午夜精品理论片a级大结局| 欧美精品v国产精品v日韩精品 | 99精品国产91久久久久久| 免费看欧美美女黄的网站| 亚洲精品国产精华液| 国产亚洲一区二区在线观看| 欧美精品 日韩| 91在线小视频| 成人性生交大片免费看视频在线| 蜜臀av亚洲一区中文字幕| 亚洲综合另类小说| 中文字幕在线播放不卡一区| 久久这里都是精品| 日韩精品一区二区三区在线观看| 欧美日韩国产小视频在线观看| 91亚洲永久精品| 成人一区二区三区视频 | 91在线观看地址| 国产高清不卡二三区| 免费精品视频最新在线| 日韩av网站免费在线| 一区二区三区不卡视频在线观看| 日韩美女视频一区| 国产精品成人午夜| 国产精品女同一区二区三区| 国产婷婷一区二区| 久久久不卡网国产精品二区| 精品国产免费人成在线观看| 日韩一区二区三区视频| 在线综合视频播放| 欧美一区二区网站| 日韩欧美在线影院| 日韩欧美国产wwwww| 久久人人爽人人爽| 欧美国产国产综合| 国产精品国产三级国产a| 国产精品久久福利| 亚洲欧美偷拍另类a∨色屁股| 亚洲欧美日韩久久| 亚洲国产精品影院| 人人精品人人爱| 国产在线观看免费一区| 国产成人综合网| 成人免费电影视频| 日本乱码高清不卡字幕| 欧美伦理影视网| 欧美成人bangbros| 国产日韩v精品一区二区| 亚洲少妇30p| 午夜欧美一区二区三区在线播放| 麻豆国产精品视频| 成人高清伦理免费影院在线观看| 99精品黄色片免费大全| 欧美军同video69gay| 久久先锋影音av鲁色资源网| 国产精品进线69影院| 午夜在线电影亚洲一区| 国产美女精品人人做人人爽| 99免费精品在线| 51精品久久久久久久蜜臀| 久久久久88色偷偷免费| 悠悠色在线精品| 麻豆成人免费电影| 色悠久久久久综合欧美99| 日韩欧美在线一区二区三区| 国产精品久久久久久久久晋中 | 精品久久久久99| 日韩一区有码在线| 免费精品99久久国产综合精品| 成人影视亚洲图片在线| 欧美伦理影视网| 国产精品久久久一本精品 | 处破女av一区二区| 欧美视频精品在线观看| 国产亚洲女人久久久久毛片| 亚洲午夜久久久久久久久电影院| 国产精品系列在线观看| 欧美日韩高清在线| 国产精品无圣光一区二区| 日韩成人免费电影| 91在线一区二区三区| 精品国产一区二区三区久久久蜜月 | 国产一区二区三区| 欧洲视频一区二区| 国产日本欧美一区二区| 日本v片在线高清不卡在线观看| 99久久99久久综合| 久久久久9999亚洲精品| 免费高清视频精品| 欧洲一区二区三区在线| 欧美极品xxx| 国产一区二区三区久久悠悠色av| 欧美系列亚洲系列| 国产精品久久久久精k8| 国产精品一区三区| 91精品国产91久久综合桃花 | 欧美日韩国产片| 国产精品久久久久毛片软件| 国产一区二区不卡在线| 欧美高清视频不卡网| 亚洲网友自拍偷拍| 99国产精品国产精品毛片| 久久免费美女视频| 极品少妇一区二区三区精品视频| 9191久久久久久久久久久| 亚洲一区中文日韩| 在线视频国内一区二区| 日韩理论片在线| 91浏览器入口在线观看| 中文字幕中文字幕一区二区| 高清不卡在线观看| 亚洲国产精品国自产拍av| 国产电影精品久久禁18| 国产午夜精品一区二区三区视频| 国产曰批免费观看久久久| 26uuu国产一区二区三区| 久久国产尿小便嘘嘘尿| 久久色在线视频| 国产成人无遮挡在线视频|