• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**************************************************************************
2  *
3  * Copyright 2010, 2011 BMW Car IT GmbH
4  * Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *        http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ****************************************************************************/
20 #ifndef _WLEYES_H_
21 #define _WLEYES_H_
22 
23 #include "transform.h"
24 
25 //////////////////////////////////////////////////////////////////////////////
26 
27 class WLEye
28 {
29 private:
30     int     m_nPoint;
31     TPoint* m_eyeLiner;
32     int     m_nPupilPoint;
33     TPoint* m_pupil;
34     int     m_nWhiteEyePoint;
35     TPoint* m_whiteEye;
36 
37 public:
38     WLEye();
39     virtual ~WLEye();
40 
41     void CreateEyeLiner(const float& centerX,
42                         const float& centerY,
43                         const float& diam,
44                         const Transform& trans);
45     void CreatePupil(const float& centerX,
46                      const float& centerY,
47                      const float& diam,
48                      const Transform& trans);
49 
50     void GetEyeLinerGeom(int* nPoint, float** points);
51     void GetWhiteEyeGeom(int* nPoint, float** points);
52     void GetPupilGeom(int* nPoint, float** points);
53 
54 private:
55     void CreateWhiteEye(const float& centerX,
56                         const float& centerY,
57                         const float& diam,
58                         const Transform& trans);
59 };
60 
61 //////////////////////////////////////////////////////////////////////////////
62 
63 class WLEyes
64 {
65 private:
66     WLEye*    m_eyes[2];
67     int       m_width;
68     int       m_height;
69     Transform m_trans;
70 
71 public:
72     WLEyes(int screenWidth, int screenHeight);
73     virtual ~WLEyes();
74 
75     void SetPointOfView(int mousePosX, int mousePosY);
76 
77     void GetEyeLinerGeom(int n, int* nPoint, float** points);
78     void GetWhiteEyeGeom(int n, int* nPoint, float** points);
79     void GetPupilGeom(int n, int* nPoint, float** points);
80 
81 private:
82     WLEyes();
83 };
84 
85 #endif /* _WLEYES_H_ */
86