calibrate.h
上传用户:wealth48
上传日期:2022-06-24
资源大小:1701k
文件大小:3k
源码类别:

uCOS

开发平台:

C/C++

  1. /*
  2.  *
  3.  *   Copyright (c) 2001, Carlos E. Vidales. All rights reserved.
  4.  *
  5.  *   This sample program was written and put in the public domain 
  6.  *    by Carlos E. Vidales.  The program is provided "as is" 
  7.  *    without warranty of any kind, either expressed or implied.
  8.  *   If you choose to use the program within your own products
  9.  *    you do so at your own risk, and assume the responsibility
  10.  *    for servicing, repairing or correcting the program should
  11.  *    it prove defective in any manner.
  12.  *   You may copy and distribute the program's source code in any 
  13.  *    medium, provided that you also include in each copy an
  14.  *    appropriate copyright notice and disclaimer of warranty.
  15.  *   You may also modify this program and distribute copies of
  16.  *    it provided that you include prominent notices stating 
  17.  *    that you changed the file(s) and the date of any change,
  18.  *    and that you do not charge any royalties or licenses for 
  19.  *    its use.
  20.  * 
  21.  *
  22.  *   File Name:  calibrate.h
  23.  *
  24.  *
  25.  *   Definition of constants and structures, and declaration of functions 
  26.  *    in Calibrate.c
  27.  *
  28.  */
  29. #ifndef _CALIBRATE_H_
  30. #define _CALIBRATE_H_
  31. /****************************************************/
  32. /*                                                  */
  33. /* Included files                                   */
  34. /*                                                  */
  35. /****************************************************/
  36. #include <math.h>
  37. /****************************************************/
  38. /*                                                  */
  39. /* Definitions                                      */
  40. /*                                                  */
  41. /****************************************************/
  42. #ifndef _CALIBRATE_C_
  43. #define EXTERN         extern
  44. #else
  45. #define EXTERN
  46. #endif
  47. #ifndef OK
  48. #define OK         0
  49. #define NOT_OK    -1
  50. #endif
  51. #define INT32 long
  52. /****************************************************/
  53. /*                                                  */
  54. /* Structures                                       */
  55. /*                                                  */
  56. /****************************************************/
  57. typedef struct Point {
  58.                         int x,
  59.                              y ;
  60.                      } calibrate_POINT ;
  61. typedef struct Matrix {
  62. /* This arrangement of values facilitates 
  63.  *  calculations within getDisplayPoint() 
  64.  */
  65.                        int      An,     /* A = An/Divider */
  66.                                  Bn,     /* B = Bn/Divider */
  67.                                  Cn,     /* C = Cn/Divider */
  68.                                  Dn,     /* D = Dn/Divider */
  69.                                  En,     /* E = En/Divider */
  70.                                  Fn,     /* F = Fn/Divider */
  71.                                  Divider ;
  72.                      } calibrate_MATRIX ;
  73. /****************************************************/
  74. /*                                                  */
  75. /* Function declarations                            */
  76. /*                                                  */
  77. /****************************************************/
  78. EXTERN int setCalibrationMatrix( calibrate_POINT * display,
  79.                                  calibrate_POINT * screen,
  80.                                  calibrate_MATRIX * matrix) ;
  81. EXTERN int getDisplayPoint( calibrate_POINT * display,
  82.                             calibrate_POINT * screen,
  83.                             calibrate_MATRIX * matrix ) ;
  84. #endif  /* _CALIBRATE_H_ */