Initial commit
[profile/ivi/simulator-opengl.git] / es_1_1 / gl_real.c
1 /* 
2  * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
3  * 
4  * Contact:
5  * DongKyun Yun <dk77.yun@samsung.com>
6  * SangJin Kim <sangjin3.kim@samsung.com>
7  * HyunGoo Kang <hyungoo1.kang@samsung.com>
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a copy of
10  * this software and associated documentation files (the "Software"), to deal in
11  * the Software without restriction, including without limitation the rights to
12  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
13  * of the Software, and to permit persons to whom the Software is furnished to do
14  * so, subject to the following conditions:
15  * 
16  * The above copyright notice and this permission notice shall be included in all
17  * copies or substantial portions of the Software.
18  * 
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25  * SOFTWARE.
26  * 
27  * Contributors:
28  * - S-Core Co., Ltd
29  *
30  */
31
32 #include "gl_imp.h"
33
34 void xv2xv(const GLfixed* src, GLfixed* dst, int n) {
35         while (n--) {
36                 *dst++ = x2x(*src++);
37         }
38 }
39
40 void xv2fv(const GLfixed* src, GLfloat* dst, int n) {
41         while (n--) {
42                 *dst++ = x2f(*src++);
43         }
44 }
45
46 void xv2dv(const GLfixed* src, GLdouble* dst, int n) {
47         while (n--) {
48                 *dst++ = x2d(*src++);
49         }
50 }
51
52 void fv2xv(const GLfloat* src, GLfixed* dst, int n) {
53         while (n--) {
54                 *dst++ = f2x(*src++);
55         }
56 }
57
58 void fv2fv(const GLfloat* src, GLfloat* dst, int n) {
59         while (n--) {
60                 *dst++ = f2f(*src++);
61         }
62 }
63
64 void fv2dv(const GLfloat* src, GLdouble* dst, int n) {
65         while (n--) {
66                 *dst++ = f2d(*src++);
67         }
68 }
69
70 void dv2xv(const GLdouble* src, GLfixed* dst, int n) {
71         while (n--) {
72                 *dst++ = d2x(*src++);
73         }
74 }
75
76 void dv2fv(const GLdouble* src, GLfloat* dst, int n) {
77         while (n--) {
78                 *dst++ = d2f(*src++);
79         }
80 }
81
82 void xv2boolv(const GLfixed* src, GLboolean* dst, int n) {
83         while (n--) {
84                 *dst++ = x2bool(*src++);
85         }
86 }
87
88 void fv2boolv(const GLfloat* src, GLboolean* dst, int n) {
89         while (n--) {
90                 *dst++ = f2bool(*src++);
91         }
92 }
93
94 void clampxv2boolv(const GLfixed* src, GLboolean* dst, int n) {
95         while (n--) {
96                 *dst++ = clampx2bool(*src++);
97         }
98 }
99
100 void clampfv2boolv(const GLfloat* src, GLboolean* dst, int n) {
101         while (n--) {
102                 *dst++ = clampf2bool(*src++);
103         }
104 }
105
106
107
108 void bv2xv(const GLbyte* src, GLfixed* dst, int n) {
109         while (n--) {
110                 *dst++ = b2x(*src++);
111         }
112 }
113
114 void bv2fv(const GLbyte* src, GLfloat* dst, int n) {
115         while (n--) {
116                 *dst++ = b2f(*src++);
117         }
118 }
119
120 void bv2clampxv(const GLbyte* src, GLfixed* dst, int n) {
121         while (n--) {
122                 *dst++ = b2clampx(*src++);
123         }
124 }
125
126 void bv2clampfv(const GLbyte* src, GLfloat* dst, int n) {
127         while (n--) {
128                 *dst++ = b2clampf(*src++);
129         }
130 }
131
132 void ubv2clampxv(const GLbyte* src, GLfixed* dst, int n) {
133         while (n--) {
134                 *dst++ = ub2clampx(*src++);
135         }
136 }
137
138 void ubv2clampfv(const GLbyte* src, GLfloat* dst, int n) {
139         while (n--) {
140                 *dst++ = ub2clampf(*src++);
141         }
142 }
143
144 void sv2xv(const GLshort* src, GLfixed* dst, int n) {
145         while (n--) {
146                 *dst++ = s2x(*src++);
147         }
148 }
149
150 void sv2fv(const GLshort* src, GLfloat* dst, int n) {
151         while (n--) {
152                 *dst++ = s2f(*src++);
153         }
154 }
155
156 void sv2clampxv(const GLshort* src, GLfixed* dst, int n) {
157         while (n--) {
158                 *dst++ = s2clampx(*src++);
159         }
160 }
161
162 void sv2clampfv(const GLshort* src, GLfloat* dst, int n) {
163         while (n--) {
164                 *dst++ = s2clampf(*src++);
165         }
166 }
167
168 void xv2iv(const GLfixed* src, GLint* dst, int n) {
169         while (n--) {
170                 *dst++ = x2i(*src++);
171         }
172 }
173
174 void fv2iv(const GLfloat* src, GLint* dst, int n) {
175         while (n--) {
176                 *dst++ = f2i(*src++);
177         }
178 }
179
180 void clampxv2iv(const GLfixed* src, GLint* dst, int n) {
181         while (n--) {
182                 *dst++ = clampx2i(*src++);
183         }
184 }
185
186 void clampfv2iv(const GLfloat* src, GLint* dst, int n) {
187         while (n--) {
188                 *dst++ = clampf2i(*src++);
189         }
190 }
191