1 /**************************************************************************
3 * Copyright 2010, 2011 BMW Car IT GmbH
4 * Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 ****************************************************************************/
23 typedef struct _transform {
28 typedef struct _tpoint {
32 typedef struct _trectangle {
33 float x, y, width, height;
36 #define Xx(x,y,t) ((int)((t)->mx * (x) + (t)->bx + 0.5))
37 #define Xy(x,y,t) ((int)((t)->my * (y) + (t)->by + 0.5))
38 #define Xwidth(w,h,t) ((int)((t)->mx * (w) + 0.5))
39 #define Xheight(w,h,t) ((int)((t)->my * (h) + 0.5))
40 #define Tx(x,y,t) ((((float) (x)) - (t)->bx) / (t)->mx)
41 #define Ty(x,y,t) ((((float) (y)) - (t)->by) / (t)->my)
42 #define Twidth(w,h,t) (((float) (w)) / (t)->mx)
43 #define Theight(w,h,t) (((float) (h)) / (t)->my)