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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? calibrate.c

?? STM32+Grlib
?? C
字號:
/* * *   Copyright (c) 2001, Carlos E. Vidales. All rights reserved. * *   This sample program was written and put in the public domain  *    by Carlos E. Vidales.  The program is provided "as is"  *    without warranty of any kind, either expressed or implied. *   If you choose to use the program within your own products *    you do so at your own risk, and assume the responsibility *    for servicing, repairing or correcting the program should *    it prove defective in any manner. *   You may copy and distribute the program's source code in any  *    medium, provided that you also include in each copy an *    appropriate copyright notice and disclaimer of warranty. *   You may also modify this program and distribute copies of *    it provided that you include prominent notices stating  *    that you changed the file(s) and the date of any change, *    and that you do not charge any royalties or licenses for  *    its use. *  * *  *   File Name:  calibrate.c * * *   This file contains functions that implement calculations  *    necessary to obtain calibration factors for a touch screen *    that suffers from multiple distortion effects: namely,  *    translation, scaling and rotation. * *   The following set of equations represent a valid display  *    point given a corresponding set of touch screen points: * * *                                              /-     -\ *              /-    -\     /-            -\   |       | *              |      |     |              |   |   Xs  | *              |  Xd  |     | A    B    C  |   |       | *              |      |  =  |              | * |   Ys  | *              |  Yd  |     | D    E    F  |   |       | *              |      |     |              |   |   1   | *              \-    -/     \-            -/   |       | *                                              \-     -/ * *  *    where: * *           (Xd,Yd) represents the desired display point  *                    coordinates, * *           (Xs,Ys) represents the available touch screen *                    coordinates, and the matrix * *           /-   -\ *           |A,B,C| *           |D,E,F| represents the factors used to translate *           \-   -/  the available touch screen point values *                    into the corresponding display  *                    coordinates. * * *    Note that for practical considerations, the utilitities  *     within this file do not use the matrix coefficients as *     defined above, but instead use the following  *     equivalents, since floating point math is not used: * *            A = An/Divider  *            B = Bn/Divider  *            C = Cn/Divider  *            D = Dn/Divider  *            E = En/Divider  *            F = Fn/Divider  * * * *    The functions provided within this file are: * *          setCalibrationMatrix() - calculates the set of factors *                                    in the above equation, given *                                    three sets of test points. *               getDisplayPoint() - returns the actual display *                                    coordinates, given a set of *                                    touch screen coordinates. * translateRawScreenCoordinates() - helper function to transform *                                    raw screen points into values *                                    scaled to the desired display *                                    resolution. * * */#define _CALIBRATE_C_/****************************************************//*                                                  *//* Included files                                   *//*                                                  *//****************************************************/#include "stm32f10x.h"#include "Calibrate.h"
#include "usart.h"/****************************************************//*                                                  *//* Local Definitions and macros                     *//*                                                  *//****************************************************//****************************************************//*                                                  *//* Global variables                                 *//*                                                  *//****************************************************//****************************************************//*                                                  *//* Forward Declaration of local functions           *//*                                                  *//****************************************************//********************************************************************** * *     Function: setCalibrationMatrix() * *  Description: Calling this function with valid input data *                in the display and screen input arguments  *                causes the calibration factors between the *                screen and display points to be calculated, *                and the output argument - matrixPtr - to be  *                populated. * *               This function needs to be called only when new *                calibration factors are desired. *                *   *  Argument(s): displayPtr (input) - Pointer to an array of three  *                                     sample, reference points. *               screenPtr (input) - Pointer to the array of touch  *                                    screen points corresponding  *                                    to the reference display points. *               matrixPtr (output) - Pointer to the calibration  *                                     matrix computed for the set  *                                     of points being provided. * * *  From the article text, recall that the matrix coefficients are *   resolved to be the following: * * *      Divider =  (Xs0 - Xs2)*(Ys1 - Ys2) - (Xs1 - Xs2)*(Ys0 - Ys2) * * * *                 (Xd0 - Xd2)*(Ys1 - Ys2) - (Xd1 - Xd2)*(Ys0 - Ys2) *            A = --------------------------------------------------- *                                   Divider * * *                 (Xs0 - Xs2)*(Xd1 - Xd2) - (Xd0 - Xd2)*(Xs1 - Xs2) *            B = --------------------------------------------------- *                                   Divider * * *                 Ys0*(Xs2*Xd1 - Xs1*Xd2) +  *                             Ys1*(Xs0*Xd2 - Xs2*Xd0) +  *                                           Ys2*(Xs1*Xd0 - Xs0*Xd1) *            C = --------------------------------------------------- *                                   Divider * * *                 (Yd0 - Yd2)*(Ys1 - Ys2) - (Yd1 - Yd2)*(Ys0 - Ys2) *            D = --------------------------------------------------- *                                   Divider * * *                 (Xs0 - Xs2)*(Yd1 - Yd2) - (Yd0 - Yd2)*(Xs1 - Xs2) *            E = --------------------------------------------------- *                                   Divider * * *                 Ys0*(Xs2*Yd1 - Xs1*Yd2) +  *                             Ys1*(Xs0*Yd2 - Xs2*Yd0) +  *                                           Ys2*(Xs1*Yd0 - Xs0*Yd1) *            F = --------------------------------------------------- *                                   Divider * * *       Return: OK - the calibration matrix was correctly  *                     calculated and its value is in the  *                     output argument. *               NOT_OK - an error was detected and the  *                         function failed to return a valid *                         set of matrix values. *                        The only time this sample code returns *                        NOT_OK is when Divider == 0 * * * *                 NOTE!    NOTE!    NOTE! * *  setCalibrationMatrix() and getDisplayPoint() will do fine *  for you as they are, provided that your digitizer          *  resolution does not exceed 10 bits (1024 values).  Higher *  resolutions may cause the integer operations to overflow *  and return incorrect values.  If you wish to use these    *  functions with digitizer resolutions of 12 bits (4096     *  values) you will either have to a) use 64-bit signed      *  integer variables and math, or b) judiciously modify the  *  operations to scale results by a factor of 2 or even 4.   * * */int setCalibrationMatrix( POINT * displayPtr,                          POINT * screenPtr,                          MATRIX * matrixPtr){    int  retValue = OK ;    matrixPtr->Divider = ((screenPtr[0].x - screenPtr[2].x) * (screenPtr[1].y - screenPtr[2].y)) -                         ((screenPtr[1].x - screenPtr[2].x) * (screenPtr[0].y - screenPtr[2].y)) ;    if ( matrixPtr->Divider == 0 )    {        retValue = NOT_OK ;
		USART_OUT(USART1,"0101");    }    else    {        matrixPtr->An = ((displayPtr[0].x - displayPtr[2].x) * (screenPtr[1].y - screenPtr[2].y)) -                        ((displayPtr[1].x - displayPtr[2].x) * (screenPtr[0].y - screenPtr[2].y)) ;        matrixPtr->Bn = ((screenPtr[0].x - screenPtr[2].x) * (displayPtr[1].x - displayPtr[2].x)) -                        ((displayPtr[0].x - displayPtr[2].x) * (screenPtr[1].x - screenPtr[2].x)) ;        matrixPtr->Cn = (screenPtr[2].x * displayPtr[1].x - screenPtr[1].x * displayPtr[2].x) * screenPtr[0].y +                        (screenPtr[0].x * displayPtr[2].x - screenPtr[2].x * displayPtr[0].x) * screenPtr[1].y +                        (screenPtr[1].x * displayPtr[0].x - screenPtr[0].x * displayPtr[1].x) * screenPtr[2].y ;        matrixPtr->Dn = ((displayPtr[0].y - displayPtr[2].y) * (screenPtr[1].y - screenPtr[2].y)) -                        ((displayPtr[1].y - displayPtr[2].y) * (screenPtr[0].y - screenPtr[2].y)) ;        matrixPtr->En = ((screenPtr[0].x - screenPtr[2].x) * (displayPtr[1].y - displayPtr[2].y)) -                        ((displayPtr[0].y - displayPtr[2].y) * (screenPtr[1].x - screenPtr[2].x)) ;        matrixPtr->Fn = (screenPtr[2].x * displayPtr[1].y - screenPtr[1].x * displayPtr[2].y) * screenPtr[0].y +                        (screenPtr[0].x * displayPtr[2].y - screenPtr[2].x * displayPtr[0].y) * screenPtr[1].y +                        (screenPtr[1].x * displayPtr[0].y - screenPtr[0].x * displayPtr[1].y) * screenPtr[2].y ;    }    return( retValue ) ;} /* end of setCalibrationMatrix() *//********************************************************************** * *     Function: getDisplayPoint() * *  Description: Given a valid set of calibration factors and a point *                value reported by the touch screen, this function *                calculates and returns the true (or closest to true) *                display point below the spot where the touch screen  *                was touched. *  * *  *  Argument(s): displayPtr (output) - Pointer to the calculated *                                      (true) display point. *               screenPtr (input) - Pointer to the reported touch *                                    screen point. *               matrixPtr (input) - Pointer to calibration factors *                                    matrix previously calculated *                                    from a call to  *                                    setCalibrationMatrix() *  * *  The function simply solves for Xd and Yd by implementing the  *   computations required by the translation matrix.   *  *                                              /-     -\ *              /-    -\     /-            -\   |       | *              |      |     |              |   |   Xs  | *              |  Xd  |     | A    B    C  |   |       | *              |      |  =  |              | * |   Ys  | *              |  Yd  |     | D    E    F  |   |       | *              |      |     |              |   |   1   | *              \-    -/     \-            -/   |       | *                                              \-     -/ *  *  It must be kept brief to avoid consuming CPU cycles. *  * *       Return: OK - the display point was correctly calculated  *                     and its value is in the output argument. *               NOT_OK - an error was detected and the function *                         failed to return a valid point. * * * *                 NOTE!    NOTE!    NOTE! * *  setCalibrationMatrix() and getDisplayPoint() will do fine *  for you as they are, provided that your digitizer          *  resolution does not exceed 10 bits (1024 values).  Higher *  resolutions may cause the integer operations to overflow *  and return incorrect values.  If you wish to use these    *  functions with digitizer resolutions of 12 bits (4096     *  values) you will either have to a) use 64-bit signed      *  integer variables and math, or b) judiciously modify the  *  operations to scale results by a factor of 2 or even 4.   * * */int getDisplayPoint( POINT * displayPtr,                     POINT * screenPtr,                     MATRIX * matrixPtr ){    int  retValue = OK ;    if ( matrixPtr->Divider != 0 )    {        /* Operation order is important since we are doing integer */        /*  math. Make sure you add all terms together before      */        /*  dividing, so that the remainder is not rounded off     */        /*  prematurely.                                           */        displayPtr->x = ( (matrixPtr->An * screenPtr->x) + (matrixPtr->Bn * screenPtr->y) + matrixPtr->Cn) / matrixPtr->Divider ;        displayPtr->y = ( (matrixPtr->Dn * screenPtr->x) + (matrixPtr->En * screenPtr->y) + matrixPtr->Fn) / matrixPtr->Divider ;    }    else    {        retValue = NOT_OK ;    }    return( retValue ) ;} /* end of getDisplayPoint() *//*http://www.ourdev.cn/bbs/bbs_content.jsp?xcfrom=302&bbs_sn=3493809&bbs_page_no=1&bbs_id=1000http://www.poweravr.com/?action-viewthread-tid-231http://blog.sina.com.cn/s/blog_5d9051c00100ee6w.html//液晶屏上的采樣點coordinate ScreenSample[3] =    {                                    { 712, 911 },                                    { 3234, 898 },                                    { 2318, 3058 }                                };         //LCD上 對應的點coordinate DisplaySample[3] =   {                                 	{ 45, 45 },              						{ 45, 270},                                    { 190,190}                                 };這是 LCD坐標..跟觸摸屏 得到的值....是入口參數  經過函數setCalibrationMatrix( &DisplaySample[0],&ScreenSample[0],&matrix ) ;   得到的參        是放到matrix 里面..在經過函數 getDisplayPoint(&display, Read_Ads7846(), &matrix ) ;計算出X  Y的值..存放在 display里面*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产一级片| 亚洲婷婷综合久久一本伊一区| 久久久精品欧美丰满| 亚洲欧美电影一区二区| 国产美女在线观看一区| 欧美日韩综合在线免费观看| 中文字幕欧美国产| 蜜臂av日日欢夜夜爽一区| 色欧美88888久久久久久影院| 久久久久久影视| 秋霞电影一区二区| 在线免费观看视频一区| 欧美国产日韩精品免费观看| 日本不卡一区二区| 欧美视频中文一区二区三区在线观看| 中文子幕无线码一区tr| 国模冰冰炮一区二区| 3d动漫精品啪啪一区二区竹菊| 亚洲裸体xxx| 99国产一区二区三精品乱码| 久久久久成人黄色影片| 国产一区日韩二区欧美三区| 91精品国产日韩91久久久久久| 亚洲在线视频一区| 91欧美激情一区二区三区成人| 国产精品久久久久久久久免费丝袜| 韩国av一区二区三区四区| 91精品国产综合久久精品图片 | 亚洲免费视频中文字幕| 国产精品白丝av| 欧美精品一区二区高清在线观看| 日韩黄色一级片| 91精品国产综合久久久久久久久久 | 国产一区二区三区黄视频 | 国产亚洲欧美色| 国内外成人在线| 久久九九影视网| 成人性生交大片免费看视频在线| 久久精品欧美日韩精品| 成人免费毛片嘿嘿连载视频| 国产精品乱人伦| 色香蕉久久蜜桃| 亚洲午夜视频在线| 欧美日本在线观看| 麻豆传媒一区二区三区| 久久久精品国产99久久精品芒果| 国产精品一区二区视频| 国产精品成人一区二区艾草| 在线免费视频一区二区| 日韩成人一级大片| 久久久久久久久久电影| 成人激情免费电影网址| 亚洲制服欧美中文字幕中文字幕| 3d动漫精品啪啪| 国产又粗又猛又爽又黄91精品| 国产精品沙发午睡系列990531| 色香色香欲天天天影视综合网| 午夜欧美电影在线观看| 久久综合狠狠综合久久激情| av在线这里只有精品| 亚洲一二三专区| 久久色中文字幕| 99久久国产综合精品色伊| 午夜精品久久久久久久99樱桃| 26uuu国产在线精品一区二区| 99久久精品国产毛片| 日精品一区二区三区| 国产亚洲精品福利| 色婷婷久久久亚洲一区二区三区| 蜜桃精品视频在线观看| 亚洲欧美自拍偷拍| 日韩欧美一级精品久久| 不卡av在线免费观看| 日韩影院精彩在线| 国产精品萝li| 精品欧美黑人一区二区三区| 91在线国产观看| 狠狠色狠狠色综合系列| 亚洲伦理在线免费看| 久久久99久久精品欧美| 欧美日免费三级在线| 成人av免费网站| 精品一区二区三区香蕉蜜桃| 亚洲综合色在线| 国产午夜一区二区三区| 91精品免费在线观看| 91美女片黄在线观看| 国产美女娇喘av呻吟久久| 午夜天堂影视香蕉久久| 国产视频在线观看一区二区三区 | 99久久综合精品| 精品在线播放午夜| 亚洲成人1区2区| 亚洲精品成人在线| 国产精品丝袜久久久久久app| 日韩欧美一区电影| 欧美性猛片xxxx免费看久爱| 91香蕉视频污| 成人激情av网| 成人av电影在线播放| 国产乱码精品一区二区三区忘忧草 | 欧美精品vⅰdeose4hd| 色综合久久天天| av日韩在线网站| 成人性生交大合| 国产毛片一区二区| 国产美女精品一区二区三区| 免播放器亚洲一区| 蜜桃视频一区二区| 久久99精品网久久| 久久99国产精品免费网站| 青青草一区二区三区| 日韩综合一区二区| 日欧美一区二区| 日韩成人av影视| 午夜欧美大尺度福利影院在线看| 一区二区在线观看不卡| 亚洲免费电影在线| 亚洲精品国产无天堂网2021 | 久久男人中文字幕资源站| 精品区一区二区| 精品国产精品网麻豆系列| 精品成人a区在线观看| xnxx国产精品| 国产精品全国免费观看高清| 国产精品久线观看视频| 亚洲男人天堂av| 亚洲成人动漫精品| 天天色 色综合| 亚洲制服丝袜一区| 日韩va亚洲va欧美va久久| 男女性色大片免费观看一区二区 | 国产ts人妖一区二区| 国产成人av一区| 色妹子一区二区| 欧美一区二区三区免费在线看| 欧美电影免费观看完整版| 久久久久久久久久久久久女国产乱| 中文字幕欧美三区| 亚洲毛片av在线| 麻豆免费精品视频| 成人一区在线看| 欧美日韩免费高清一区色橹橹 | 在线视频你懂得一区| 制服.丝袜.亚洲.另类.中文| 精品国精品国产| 亚洲欧洲另类国产综合| 日韩电影一二三区| 国产成人av一区二区三区在线| 色偷偷成人一区二区三区91| 欧美一区永久视频免费观看| 国产欧美一区二区三区沐欲| 一区二区三区精密机械公司| 久久er99精品| 91国产精品成人| 精品国产123| 亚洲地区一二三色| 国产成人鲁色资源国产91色综| 99精品热视频| 久久你懂得1024| 亚洲成av人片观看| 成人精品免费视频| 欧美一级艳片视频免费观看| 国产精品电影一区二区三区| 青青国产91久久久久久| 色综合久久久网| 国产嫩草影院久久久久| 五月激情丁香一区二区三区| jlzzjlzz亚洲日本少妇| 日韩一区二区三区高清免费看看| 亚洲三级小视频| 国产精品一区二区免费不卡 | 午夜精品福利在线| 99久久免费国产| 久久人人爽人人爽| 天堂一区二区在线| 91在线视频18| 中文乱码免费一区二区| 蜜桃91丨九色丨蝌蚪91桃色| 欧美三级中文字幕在线观看| 国产精品高潮呻吟久久| 国产精品主播直播| 精品嫩草影院久久| 日韩av网站在线观看| 欧美日本一区二区在线观看| 亚洲乱码中文字幕综合| 99热国产精品| 国产精品无人区| 丰满白嫩尤物一区二区| 久久综合久久综合亚洲| 蜜臀av一区二区在线免费观看| 欧美肥大bbwbbw高潮| 亚洲综合清纯丝袜自拍| 欧美在线一二三| 亚洲一区二区四区蜜桃| 91久久人澡人人添人人爽欧美| 国产精品白丝在线| 97se亚洲国产综合自在线| 国产精品免费免费| 成人av资源在线观看|