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

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

?? calibrate.c

?? UCOSII在STM32平臺的移植
?? 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 "Calibrate.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 ;    }    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一区二区三区免费野_久草精品视频
色婷婷精品大在线视频| 亚洲少妇30p| 国产精品综合一区二区| 久久久久久免费| 国产1区2区3区精品美女| 国产三级一区二区| 成人精品免费看| 亚洲欧美激情插 | 久久精品国产一区二区| 欧美一区二区视频观看视频| 免费成人在线影院| 精品盗摄一区二区三区| 成人一道本在线| 亚洲精品中文字幕在线观看| 欧美无乱码久久久免费午夜一区| 日日夜夜精品视频天天综合网| 日韩欧美成人一区| 国产91对白在线观看九色| 亚洲精品成a人| 欧美日韩另类国产亚洲欧美一级| 日日夜夜精品视频免费| 久久久精品2019中文字幕之3| av中文字幕一区| 午夜精品久久久久久久99水蜜桃| 精品久久久久久无| 在线一区二区视频| 九九热在线视频观看这里只有精品| 国产欧美一区二区精品婷婷 | 免费视频最近日韩| 久久亚洲精精品中文字幕早川悠里| jlzzjlzz亚洲女人18| 五月天视频一区| 中文字幕av一区二区三区高 | 成人激情小说乱人伦| 香蕉成人啪国产精品视频综合网| 久久婷婷一区二区三区| 91美女在线视频| 日韩av电影免费观看高清完整版 | 国产精品一级片| 一区二区三区四区不卡在线| 久久色视频免费观看| 色域天天综合网| 久久99久久久久| 亚洲亚洲人成综合网络| 久久久久久久久岛国免费| 欧美日韩在线免费视频| 成人午夜在线播放| 青青草91视频| 一区二区三区在线视频免费 | 国产麻豆欧美日韩一区| 亚洲国产va精品久久久不卡综合| 久久久九九九九| 欧美一级欧美三级| 在线视频综合导航| 国产a久久麻豆| 久久99精品国产麻豆不卡| 亚洲午夜视频在线| 最新久久zyz资源站| 日韩欧美一区二区免费| 欧美亚洲尤物久久| 91在线视频在线| 国产精品1区二区.| 黑人精品欧美一区二区蜜桃 | 北条麻妃一区二区三区| 久久精品久久综合| 天天色天天爱天天射综合| 中文字幕一区二区三区不卡在线 | 亚洲婷婷国产精品电影人久久| 欧美变态tickle挠乳网站| 欧美色爱综合网| 精品视频一区二区三区免费| 色哟哟一区二区| 99国产精品久久久久久久久久| 国产成人一区在线| 国产美女精品人人做人人爽| 精品一区二区三区蜜桃| 久久精品99久久久| 午夜av一区二区| 三级在线观看一区二区| 午夜久久久影院| 日韩中文字幕亚洲一区二区va在线| 亚洲黄一区二区三区| 夜夜爽夜夜爽精品视频| 亚洲午夜一区二区| 婷婷中文字幕综合| 日韩激情一区二区| 毛片基地黄久久久久久天堂| 日韩av午夜在线观看| 奇米影视一区二区三区| 麻豆精品一区二区| 久久国产精品99久久久久久老狼 | 色综合色综合色综合色综合色综合| 成人美女视频在线观看| 粉嫩绯色av一区二区在线观看| 粉嫩aⅴ一区二区三区四区五区| 成人性生交大片免费| 91在线无精精品入口| 欧美色综合网站| 欧美肥妇毛茸茸| 亚洲精品一区二区三区精华液 | 国产一区二区美女诱惑| 国产精品99久久久久久久vr| 97久久超碰精品国产| 欧美中文字幕一二三区视频| 91精品国产日韩91久久久久久| 精品国产网站在线观看| 国产清纯白嫩初高生在线观看91| 欧美国产欧美综合| 亚洲一区二区在线观看视频| 日韩精品一二区| 国产在线一区二区综合免费视频| 国产aⅴ精品一区二区三区色成熟| 91丝袜美女网| 日韩三级免费观看| 国产精品色一区二区三区| 亚洲一区二区三区三| 看电影不卡的网站| av一区二区三区四区| 欧美日韩国产系列| 国产亚洲欧美一级| 午夜精品影院在线观看| 国产精品中文字幕一区二区三区| 色综合久久综合中文综合网| 精品久久人人做人人爱| 亚洲人成在线观看一区二区| 日本aⅴ亚洲精品中文乱码| 国产成a人亚洲精品| 555夜色666亚洲国产免| 国产精品久久久久aaaa樱花| 午夜精品在线看| 不卡的电影网站| 日韩欧美www| 亚洲成a人片在线观看中文| 国产一区二区不卡在线| 日本高清免费不卡视频| 久久久久88色偷偷免费| 石原莉奈在线亚洲三区| 91性感美女视频| 精品粉嫩超白一线天av| 一区二区三区四区五区视频在线观看| 国产一区二区三区免费在线观看 | 一区二区三区欧美亚洲| 国产综合久久久久久鬼色| 欧美日韩免费电影| 一区二区在线观看视频| 福利91精品一区二区三区| 精品国产一区二区三区忘忧草| 亚洲一区在线观看免费| 99精品黄色片免费大全| 久久精品视频免费观看| 美女视频网站久久| 欧美日韩国产高清一区二区三区 | 日韩欧美一级精品久久| 亚洲成av人在线观看| 91在线观看免费视频| 亚洲国产精品成人综合色在线婷婷 | 精彩视频一区二区三区| 日韩一区二区三区精品视频| 亚洲国产精品久久人人爱| aaa亚洲精品| 国产欧美日韩精品一区| 国产在线精品一区二区夜色| 91精品国产91久久综合桃花 | 日韩电影在线一区| 欧美剧情电影在线观看完整版免费励志电影| 国产精品麻豆欧美日韩ww| 国产成人亚洲综合a∨猫咪| 亚洲精品一区二区精华| 精品一区二区在线看| 欧美大白屁股肥臀xxxxxx| 日韩av电影免费观看高清完整版| 欧美日韩成人在线| 视频一区二区三区在线| 欧美一级日韩免费不卡| 麻豆精品新av中文字幕| 日韩欧美国产一区在线观看| 美国十次综合导航| 久久综合色婷婷| 成人免费观看av| 中文字幕在线视频一区| 99久久精品一区| 亚洲精品亚洲人成人网| 欧美日韩中文国产| 人人超碰91尤物精品国产| 日韩欧美激情在线| 国产伦精品一区二区三区免费迷| 国产日产欧美一区| 99国产精品久| 亚洲国产人成综合网站| 欧美日韩国产区一| 日本不卡视频在线观看| 久久综合国产精品| 99久久久久免费精品国产| 亚洲精品久久7777| 91精品欧美综合在线观看最新| 精品制服美女久久| 亚洲天堂成人网| 3d动漫精品啪啪一区二区竹菊| 久久国产精品无码网站| 国产精品久久久久影院色老大 |