Android O SDK.
[android_tools.git] / sdk / build-tools / 26.0.0 / renderscript / include / rs_convert.rsh
blob4c318d47bbe327c9a31db826e764006242e0142a
1 /*
2  * Copyright (C) 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
17 // Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
20  * rs_convert.rsh: Conversion Functions
21  *
22  * The functions below convert from a numerical vector type to another, or from one color
23  * representation to another.
24  */
26 #ifndef RENDERSCRIPT_RS_CONVERT_RSH
27 #define RENDERSCRIPT_RS_CONVERT_RSH
30  * convert: Convert numerical vectors
31  *
32  * Converts a vector from one numerical type to another.  The conversion are done entry per entry.
33  *
34  * E.g calling a = convert_short3(b); is equivalent to doing
35  * a.x = (short)b.x; a.y = (short)b.y; a.z = (short)b.z;.
36  *
37  * Converting floating point values to integer types truncates.
38  *
39  * Converting numbers too large to fit the destination type yields undefined results.
40  * For example, converting a float that contains 1.0e18 to a short is undefined.
41  * Use clamp() to avoid this.
42  */
43 extern float2 __attribute__((const, overloadable))
44     convert_float2(float2 v);
46 extern float3 __attribute__((const, overloadable))
47     convert_float3(float3 v);
49 extern float4 __attribute__((const, overloadable))
50     convert_float4(float4 v);
52 extern float2 __attribute__((const, overloadable))
53     convert_float2(char2 v);
55 extern float3 __attribute__((const, overloadable))
56     convert_float3(char3 v);
58 extern float4 __attribute__((const, overloadable))
59     convert_float4(char4 v);
61 extern float2 __attribute__((const, overloadable))
62     convert_float2(uchar2 v);
64 extern float3 __attribute__((const, overloadable))
65     convert_float3(uchar3 v);
67 extern float4 __attribute__((const, overloadable))
68     convert_float4(uchar4 v);
70 extern float2 __attribute__((const, overloadable))
71     convert_float2(short2 v);
73 extern float3 __attribute__((const, overloadable))
74     convert_float3(short3 v);
76 extern float4 __attribute__((const, overloadable))
77     convert_float4(short4 v);
79 extern float2 __attribute__((const, overloadable))
80     convert_float2(ushort2 v);
82 extern float3 __attribute__((const, overloadable))
83     convert_float3(ushort3 v);
85 extern float4 __attribute__((const, overloadable))
86     convert_float4(ushort4 v);
88 extern float2 __attribute__((const, overloadable))
89     convert_float2(int2 v);
91 extern float3 __attribute__((const, overloadable))
92     convert_float3(int3 v);
94 extern float4 __attribute__((const, overloadable))
95     convert_float4(int4 v);
97 extern float2 __attribute__((const, overloadable))
98     convert_float2(uint2 v);
100 extern float3 __attribute__((const, overloadable))
101     convert_float3(uint3 v);
103 extern float4 __attribute__((const, overloadable))
104     convert_float4(uint4 v);
106 extern char2 __attribute__((const, overloadable))
107     convert_char2(float2 v);
109 extern char3 __attribute__((const, overloadable))
110     convert_char3(float3 v);
112 extern char4 __attribute__((const, overloadable))
113     convert_char4(float4 v);
115 extern char2 __attribute__((const, overloadable))
116     convert_char2(char2 v);
118 extern char3 __attribute__((const, overloadable))
119     convert_char3(char3 v);
121 extern char4 __attribute__((const, overloadable))
122     convert_char4(char4 v);
124 extern char2 __attribute__((const, overloadable))
125     convert_char2(uchar2 v);
127 extern char3 __attribute__((const, overloadable))
128     convert_char3(uchar3 v);
130 extern char4 __attribute__((const, overloadable))
131     convert_char4(uchar4 v);
133 extern char2 __attribute__((const, overloadable))
134     convert_char2(short2 v);
136 extern char3 __attribute__((const, overloadable))
137     convert_char3(short3 v);
139 extern char4 __attribute__((const, overloadable))
140     convert_char4(short4 v);
142 extern char2 __attribute__((const, overloadable))
143     convert_char2(ushort2 v);
145 extern char3 __attribute__((const, overloadable))
146     convert_char3(ushort3 v);
148 extern char4 __attribute__((const, overloadable))
149     convert_char4(ushort4 v);
151 extern char2 __attribute__((const, overloadable))
152     convert_char2(int2 v);
154 extern char3 __attribute__((const, overloadable))
155     convert_char3(int3 v);
157 extern char4 __attribute__((const, overloadable))
158     convert_char4(int4 v);
160 extern char2 __attribute__((const, overloadable))
161     convert_char2(uint2 v);
163 extern char3 __attribute__((const, overloadable))
164     convert_char3(uint3 v);
166 extern char4 __attribute__((const, overloadable))
167     convert_char4(uint4 v);
169 extern uchar2 __attribute__((const, overloadable))
170     convert_uchar2(float2 v);
172 extern uchar3 __attribute__((const, overloadable))
173     convert_uchar3(float3 v);
175 extern uchar4 __attribute__((const, overloadable))
176     convert_uchar4(float4 v);
178 extern uchar2 __attribute__((const, overloadable))
179     convert_uchar2(char2 v);
181 extern uchar3 __attribute__((const, overloadable))
182     convert_uchar3(char3 v);
184 extern uchar4 __attribute__((const, overloadable))
185     convert_uchar4(char4 v);
187 extern uchar2 __attribute__((const, overloadable))
188     convert_uchar2(uchar2 v);
190 extern uchar3 __attribute__((const, overloadable))
191     convert_uchar3(uchar3 v);
193 extern uchar4 __attribute__((const, overloadable))
194     convert_uchar4(uchar4 v);
196 extern uchar2 __attribute__((const, overloadable))
197     convert_uchar2(short2 v);
199 extern uchar3 __attribute__((const, overloadable))
200     convert_uchar3(short3 v);
202 extern uchar4 __attribute__((const, overloadable))
203     convert_uchar4(short4 v);
205 extern uchar2 __attribute__((const, overloadable))
206     convert_uchar2(ushort2 v);
208 extern uchar3 __attribute__((const, overloadable))
209     convert_uchar3(ushort3 v);
211 extern uchar4 __attribute__((const, overloadable))
212     convert_uchar4(ushort4 v);
214 extern uchar2 __attribute__((const, overloadable))
215     convert_uchar2(int2 v);
217 extern uchar3 __attribute__((const, overloadable))
218     convert_uchar3(int3 v);
220 extern uchar4 __attribute__((const, overloadable))
221     convert_uchar4(int4 v);
223 extern uchar2 __attribute__((const, overloadable))
224     convert_uchar2(uint2 v);
226 extern uchar3 __attribute__((const, overloadable))
227     convert_uchar3(uint3 v);
229 extern uchar4 __attribute__((const, overloadable))
230     convert_uchar4(uint4 v);
232 extern short2 __attribute__((const, overloadable))
233     convert_short2(float2 v);
235 extern short3 __attribute__((const, overloadable))
236     convert_short3(float3 v);
238 extern short4 __attribute__((const, overloadable))
239     convert_short4(float4 v);
241 extern short2 __attribute__((const, overloadable))
242     convert_short2(char2 v);
244 extern short3 __attribute__((const, overloadable))
245     convert_short3(char3 v);
247 extern short4 __attribute__((const, overloadable))
248     convert_short4(char4 v);
250 extern short2 __attribute__((const, overloadable))
251     convert_short2(uchar2 v);
253 extern short3 __attribute__((const, overloadable))
254     convert_short3(uchar3 v);
256 extern short4 __attribute__((const, overloadable))
257     convert_short4(uchar4 v);
259 extern short2 __attribute__((const, overloadable))
260     convert_short2(short2 v);
262 extern short3 __attribute__((const, overloadable))
263     convert_short3(short3 v);
265 extern short4 __attribute__((const, overloadable))
266     convert_short4(short4 v);
268 extern short2 __attribute__((const, overloadable))
269     convert_short2(ushort2 v);
271 extern short3 __attribute__((const, overloadable))
272     convert_short3(ushort3 v);
274 extern short4 __attribute__((const, overloadable))
275     convert_short4(ushort4 v);
277 extern short2 __attribute__((const, overloadable))
278     convert_short2(int2 v);
280 extern short3 __attribute__((const, overloadable))
281     convert_short3(int3 v);
283 extern short4 __attribute__((const, overloadable))
284     convert_short4(int4 v);
286 extern short2 __attribute__((const, overloadable))
287     convert_short2(uint2 v);
289 extern short3 __attribute__((const, overloadable))
290     convert_short3(uint3 v);
292 extern short4 __attribute__((const, overloadable))
293     convert_short4(uint4 v);
295 extern ushort2 __attribute__((const, overloadable))
296     convert_ushort2(float2 v);
298 extern ushort3 __attribute__((const, overloadable))
299     convert_ushort3(float3 v);
301 extern ushort4 __attribute__((const, overloadable))
302     convert_ushort4(float4 v);
304 extern ushort2 __attribute__((const, overloadable))
305     convert_ushort2(char2 v);
307 extern ushort3 __attribute__((const, overloadable))
308     convert_ushort3(char3 v);
310 extern ushort4 __attribute__((const, overloadable))
311     convert_ushort4(char4 v);
313 extern ushort2 __attribute__((const, overloadable))
314     convert_ushort2(uchar2 v);
316 extern ushort3 __attribute__((const, overloadable))
317     convert_ushort3(uchar3 v);
319 extern ushort4 __attribute__((const, overloadable))
320     convert_ushort4(uchar4 v);
322 extern ushort2 __attribute__((const, overloadable))
323     convert_ushort2(short2 v);
325 extern ushort3 __attribute__((const, overloadable))
326     convert_ushort3(short3 v);
328 extern ushort4 __attribute__((const, overloadable))
329     convert_ushort4(short4 v);
331 extern ushort2 __attribute__((const, overloadable))
332     convert_ushort2(ushort2 v);
334 extern ushort3 __attribute__((const, overloadable))
335     convert_ushort3(ushort3 v);
337 extern ushort4 __attribute__((const, overloadable))
338     convert_ushort4(ushort4 v);
340 extern ushort2 __attribute__((const, overloadable))
341     convert_ushort2(int2 v);
343 extern ushort3 __attribute__((const, overloadable))
344     convert_ushort3(int3 v);
346 extern ushort4 __attribute__((const, overloadable))
347     convert_ushort4(int4 v);
349 extern ushort2 __attribute__((const, overloadable))
350     convert_ushort2(uint2 v);
352 extern ushort3 __attribute__((const, overloadable))
353     convert_ushort3(uint3 v);
355 extern ushort4 __attribute__((const, overloadable))
356     convert_ushort4(uint4 v);
358 extern int2 __attribute__((const, overloadable))
359     convert_int2(float2 v);
361 extern int3 __attribute__((const, overloadable))
362     convert_int3(float3 v);
364 extern int4 __attribute__((const, overloadable))
365     convert_int4(float4 v);
367 extern int2 __attribute__((const, overloadable))
368     convert_int2(char2 v);
370 extern int3 __attribute__((const, overloadable))
371     convert_int3(char3 v);
373 extern int4 __attribute__((const, overloadable))
374     convert_int4(char4 v);
376 extern int2 __attribute__((const, overloadable))
377     convert_int2(uchar2 v);
379 extern int3 __attribute__((const, overloadable))
380     convert_int3(uchar3 v);
382 extern int4 __attribute__((const, overloadable))
383     convert_int4(uchar4 v);
385 extern int2 __attribute__((const, overloadable))
386     convert_int2(short2 v);
388 extern int3 __attribute__((const, overloadable))
389     convert_int3(short3 v);
391 extern int4 __attribute__((const, overloadable))
392     convert_int4(short4 v);
394 extern int2 __attribute__((const, overloadable))
395     convert_int2(ushort2 v);
397 extern int3 __attribute__((const, overloadable))
398     convert_int3(ushort3 v);
400 extern int4 __attribute__((const, overloadable))
401     convert_int4(ushort4 v);
403 extern int2 __attribute__((const, overloadable))
404     convert_int2(int2 v);
406 extern int3 __attribute__((const, overloadable))
407     convert_int3(int3 v);
409 extern int4 __attribute__((const, overloadable))
410     convert_int4(int4 v);
412 extern int2 __attribute__((const, overloadable))
413     convert_int2(uint2 v);
415 extern int3 __attribute__((const, overloadable))
416     convert_int3(uint3 v);
418 extern int4 __attribute__((const, overloadable))
419     convert_int4(uint4 v);
421 extern uint2 __attribute__((const, overloadable))
422     convert_uint2(float2 v);
424 extern uint3 __attribute__((const, overloadable))
425     convert_uint3(float3 v);
427 extern uint4 __attribute__((const, overloadable))
428     convert_uint4(float4 v);
430 extern uint2 __attribute__((const, overloadable))
431     convert_uint2(char2 v);
433 extern uint3 __attribute__((const, overloadable))
434     convert_uint3(char3 v);
436 extern uint4 __attribute__((const, overloadable))
437     convert_uint4(char4 v);
439 extern uint2 __attribute__((const, overloadable))
440     convert_uint2(uchar2 v);
442 extern uint3 __attribute__((const, overloadable))
443     convert_uint3(uchar3 v);
445 extern uint4 __attribute__((const, overloadable))
446     convert_uint4(uchar4 v);
448 extern uint2 __attribute__((const, overloadable))
449     convert_uint2(short2 v);
451 extern uint3 __attribute__((const, overloadable))
452     convert_uint3(short3 v);
454 extern uint4 __attribute__((const, overloadable))
455     convert_uint4(short4 v);
457 extern uint2 __attribute__((const, overloadable))
458     convert_uint2(ushort2 v);
460 extern uint3 __attribute__((const, overloadable))
461     convert_uint3(ushort3 v);
463 extern uint4 __attribute__((const, overloadable))
464     convert_uint4(ushort4 v);
466 extern uint2 __attribute__((const, overloadable))
467     convert_uint2(int2 v);
469 extern uint3 __attribute__((const, overloadable))
470     convert_uint3(int3 v);
472 extern uint4 __attribute__((const, overloadable))
473     convert_uint4(int4 v);
475 extern uint2 __attribute__((const, overloadable))
476     convert_uint2(uint2 v);
478 extern uint3 __attribute__((const, overloadable))
479     convert_uint3(uint3 v);
481 extern uint4 __attribute__((const, overloadable))
482     convert_uint4(uint4 v);
484 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
485 extern double2 __attribute__((const, overloadable))
486     convert_double2(double2 v);
487 #endif
489 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
490 extern double3 __attribute__((const, overloadable))
491     convert_double3(double3 v);
492 #endif
494 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
495 extern double4 __attribute__((const, overloadable))
496     convert_double4(double4 v);
497 #endif
499 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
500 extern double2 __attribute__((const, overloadable))
501     convert_double2(long2 v);
502 #endif
504 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
505 extern double3 __attribute__((const, overloadable))
506     convert_double3(long3 v);
507 #endif
509 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
510 extern double4 __attribute__((const, overloadable))
511     convert_double4(long4 v);
512 #endif
514 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
515 extern double2 __attribute__((const, overloadable))
516     convert_double2(ulong2 v);
517 #endif
519 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
520 extern double3 __attribute__((const, overloadable))
521     convert_double3(ulong3 v);
522 #endif
524 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
525 extern double4 __attribute__((const, overloadable))
526     convert_double4(ulong4 v);
527 #endif
529 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
530 extern long2 __attribute__((const, overloadable))
531     convert_long2(double2 v);
532 #endif
534 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
535 extern long3 __attribute__((const, overloadable))
536     convert_long3(double3 v);
537 #endif
539 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
540 extern long4 __attribute__((const, overloadable))
541     convert_long4(double4 v);
542 #endif
544 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
545 extern long2 __attribute__((const, overloadable))
546     convert_long2(long2 v);
547 #endif
549 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
550 extern long3 __attribute__((const, overloadable))
551     convert_long3(long3 v);
552 #endif
554 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
555 extern long4 __attribute__((const, overloadable))
556     convert_long4(long4 v);
557 #endif
559 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
560 extern long2 __attribute__((const, overloadable))
561     convert_long2(ulong2 v);
562 #endif
564 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
565 extern long3 __attribute__((const, overloadable))
566     convert_long3(ulong3 v);
567 #endif
569 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
570 extern long4 __attribute__((const, overloadable))
571     convert_long4(ulong4 v);
572 #endif
574 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
575 extern ulong2 __attribute__((const, overloadable))
576     convert_ulong2(double2 v);
577 #endif
579 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
580 extern ulong3 __attribute__((const, overloadable))
581     convert_ulong3(double3 v);
582 #endif
584 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
585 extern ulong4 __attribute__((const, overloadable))
586     convert_ulong4(double4 v);
587 #endif
589 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
590 extern ulong2 __attribute__((const, overloadable))
591     convert_ulong2(long2 v);
592 #endif
594 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
595 extern ulong3 __attribute__((const, overloadable))
596     convert_ulong3(long3 v);
597 #endif
599 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
600 extern ulong4 __attribute__((const, overloadable))
601     convert_ulong4(long4 v);
602 #endif
604 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
605 extern ulong2 __attribute__((const, overloadable))
606     convert_ulong2(ulong2 v);
607 #endif
609 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
610 extern ulong3 __attribute__((const, overloadable))
611     convert_ulong3(ulong3 v);
612 #endif
614 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
615 extern ulong4 __attribute__((const, overloadable))
616     convert_ulong4(ulong4 v);
617 #endif
619 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
620 extern float2 __attribute__((const, overloadable))
621     convert_float2(double2 v);
622 #endif
624 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
625 extern float3 __attribute__((const, overloadable))
626     convert_float3(double3 v);
627 #endif
629 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
630 extern float4 __attribute__((const, overloadable))
631     convert_float4(double4 v);
632 #endif
634 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
635 extern float2 __attribute__((const, overloadable))
636     convert_float2(long2 v);
637 #endif
639 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
640 extern float3 __attribute__((const, overloadable))
641     convert_float3(long3 v);
642 #endif
644 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
645 extern float4 __attribute__((const, overloadable))
646     convert_float4(long4 v);
647 #endif
649 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
650 extern float2 __attribute__((const, overloadable))
651     convert_float2(ulong2 v);
652 #endif
654 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
655 extern float3 __attribute__((const, overloadable))
656     convert_float3(ulong3 v);
657 #endif
659 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
660 extern float4 __attribute__((const, overloadable))
661     convert_float4(ulong4 v);
662 #endif
664 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
665 extern char2 __attribute__((const, overloadable))
666     convert_char2(double2 v);
667 #endif
669 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
670 extern char3 __attribute__((const, overloadable))
671     convert_char3(double3 v);
672 #endif
674 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
675 extern char4 __attribute__((const, overloadable))
676     convert_char4(double4 v);
677 #endif
679 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
680 extern char2 __attribute__((const, overloadable))
681     convert_char2(long2 v);
682 #endif
684 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
685 extern char3 __attribute__((const, overloadable))
686     convert_char3(long3 v);
687 #endif
689 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
690 extern char4 __attribute__((const, overloadable))
691     convert_char4(long4 v);
692 #endif
694 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
695 extern char2 __attribute__((const, overloadable))
696     convert_char2(ulong2 v);
697 #endif
699 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
700 extern char3 __attribute__((const, overloadable))
701     convert_char3(ulong3 v);
702 #endif
704 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
705 extern char4 __attribute__((const, overloadable))
706     convert_char4(ulong4 v);
707 #endif
709 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
710 extern uchar2 __attribute__((const, overloadable))
711     convert_uchar2(double2 v);
712 #endif
714 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
715 extern uchar3 __attribute__((const, overloadable))
716     convert_uchar3(double3 v);
717 #endif
719 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
720 extern uchar4 __attribute__((const, overloadable))
721     convert_uchar4(double4 v);
722 #endif
724 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
725 extern uchar2 __attribute__((const, overloadable))
726     convert_uchar2(long2 v);
727 #endif
729 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
730 extern uchar3 __attribute__((const, overloadable))
731     convert_uchar3(long3 v);
732 #endif
734 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
735 extern uchar4 __attribute__((const, overloadable))
736     convert_uchar4(long4 v);
737 #endif
739 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
740 extern uchar2 __attribute__((const, overloadable))
741     convert_uchar2(ulong2 v);
742 #endif
744 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
745 extern uchar3 __attribute__((const, overloadable))
746     convert_uchar3(ulong3 v);
747 #endif
749 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
750 extern uchar4 __attribute__((const, overloadable))
751     convert_uchar4(ulong4 v);
752 #endif
754 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
755 extern short2 __attribute__((const, overloadable))
756     convert_short2(double2 v);
757 #endif
759 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
760 extern short3 __attribute__((const, overloadable))
761     convert_short3(double3 v);
762 #endif
764 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
765 extern short4 __attribute__((const, overloadable))
766     convert_short4(double4 v);
767 #endif
769 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
770 extern short2 __attribute__((const, overloadable))
771     convert_short2(long2 v);
772 #endif
774 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
775 extern short3 __attribute__((const, overloadable))
776     convert_short3(long3 v);
777 #endif
779 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
780 extern short4 __attribute__((const, overloadable))
781     convert_short4(long4 v);
782 #endif
784 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
785 extern short2 __attribute__((const, overloadable))
786     convert_short2(ulong2 v);
787 #endif
789 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
790 extern short3 __attribute__((const, overloadable))
791     convert_short3(ulong3 v);
792 #endif
794 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
795 extern short4 __attribute__((const, overloadable))
796     convert_short4(ulong4 v);
797 #endif
799 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
800 extern ushort2 __attribute__((const, overloadable))
801     convert_ushort2(double2 v);
802 #endif
804 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
805 extern ushort3 __attribute__((const, overloadable))
806     convert_ushort3(double3 v);
807 #endif
809 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
810 extern ushort4 __attribute__((const, overloadable))
811     convert_ushort4(double4 v);
812 #endif
814 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
815 extern ushort2 __attribute__((const, overloadable))
816     convert_ushort2(long2 v);
817 #endif
819 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
820 extern ushort3 __attribute__((const, overloadable))
821     convert_ushort3(long3 v);
822 #endif
824 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
825 extern ushort4 __attribute__((const, overloadable))
826     convert_ushort4(long4 v);
827 #endif
829 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
830 extern ushort2 __attribute__((const, overloadable))
831     convert_ushort2(ulong2 v);
832 #endif
834 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
835 extern ushort3 __attribute__((const, overloadable))
836     convert_ushort3(ulong3 v);
837 #endif
839 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
840 extern ushort4 __attribute__((const, overloadable))
841     convert_ushort4(ulong4 v);
842 #endif
844 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
845 extern int2 __attribute__((const, overloadable))
846     convert_int2(double2 v);
847 #endif
849 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
850 extern int3 __attribute__((const, overloadable))
851     convert_int3(double3 v);
852 #endif
854 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
855 extern int4 __attribute__((const, overloadable))
856     convert_int4(double4 v);
857 #endif
859 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
860 extern int2 __attribute__((const, overloadable))
861     convert_int2(long2 v);
862 #endif
864 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
865 extern int3 __attribute__((const, overloadable))
866     convert_int3(long3 v);
867 #endif
869 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
870 extern int4 __attribute__((const, overloadable))
871     convert_int4(long4 v);
872 #endif
874 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
875 extern int2 __attribute__((const, overloadable))
876     convert_int2(ulong2 v);
877 #endif
879 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
880 extern int3 __attribute__((const, overloadable))
881     convert_int3(ulong3 v);
882 #endif
884 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
885 extern int4 __attribute__((const, overloadable))
886     convert_int4(ulong4 v);
887 #endif
889 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
890 extern uint2 __attribute__((const, overloadable))
891     convert_uint2(double2 v);
892 #endif
894 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
895 extern uint3 __attribute__((const, overloadable))
896     convert_uint3(double3 v);
897 #endif
899 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
900 extern uint4 __attribute__((const, overloadable))
901     convert_uint4(double4 v);
902 #endif
904 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
905 extern uint2 __attribute__((const, overloadable))
906     convert_uint2(long2 v);
907 #endif
909 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
910 extern uint3 __attribute__((const, overloadable))
911     convert_uint3(long3 v);
912 #endif
914 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
915 extern uint4 __attribute__((const, overloadable))
916     convert_uint4(long4 v);
917 #endif
919 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
920 extern uint2 __attribute__((const, overloadable))
921     convert_uint2(ulong2 v);
922 #endif
924 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
925 extern uint3 __attribute__((const, overloadable))
926     convert_uint3(ulong3 v);
927 #endif
929 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
930 extern uint4 __attribute__((const, overloadable))
931     convert_uint4(ulong4 v);
932 #endif
934 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
935 extern double2 __attribute__((const, overloadable))
936     convert_double2(float2 v);
937 #endif
939 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
940 extern double3 __attribute__((const, overloadable))
941     convert_double3(float3 v);
942 #endif
944 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
945 extern double4 __attribute__((const, overloadable))
946     convert_double4(float4 v);
947 #endif
949 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
950 extern double2 __attribute__((const, overloadable))
951     convert_double2(char2 v);
952 #endif
954 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
955 extern double3 __attribute__((const, overloadable))
956     convert_double3(char3 v);
957 #endif
959 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
960 extern double4 __attribute__((const, overloadable))
961     convert_double4(char4 v);
962 #endif
964 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
965 extern double2 __attribute__((const, overloadable))
966     convert_double2(uchar2 v);
967 #endif
969 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
970 extern double3 __attribute__((const, overloadable))
971     convert_double3(uchar3 v);
972 #endif
974 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
975 extern double4 __attribute__((const, overloadable))
976     convert_double4(uchar4 v);
977 #endif
979 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
980 extern double2 __attribute__((const, overloadable))
981     convert_double2(short2 v);
982 #endif
984 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
985 extern double3 __attribute__((const, overloadable))
986     convert_double3(short3 v);
987 #endif
989 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
990 extern double4 __attribute__((const, overloadable))
991     convert_double4(short4 v);
992 #endif
994 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
995 extern double2 __attribute__((const, overloadable))
996     convert_double2(ushort2 v);
997 #endif
999 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1000 extern double3 __attribute__((const, overloadable))
1001     convert_double3(ushort3 v);
1002 #endif
1004 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1005 extern double4 __attribute__((const, overloadable))
1006     convert_double4(ushort4 v);
1007 #endif
1009 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1010 extern double2 __attribute__((const, overloadable))
1011     convert_double2(int2 v);
1012 #endif
1014 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1015 extern double3 __attribute__((const, overloadable))
1016     convert_double3(int3 v);
1017 #endif
1019 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1020 extern double4 __attribute__((const, overloadable))
1021     convert_double4(int4 v);
1022 #endif
1024 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1025 extern double2 __attribute__((const, overloadable))
1026     convert_double2(uint2 v);
1027 #endif
1029 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1030 extern double3 __attribute__((const, overloadable))
1031     convert_double3(uint3 v);
1032 #endif
1034 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1035 extern double4 __attribute__((const, overloadable))
1036     convert_double4(uint4 v);
1037 #endif
1039 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1040 extern long2 __attribute__((const, overloadable))
1041     convert_long2(float2 v);
1042 #endif
1044 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1045 extern long3 __attribute__((const, overloadable))
1046     convert_long3(float3 v);
1047 #endif
1049 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1050 extern long4 __attribute__((const, overloadable))
1051     convert_long4(float4 v);
1052 #endif
1054 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1055 extern long2 __attribute__((const, overloadable))
1056     convert_long2(char2 v);
1057 #endif
1059 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1060 extern long3 __attribute__((const, overloadable))
1061     convert_long3(char3 v);
1062 #endif
1064 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1065 extern long4 __attribute__((const, overloadable))
1066     convert_long4(char4 v);
1067 #endif
1069 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1070 extern long2 __attribute__((const, overloadable))
1071     convert_long2(uchar2 v);
1072 #endif
1074 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1075 extern long3 __attribute__((const, overloadable))
1076     convert_long3(uchar3 v);
1077 #endif
1079 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1080 extern long4 __attribute__((const, overloadable))
1081     convert_long4(uchar4 v);
1082 #endif
1084 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1085 extern long2 __attribute__((const, overloadable))
1086     convert_long2(short2 v);
1087 #endif
1089 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1090 extern long3 __attribute__((const, overloadable))
1091     convert_long3(short3 v);
1092 #endif
1094 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1095 extern long4 __attribute__((const, overloadable))
1096     convert_long4(short4 v);
1097 #endif
1099 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1100 extern long2 __attribute__((const, overloadable))
1101     convert_long2(ushort2 v);
1102 #endif
1104 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1105 extern long3 __attribute__((const, overloadable))
1106     convert_long3(ushort3 v);
1107 #endif
1109 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1110 extern long4 __attribute__((const, overloadable))
1111     convert_long4(ushort4 v);
1112 #endif
1114 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1115 extern long2 __attribute__((const, overloadable))
1116     convert_long2(int2 v);
1117 #endif
1119 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1120 extern long3 __attribute__((const, overloadable))
1121     convert_long3(int3 v);
1122 #endif
1124 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1125 extern long4 __attribute__((const, overloadable))
1126     convert_long4(int4 v);
1127 #endif
1129 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1130 extern long2 __attribute__((const, overloadable))
1131     convert_long2(uint2 v);
1132 #endif
1134 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1135 extern long3 __attribute__((const, overloadable))
1136     convert_long3(uint3 v);
1137 #endif
1139 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1140 extern long4 __attribute__((const, overloadable))
1141     convert_long4(uint4 v);
1142 #endif
1144 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1145 extern ulong2 __attribute__((const, overloadable))
1146     convert_ulong2(float2 v);
1147 #endif
1149 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1150 extern ulong3 __attribute__((const, overloadable))
1151     convert_ulong3(float3 v);
1152 #endif
1154 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1155 extern ulong4 __attribute__((const, overloadable))
1156     convert_ulong4(float4 v);
1157 #endif
1159 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1160 extern ulong2 __attribute__((const, overloadable))
1161     convert_ulong2(char2 v);
1162 #endif
1164 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1165 extern ulong3 __attribute__((const, overloadable))
1166     convert_ulong3(char3 v);
1167 #endif
1169 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1170 extern ulong4 __attribute__((const, overloadable))
1171     convert_ulong4(char4 v);
1172 #endif
1174 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1175 extern ulong2 __attribute__((const, overloadable))
1176     convert_ulong2(uchar2 v);
1177 #endif
1179 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1180 extern ulong3 __attribute__((const, overloadable))
1181     convert_ulong3(uchar3 v);
1182 #endif
1184 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1185 extern ulong4 __attribute__((const, overloadable))
1186     convert_ulong4(uchar4 v);
1187 #endif
1189 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1190 extern ulong2 __attribute__((const, overloadable))
1191     convert_ulong2(short2 v);
1192 #endif
1194 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1195 extern ulong3 __attribute__((const, overloadable))
1196     convert_ulong3(short3 v);
1197 #endif
1199 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1200 extern ulong4 __attribute__((const, overloadable))
1201     convert_ulong4(short4 v);
1202 #endif
1204 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1205 extern ulong2 __attribute__((const, overloadable))
1206     convert_ulong2(ushort2 v);
1207 #endif
1209 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1210 extern ulong3 __attribute__((const, overloadable))
1211     convert_ulong3(ushort3 v);
1212 #endif
1214 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1215 extern ulong4 __attribute__((const, overloadable))
1216     convert_ulong4(ushort4 v);
1217 #endif
1219 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1220 extern ulong2 __attribute__((const, overloadable))
1221     convert_ulong2(int2 v);
1222 #endif
1224 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1225 extern ulong3 __attribute__((const, overloadable))
1226     convert_ulong3(int3 v);
1227 #endif
1229 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1230 extern ulong4 __attribute__((const, overloadable))
1231     convert_ulong4(int4 v);
1232 #endif
1234 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1235 extern ulong2 __attribute__((const, overloadable))
1236     convert_ulong2(uint2 v);
1237 #endif
1239 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1240 extern ulong3 __attribute__((const, overloadable))
1241     convert_ulong3(uint3 v);
1242 #endif
1244 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
1245 extern ulong4 __attribute__((const, overloadable))
1246     convert_ulong4(uint4 v);
1247 #endif
1249 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1250 extern half2 __attribute__((const, overloadable))
1251     convert_half2(half2 v);
1252 #endif
1254 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1255 extern half3 __attribute__((const, overloadable))
1256     convert_half3(half3 v);
1257 #endif
1259 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1260 extern half4 __attribute__((const, overloadable))
1261     convert_half4(half4 v);
1262 #endif
1264 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1265 extern float2 __attribute__((const, overloadable))
1266     convert_float2(half2 v);
1267 #endif
1269 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1270 extern float3 __attribute__((const, overloadable))
1271     convert_float3(half3 v);
1272 #endif
1274 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1275 extern float4 __attribute__((const, overloadable))
1276     convert_float4(half4 v);
1277 #endif
1279 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1280 extern double2 __attribute__((const, overloadable))
1281     convert_double2(half2 v);
1282 #endif
1284 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1285 extern double3 __attribute__((const, overloadable))
1286     convert_double3(half3 v);
1287 #endif
1289 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1290 extern double4 __attribute__((const, overloadable))
1291     convert_double4(half4 v);
1292 #endif
1294 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1295 extern char2 __attribute__((const, overloadable))
1296     convert_char2(half2 v);
1297 #endif
1299 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1300 extern char3 __attribute__((const, overloadable))
1301     convert_char3(half3 v);
1302 #endif
1304 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1305 extern char4 __attribute__((const, overloadable))
1306     convert_char4(half4 v);
1307 #endif
1309 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1310 extern uchar2 __attribute__((const, overloadable))
1311     convert_uchar2(half2 v);
1312 #endif
1314 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1315 extern uchar3 __attribute__((const, overloadable))
1316     convert_uchar3(half3 v);
1317 #endif
1319 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1320 extern uchar4 __attribute__((const, overloadable))
1321     convert_uchar4(half4 v);
1322 #endif
1324 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1325 extern short2 __attribute__((const, overloadable))
1326     convert_short2(half2 v);
1327 #endif
1329 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1330 extern short3 __attribute__((const, overloadable))
1331     convert_short3(half3 v);
1332 #endif
1334 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1335 extern short4 __attribute__((const, overloadable))
1336     convert_short4(half4 v);
1337 #endif
1339 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1340 extern ushort2 __attribute__((const, overloadable))
1341     convert_ushort2(half2 v);
1342 #endif
1344 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1345 extern ushort3 __attribute__((const, overloadable))
1346     convert_ushort3(half3 v);
1347 #endif
1349 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1350 extern ushort4 __attribute__((const, overloadable))
1351     convert_ushort4(half4 v);
1352 #endif
1354 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1355 extern int2 __attribute__((const, overloadable))
1356     convert_int2(half2 v);
1357 #endif
1359 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1360 extern int3 __attribute__((const, overloadable))
1361     convert_int3(half3 v);
1362 #endif
1364 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1365 extern int4 __attribute__((const, overloadable))
1366     convert_int4(half4 v);
1367 #endif
1369 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1370 extern uint2 __attribute__((const, overloadable))
1371     convert_uint2(half2 v);
1372 #endif
1374 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1375 extern uint3 __attribute__((const, overloadable))
1376     convert_uint3(half3 v);
1377 #endif
1379 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1380 extern uint4 __attribute__((const, overloadable))
1381     convert_uint4(half4 v);
1382 #endif
1384 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1385 extern long2 __attribute__((const, overloadable))
1386     convert_long2(half2 v);
1387 #endif
1389 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1390 extern long3 __attribute__((const, overloadable))
1391     convert_long3(half3 v);
1392 #endif
1394 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1395 extern long4 __attribute__((const, overloadable))
1396     convert_long4(half4 v);
1397 #endif
1399 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1400 extern ulong2 __attribute__((const, overloadable))
1401     convert_ulong2(half2 v);
1402 #endif
1404 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1405 extern ulong3 __attribute__((const, overloadable))
1406     convert_ulong3(half3 v);
1407 #endif
1409 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1410 extern ulong4 __attribute__((const, overloadable))
1411     convert_ulong4(half4 v);
1412 #endif
1414 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1415 extern half2 __attribute__((const, overloadable))
1416     convert_half2(float2 v);
1417 #endif
1419 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1420 extern half3 __attribute__((const, overloadable))
1421     convert_half3(float3 v);
1422 #endif
1424 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1425 extern half4 __attribute__((const, overloadable))
1426     convert_half4(float4 v);
1427 #endif
1429 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1430 extern half2 __attribute__((const, overloadable))
1431     convert_half2(double2 v);
1432 #endif
1434 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1435 extern half3 __attribute__((const, overloadable))
1436     convert_half3(double3 v);
1437 #endif
1439 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1440 extern half4 __attribute__((const, overloadable))
1441     convert_half4(double4 v);
1442 #endif
1444 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1445 extern half2 __attribute__((const, overloadable))
1446     convert_half2(char2 v);
1447 #endif
1449 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1450 extern half3 __attribute__((const, overloadable))
1451     convert_half3(char3 v);
1452 #endif
1454 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1455 extern half4 __attribute__((const, overloadable))
1456     convert_half4(char4 v);
1457 #endif
1459 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1460 extern half2 __attribute__((const, overloadable))
1461     convert_half2(uchar2 v);
1462 #endif
1464 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1465 extern half3 __attribute__((const, overloadable))
1466     convert_half3(uchar3 v);
1467 #endif
1469 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1470 extern half4 __attribute__((const, overloadable))
1471     convert_half4(uchar4 v);
1472 #endif
1474 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1475 extern half2 __attribute__((const, overloadable))
1476     convert_half2(short2 v);
1477 #endif
1479 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1480 extern half3 __attribute__((const, overloadable))
1481     convert_half3(short3 v);
1482 #endif
1484 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1485 extern half4 __attribute__((const, overloadable))
1486     convert_half4(short4 v);
1487 #endif
1489 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1490 extern half2 __attribute__((const, overloadable))
1491     convert_half2(ushort2 v);
1492 #endif
1494 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1495 extern half3 __attribute__((const, overloadable))
1496     convert_half3(ushort3 v);
1497 #endif
1499 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1500 extern half4 __attribute__((const, overloadable))
1501     convert_half4(ushort4 v);
1502 #endif
1504 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1505 extern half2 __attribute__((const, overloadable))
1506     convert_half2(int2 v);
1507 #endif
1509 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1510 extern half3 __attribute__((const, overloadable))
1511     convert_half3(int3 v);
1512 #endif
1514 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1515 extern half4 __attribute__((const, overloadable))
1516     convert_half4(int4 v);
1517 #endif
1519 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1520 extern half2 __attribute__((const, overloadable))
1521     convert_half2(uint2 v);
1522 #endif
1524 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1525 extern half3 __attribute__((const, overloadable))
1526     convert_half3(uint3 v);
1527 #endif
1529 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1530 extern half4 __attribute__((const, overloadable))
1531     convert_half4(uint4 v);
1532 #endif
1534 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1535 extern half2 __attribute__((const, overloadable))
1536     convert_half2(long2 v);
1537 #endif
1539 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1540 extern half3 __attribute__((const, overloadable))
1541     convert_half3(long3 v);
1542 #endif
1544 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1545 extern half4 __attribute__((const, overloadable))
1546     convert_half4(long4 v);
1547 #endif
1549 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1550 extern half2 __attribute__((const, overloadable))
1551     convert_half2(ulong2 v);
1552 #endif
1554 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1555 extern half3 __attribute__((const, overloadable))
1556     convert_half3(ulong3 v);
1557 #endif
1559 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
1560 extern half4 __attribute__((const, overloadable))
1561     convert_half4(ulong4 v);
1562 #endif
1565  * rsPackColorTo8888: Create a uchar4 RGBA from floats
1567  * Packs three or four floating point RGBA values into a uchar4.
1569  * The input values are typically between 0.0f and 1.0f inclusive.  For input values outside
1570  * of this range, the resulting outputs will be clamped to be between 0 and 255.  As this
1571  * clamping may be done after the input is multiplied by 255.f and converted to an integer,
1572  * input numbers greater than INT_MAX/255.f or less than INT_MIN/255.f result in
1573  * undefined behavior.
1575  * If the alpha component is not specified, it is assumed to be 1.0, i.e. the result will
1576  * have an alpha set to 255.
1578  * Parameters:
1579  *   r: Red component.
1580  *   g: Green component.
1581  *   b: Blue component.
1582  *   a: Alpha component.
1583  *   color: Vector of 3 or 4 floats containing the R, G, B, and A values.
1584  */
1585 extern uchar4 __attribute__((const, overloadable))
1586     rsPackColorTo8888(float r, float g, float b);
1588 extern uchar4 __attribute__((const, overloadable))
1589     rsPackColorTo8888(float r, float g, float b, float a);
1591 extern uchar4 __attribute__((const, overloadable))
1592     rsPackColorTo8888(float3 color);
1594 extern uchar4 __attribute__((const, overloadable))
1595     rsPackColorTo8888(float4 color);
1598  * rsUnpackColor8888: Create a float4 RGBA from uchar4
1600  * Unpacks a uchar4 color to float4.  The resulting floats will be between 0.0 and 1.0 inclusive.
1601  */
1602 extern float4 __attribute__((const))
1603     rsUnpackColor8888(uchar4 c);
1606  * rsYuvToRGBA: Convert a YUV value to RGBA
1608  * Converts a color from a YUV representation to RGBA.
1610  * We currently don't provide a function to do the reverse conversion.
1612  * Parameters:
1613  *   y: Luminance component.
1614  *   u: U chrominance component.
1615  *   v: V chrominance component.
1616  */
1617 extern float4 __attribute__((const, overloadable))
1618     rsYuvToRGBA_float4(uchar y, uchar u, uchar v);
1620 extern uchar4 __attribute__((const, overloadable))
1621     rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v);
1623 #endif // RENDERSCRIPT_RS_CONVERT_RSH