Home | History | Annotate | Download | only in include
      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  */
     16 
     17 // Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
     18 
     19 /*
     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  */
     25 
     26 #ifndef RENDERSCRIPT_RS_CONVERT_RSH
     27 #define RENDERSCRIPT_RS_CONVERT_RSH
     28 
     29 /*
     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);
     45 
     46 extern float3 __attribute__((const, overloadable))
     47     convert_float3(float3 v);
     48 
     49 extern float4 __attribute__((const, overloadable))
     50     convert_float4(float4 v);
     51 
     52 extern float2 __attribute__((const, overloadable))
     53     convert_float2(char2 v);
     54 
     55 extern float3 __attribute__((const, overloadable))
     56     convert_float3(char3 v);
     57 
     58 extern float4 __attribute__((const, overloadable))
     59     convert_float4(char4 v);
     60 
     61 extern float2 __attribute__((const, overloadable))
     62     convert_float2(uchar2 v);
     63 
     64 extern float3 __attribute__((const, overloadable))
     65     convert_float3(uchar3 v);
     66 
     67 extern float4 __attribute__((const, overloadable))
     68     convert_float4(uchar4 v);
     69 
     70 extern float2 __attribute__((const, overloadable))
     71     convert_float2(short2 v);
     72 
     73 extern float3 __attribute__((const, overloadable))
     74     convert_float3(short3 v);
     75 
     76 extern float4 __attribute__((const, overloadable))
     77     convert_float4(short4 v);
     78 
     79 extern float2 __attribute__((const, overloadable))
     80     convert_float2(ushort2 v);
     81 
     82 extern float3 __attribute__((const, overloadable))
     83     convert_float3(ushort3 v);
     84 
     85 extern float4 __attribute__((const, overloadable))
     86     convert_float4(ushort4 v);
     87 
     88 extern float2 __attribute__((const, overloadable))
     89     convert_float2(int2 v);
     90 
     91 extern float3 __attribute__((const, overloadable))
     92     convert_float3(int3 v);
     93 
     94 extern float4 __attribute__((const, overloadable))
     95     convert_float4(int4 v);
     96 
     97 extern float2 __attribute__((const, overloadable))
     98     convert_float2(uint2 v);
     99 
    100 extern float3 __attribute__((const, overloadable))
    101     convert_float3(uint3 v);
    102 
    103 extern float4 __attribute__((const, overloadable))
    104     convert_float4(uint4 v);
    105 
    106 extern char2 __attribute__((const, overloadable))
    107     convert_char2(float2 v);
    108 
    109 extern char3 __attribute__((const, overloadable))
    110     convert_char3(float3 v);
    111 
    112 extern char4 __attribute__((const, overloadable))
    113     convert_char4(float4 v);
    114 
    115 extern char2 __attribute__((const, overloadable))
    116     convert_char2(char2 v);
    117 
    118 extern char3 __attribute__((const, overloadable))
    119     convert_char3(char3 v);
    120 
    121 extern char4 __attribute__((const, overloadable))
    122     convert_char4(char4 v);
    123 
    124 extern char2 __attribute__((const, overloadable))
    125     convert_char2(uchar2 v);
    126 
    127 extern char3 __attribute__((const, overloadable))
    128     convert_char3(uchar3 v);
    129 
    130 extern char4 __attribute__((const, overloadable))
    131     convert_char4(uchar4 v);
    132 
    133 extern char2 __attribute__((const, overloadable))
    134     convert_char2(short2 v);
    135 
    136 extern char3 __attribute__((const, overloadable))
    137     convert_char3(short3 v);
    138 
    139 extern char4 __attribute__((const, overloadable))
    140     convert_char4(short4 v);
    141 
    142 extern char2 __attribute__((const, overloadable))
    143     convert_char2(ushort2 v);
    144 
    145 extern char3 __attribute__((const, overloadable))
    146     convert_char3(ushort3 v);
    147 
    148 extern char4 __attribute__((const, overloadable))
    149     convert_char4(ushort4 v);
    150 
    151 extern char2 __attribute__((const, overloadable))
    152     convert_char2(int2 v);
    153 
    154 extern char3 __attribute__((const, overloadable))
    155     convert_char3(int3 v);
    156 
    157 extern char4 __attribute__((const, overloadable))
    158     convert_char4(int4 v);
    159 
    160 extern char2 __attribute__((const, overloadable))
    161     convert_char2(uint2 v);
    162 
    163 extern char3 __attribute__((const, overloadable))
    164     convert_char3(uint3 v);
    165 
    166 extern char4 __attribute__((const, overloadable))
    167     convert_char4(uint4 v);
    168 
    169 extern uchar2 __attribute__((const, overloadable))
    170     convert_uchar2(float2 v);
    171 
    172 extern uchar3 __attribute__((const, overloadable))
    173     convert_uchar3(float3 v);
    174 
    175 extern uchar4 __attribute__((const, overloadable))
    176     convert_uchar4(float4 v);
    177 
    178 extern uchar2 __attribute__((const, overloadable))
    179     convert_uchar2(char2 v);
    180 
    181 extern uchar3 __attribute__((const, overloadable))
    182     convert_uchar3(char3 v);
    183 
    184 extern uchar4 __attribute__((const, overloadable))
    185     convert_uchar4(char4 v);
    186 
    187 extern uchar2 __attribute__((const, overloadable))
    188     convert_uchar2(uchar2 v);
    189 
    190 extern uchar3 __attribute__((const, overloadable))
    191     convert_uchar3(uchar3 v);
    192 
    193 extern uchar4 __attribute__((const, overloadable))
    194     convert_uchar4(uchar4 v);
    195 
    196 extern uchar2 __attribute__((const, overloadable))
    197     convert_uchar2(short2 v);
    198 
    199 extern uchar3 __attribute__((const, overloadable))
    200     convert_uchar3(short3 v);
    201 
    202 extern uchar4 __attribute__((const, overloadable))
    203     convert_uchar4(short4 v);
    204 
    205 extern uchar2 __attribute__((const, overloadable))
    206     convert_uchar2(ushort2 v);
    207 
    208 extern uchar3 __attribute__((const, overloadable))
    209     convert_uchar3(ushort3 v);
    210 
    211 extern uchar4 __attribute__((const, overloadable))
    212     convert_uchar4(ushort4 v);
    213 
    214 extern uchar2 __attribute__((const, overloadable))
    215     convert_uchar2(int2 v);
    216 
    217 extern uchar3 __attribute__((const, overloadable))
    218     convert_uchar3(int3 v);
    219 
    220 extern uchar4 __attribute__((const, overloadable))
    221     convert_uchar4(int4 v);
    222 
    223 extern uchar2 __attribute__((const, overloadable))
    224     convert_uchar2(uint2 v);
    225 
    226 extern uchar3 __attribute__((const, overloadable))
    227     convert_uchar3(uint3 v);
    228 
    229 extern uchar4 __attribute__((const, overloadable))
    230     convert_uchar4(uint4 v);
    231 
    232 extern short2 __attribute__((const, overloadable))
    233     convert_short2(float2 v);
    234 
    235 extern short3 __attribute__((const, overloadable))
    236     convert_short3(float3 v);
    237 
    238 extern short4 __attribute__((const, overloadable))
    239     convert_short4(float4 v);
    240 
    241 extern short2 __attribute__((const, overloadable))
    242     convert_short2(char2 v);
    243 
    244 extern short3 __attribute__((const, overloadable))
    245     convert_short3(char3 v);
    246 
    247 extern short4 __attribute__((const, overloadable))
    248     convert_short4(char4 v);
    249 
    250 extern short2 __attribute__((const, overloadable))
    251     convert_short2(uchar2 v);
    252 
    253 extern short3 __attribute__((const, overloadable))
    254     convert_short3(uchar3 v);
    255 
    256 extern short4 __attribute__((const, overloadable))
    257     convert_short4(uchar4 v);
    258 
    259 extern short2 __attribute__((const, overloadable))
    260     convert_short2(short2 v);
    261 
    262 extern short3 __attribute__((const, overloadable))
    263     convert_short3(short3 v);
    264 
    265 extern short4 __attribute__((const, overloadable))
    266     convert_short4(short4 v);
    267 
    268 extern short2 __attribute__((const, overloadable))
    269     convert_short2(ushort2 v);
    270 
    271 extern short3 __attribute__((const, overloadable))
    272     convert_short3(ushort3 v);
    273 
    274 extern short4 __attribute__((const, overloadable))
    275     convert_short4(ushort4 v);
    276 
    277 extern short2 __attribute__((const, overloadable))
    278     convert_short2(int2 v);
    279 
    280 extern short3 __attribute__((const, overloadable))
    281     convert_short3(int3 v);
    282 
    283 extern short4 __attribute__((const, overloadable))
    284     convert_short4(int4 v);
    285 
    286 extern short2 __attribute__((const, overloadable))
    287     convert_short2(uint2 v);
    288 
    289 extern short3 __attribute__((const, overloadable))
    290     convert_short3(uint3 v);
    291 
    292 extern short4 __attribute__((const, overloadable))
    293     convert_short4(uint4 v);
    294 
    295 extern ushort2 __attribute__((const, overloadable))
    296     convert_ushort2(float2 v);
    297 
    298 extern ushort3 __attribute__((const, overloadable))
    299     convert_ushort3(float3 v);
    300 
    301 extern ushort4 __attribute__((const, overloadable))
    302     convert_ushort4(float4 v);
    303 
    304 extern ushort2 __attribute__((const, overloadable))
    305     convert_ushort2(char2 v);
    306 
    307 extern ushort3 __attribute__((const, overloadable))
    308     convert_ushort3(char3 v);
    309 
    310 extern ushort4 __attribute__((const, overloadable))
    311     convert_ushort4(char4 v);
    312 
    313 extern ushort2 __attribute__((const, overloadable))
    314     convert_ushort2(uchar2 v);
    315 
    316 extern ushort3 __attribute__((const, overloadable))
    317     convert_ushort3(uchar3 v);
    318 
    319 extern ushort4 __attribute__((const, overloadable))
    320     convert_ushort4(uchar4 v);
    321 
    322 extern ushort2 __attribute__((const, overloadable))
    323     convert_ushort2(short2 v);
    324 
    325 extern ushort3 __attribute__((const, overloadable))
    326     convert_ushort3(short3 v);
    327 
    328 extern ushort4 __attribute__((const, overloadable))
    329     convert_ushort4(short4 v);
    330 
    331 extern ushort2 __attribute__((const, overloadable))
    332     convert_ushort2(ushort2 v);
    333 
    334 extern ushort3 __attribute__((const, overloadable))
    335     convert_ushort3(ushort3 v);
    336 
    337 extern ushort4 __attribute__((const, overloadable))
    338     convert_ushort4(ushort4 v);
    339 
    340 extern ushort2 __attribute__((const, overloadable))
    341     convert_ushort2(int2 v);
    342 
    343 extern ushort3 __attribute__((const, overloadable))
    344     convert_ushort3(int3 v);
    345 
    346 extern ushort4 __attribute__((const, overloadable))
    347     convert_ushort4(int4 v);
    348 
    349 extern ushort2 __attribute__((const, overloadable))
    350     convert_ushort2(uint2 v);
    351 
    352 extern ushort3 __attribute__((const, overloadable))
    353     convert_ushort3(uint3 v);
    354 
    355 extern ushort4 __attribute__((const, overloadable))
    356     convert_ushort4(uint4 v);
    357 
    358 extern int2 __attribute__((const, overloadable))
    359     convert_int2(float2 v);
    360 
    361 extern int3 __attribute__((const, overloadable))
    362     convert_int3(float3 v);
    363 
    364 extern int4 __attribute__((const, overloadable))
    365     convert_int4(float4 v);
    366 
    367 extern int2 __attribute__((const, overloadable))
    368     convert_int2(char2 v);
    369 
    370 extern int3 __attribute__((const, overloadable))
    371     convert_int3(char3 v);
    372 
    373 extern int4 __attribute__((const, overloadable))
    374     convert_int4(char4 v);
    375 
    376 extern int2 __attribute__((const, overloadable))
    377     convert_int2(uchar2 v);
    378 
    379 extern int3 __attribute__((const, overloadable))
    380     convert_int3(uchar3 v);
    381 
    382 extern int4 __attribute__((const, overloadable))
    383     convert_int4(uchar4 v);
    384 
    385 extern int2 __attribute__((const, overloadable))
    386     convert_int2(short2 v);
    387 
    388 extern int3 __attribute__((const, overloadable))
    389     convert_int3(short3 v);
    390 
    391 extern int4 __attribute__((const, overloadable))
    392     convert_int4(short4 v);
    393 
    394 extern int2 __attribute__((const, overloadable))
    395     convert_int2(ushort2 v);
    396 
    397 extern int3 __attribute__((const, overloadable))
    398     convert_int3(ushort3 v);
    399 
    400 extern int4 __attribute__((const, overloadable))
    401     convert_int4(ushort4 v);
    402 
    403 extern int2 __attribute__((const, overloadable))
    404     convert_int2(int2 v);
    405 
    406 extern int3 __attribute__((const, overloadable))
    407     convert_int3(int3 v);
    408 
    409 extern int4 __attribute__((const, overloadable))
    410     convert_int4(int4 v);
    411 
    412 extern int2 __attribute__((const, overloadable))
    413     convert_int2(uint2 v);
    414 
    415 extern int3 __attribute__((const, overloadable))
    416     convert_int3(uint3 v);
    417 
    418 extern int4 __attribute__((const, overloadable))
    419     convert_int4(uint4 v);
    420 
    421 extern uint2 __attribute__((const, overloadable))
    422     convert_uint2(float2 v);
    423 
    424 extern uint3 __attribute__((const, overloadable))
    425     convert_uint3(float3 v);
    426 
    427 extern uint4 __attribute__((const, overloadable))
    428     convert_uint4(float4 v);
    429 
    430 extern uint2 __attribute__((const, overloadable))
    431     convert_uint2(char2 v);
    432 
    433 extern uint3 __attribute__((const, overloadable))
    434     convert_uint3(char3 v);
    435 
    436 extern uint4 __attribute__((const, overloadable))
    437     convert_uint4(char4 v);
    438 
    439 extern uint2 __attribute__((const, overloadable))
    440     convert_uint2(uchar2 v);
    441 
    442 extern uint3 __attribute__((const, overloadable))
    443     convert_uint3(uchar3 v);
    444 
    445 extern uint4 __attribute__((const, overloadable))
    446     convert_uint4(uchar4 v);
    447 
    448 extern uint2 __attribute__((const, overloadable))
    449     convert_uint2(short2 v);
    450 
    451 extern uint3 __attribute__((const, overloadable))
    452     convert_uint3(short3 v);
    453 
    454 extern uint4 __attribute__((const, overloadable))
    455     convert_uint4(short4 v);
    456 
    457 extern uint2 __attribute__((const, overloadable))
    458     convert_uint2(ushort2 v);
    459 
    460 extern uint3 __attribute__((const, overloadable))
    461     convert_uint3(ushort3 v);
    462 
    463 extern uint4 __attribute__((const, overloadable))
    464     convert_uint4(ushort4 v);
    465 
    466 extern uint2 __attribute__((const, overloadable))
    467     convert_uint2(int2 v);
    468 
    469 extern uint3 __attribute__((const, overloadable))
    470     convert_uint3(int3 v);
    471 
    472 extern uint4 __attribute__((const, overloadable))
    473     convert_uint4(int4 v);
    474 
    475 extern uint2 __attribute__((const, overloadable))
    476     convert_uint2(uint2 v);
    477 
    478 extern uint3 __attribute__((const, overloadable))
    479     convert_uint3(uint3 v);
    480 
    481 extern uint4 __attribute__((const, overloadable))
    482     convert_uint4(uint4 v);
    483 
    484 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    485 extern double2 __attribute__((const, overloadable))
    486     convert_double2(double2 v);
    487 #endif
    488 
    489 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    490 extern double3 __attribute__((const, overloadable))
    491     convert_double3(double3 v);
    492 #endif
    493 
    494 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    495 extern double4 __attribute__((const, overloadable))
    496     convert_double4(double4 v);
    497 #endif
    498 
    499 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    500 extern double2 __attribute__((const, overloadable))
    501     convert_double2(long2 v);
    502 #endif
    503 
    504 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    505 extern double3 __attribute__((const, overloadable))
    506     convert_double3(long3 v);
    507 #endif
    508 
    509 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    510 extern double4 __attribute__((const, overloadable))
    511     convert_double4(long4 v);
    512 #endif
    513 
    514 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    515 extern double2 __attribute__((const, overloadable))
    516     convert_double2(ulong2 v);
    517 #endif
    518 
    519 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    520 extern double3 __attribute__((const, overloadable))
    521     convert_double3(ulong3 v);
    522 #endif
    523 
    524 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    525 extern double4 __attribute__((const, overloadable))
    526     convert_double4(ulong4 v);
    527 #endif
    528 
    529 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    530 extern long2 __attribute__((const, overloadable))
    531     convert_long2(double2 v);
    532 #endif
    533 
    534 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    535 extern long3 __attribute__((const, overloadable))
    536     convert_long3(double3 v);
    537 #endif
    538 
    539 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    540 extern long4 __attribute__((const, overloadable))
    541     convert_long4(double4 v);
    542 #endif
    543 
    544 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    545 extern long2 __attribute__((const, overloadable))
    546     convert_long2(long2 v);
    547 #endif
    548 
    549 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    550 extern long3 __attribute__((const, overloadable))
    551     convert_long3(long3 v);
    552 #endif
    553 
    554 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    555 extern long4 __attribute__((const, overloadable))
    556     convert_long4(long4 v);
    557 #endif
    558 
    559 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    560 extern long2 __attribute__((const, overloadable))
    561     convert_long2(ulong2 v);
    562 #endif
    563 
    564 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    565 extern long3 __attribute__((const, overloadable))
    566     convert_long3(ulong3 v);
    567 #endif
    568 
    569 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    570 extern long4 __attribute__((const, overloadable))
    571     convert_long4(ulong4 v);
    572 #endif
    573 
    574 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    575 extern ulong2 __attribute__((const, overloadable))
    576     convert_ulong2(double2 v);
    577 #endif
    578 
    579 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    580 extern ulong3 __attribute__((const, overloadable))
    581     convert_ulong3(double3 v);
    582 #endif
    583 
    584 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    585 extern ulong4 __attribute__((const, overloadable))
    586     convert_ulong4(double4 v);
    587 #endif
    588 
    589 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    590 extern ulong2 __attribute__((const, overloadable))
    591     convert_ulong2(long2 v);
    592 #endif
    593 
    594 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    595 extern ulong3 __attribute__((const, overloadable))
    596     convert_ulong3(long3 v);
    597 #endif
    598 
    599 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    600 extern ulong4 __attribute__((const, overloadable))
    601     convert_ulong4(long4 v);
    602 #endif
    603 
    604 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    605 extern ulong2 __attribute__((const, overloadable))
    606     convert_ulong2(ulong2 v);
    607 #endif
    608 
    609 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    610 extern ulong3 __attribute__((const, overloadable))
    611     convert_ulong3(ulong3 v);
    612 #endif
    613 
    614 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    615 extern ulong4 __attribute__((const, overloadable))
    616     convert_ulong4(ulong4 v);
    617 #endif
    618 
    619 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    620 extern float2 __attribute__((const, overloadable))
    621     convert_float2(double2 v);
    622 #endif
    623 
    624 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    625 extern float3 __attribute__((const, overloadable))
    626     convert_float3(double3 v);
    627 #endif
    628 
    629 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    630 extern float4 __attribute__((const, overloadable))
    631     convert_float4(double4 v);
    632 #endif
    633 
    634 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    635 extern float2 __attribute__((const, overloadable))
    636     convert_float2(long2 v);
    637 #endif
    638 
    639 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    640 extern float3 __attribute__((const, overloadable))
    641     convert_float3(long3 v);
    642 #endif
    643 
    644 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    645 extern float4 __attribute__((const, overloadable))
    646     convert_float4(long4 v);
    647 #endif
    648 
    649 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    650 extern float2 __attribute__((const, overloadable))
    651     convert_float2(ulong2 v);
    652 #endif
    653 
    654 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    655 extern float3 __attribute__((const, overloadable))
    656     convert_float3(ulong3 v);
    657 #endif
    658 
    659 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    660 extern float4 __attribute__((const, overloadable))
    661     convert_float4(ulong4 v);
    662 #endif
    663 
    664 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    665 extern char2 __attribute__((const, overloadable))
    666     convert_char2(double2 v);
    667 #endif
    668 
    669 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    670 extern char3 __attribute__((const, overloadable))
    671     convert_char3(double3 v);
    672 #endif
    673 
    674 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    675 extern char4 __attribute__((const, overloadable))
    676     convert_char4(double4 v);
    677 #endif
    678 
    679 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    680 extern char2 __attribute__((const, overloadable))
    681     convert_char2(long2 v);
    682 #endif
    683 
    684 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    685 extern char3 __attribute__((const, overloadable))
    686     convert_char3(long3 v);
    687 #endif
    688 
    689 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    690 extern char4 __attribute__((const, overloadable))
    691     convert_char4(long4 v);
    692 #endif
    693 
    694 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    695 extern char2 __attribute__((const, overloadable))
    696     convert_char2(ulong2 v);
    697 #endif
    698 
    699 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    700 extern char3 __attribute__((const, overloadable))
    701     convert_char3(ulong3 v);
    702 #endif
    703 
    704 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    705 extern char4 __attribute__((const, overloadable))
    706     convert_char4(ulong4 v);
    707 #endif
    708 
    709 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    710 extern uchar2 __attribute__((const, overloadable))
    711     convert_uchar2(double2 v);
    712 #endif
    713 
    714 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    715 extern uchar3 __attribute__((const, overloadable))
    716     convert_uchar3(double3 v);
    717 #endif
    718 
    719 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    720 extern uchar4 __attribute__((const, overloadable))
    721     convert_uchar4(double4 v);
    722 #endif
    723 
    724 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    725 extern uchar2 __attribute__((const, overloadable))
    726     convert_uchar2(long2 v);
    727 #endif
    728 
    729 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    730 extern uchar3 __attribute__((const, overloadable))
    731     convert_uchar3(long3 v);
    732 #endif
    733 
    734 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    735 extern uchar4 __attribute__((const, overloadable))
    736     convert_uchar4(long4 v);
    737 #endif
    738 
    739 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    740 extern uchar2 __attribute__((const, overloadable))
    741     convert_uchar2(ulong2 v);
    742 #endif
    743 
    744 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    745 extern uchar3 __attribute__((const, overloadable))
    746     convert_uchar3(ulong3 v);
    747 #endif
    748 
    749 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    750 extern uchar4 __attribute__((const, overloadable))
    751     convert_uchar4(ulong4 v);
    752 #endif
    753 
    754 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    755 extern short2 __attribute__((const, overloadable))
    756     convert_short2(double2 v);
    757 #endif
    758 
    759 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    760 extern short3 __attribute__((const, overloadable))
    761     convert_short3(double3 v);
    762 #endif
    763 
    764 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    765 extern short4 __attribute__((const, overloadable))
    766     convert_short4(double4 v);
    767 #endif
    768 
    769 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    770 extern short2 __attribute__((const, overloadable))
    771     convert_short2(long2 v);
    772 #endif
    773 
    774 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    775 extern short3 __attribute__((const, overloadable))
    776     convert_short3(long3 v);
    777 #endif
    778 
    779 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    780 extern short4 __attribute__((const, overloadable))
    781     convert_short4(long4 v);
    782 #endif
    783 
    784 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    785 extern short2 __attribute__((const, overloadable))
    786     convert_short2(ulong2 v);
    787 #endif
    788 
    789 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    790 extern short3 __attribute__((const, overloadable))
    791     convert_short3(ulong3 v);
    792 #endif
    793 
    794 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    795 extern short4 __attribute__((const, overloadable))
    796     convert_short4(ulong4 v);
    797 #endif
    798 
    799 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    800 extern ushort2 __attribute__((const, overloadable))
    801     convert_ushort2(double2 v);
    802 #endif
    803 
    804 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    805 extern ushort3 __attribute__((const, overloadable))
    806     convert_ushort3(double3 v);
    807 #endif
    808 
    809 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    810 extern ushort4 __attribute__((const, overloadable))
    811     convert_ushort4(double4 v);
    812 #endif
    813 
    814 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    815 extern ushort2 __attribute__((const, overloadable))
    816     convert_ushort2(long2 v);
    817 #endif
    818 
    819 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    820 extern ushort3 __attribute__((const, overloadable))
    821     convert_ushort3(long3 v);
    822 #endif
    823 
    824 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    825 extern ushort4 __attribute__((const, overloadable))
    826     convert_ushort4(long4 v);
    827 #endif
    828 
    829 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    830 extern ushort2 __attribute__((const, overloadable))
    831     convert_ushort2(ulong2 v);
    832 #endif
    833 
    834 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    835 extern ushort3 __attribute__((const, overloadable))
    836     convert_ushort3(ulong3 v);
    837 #endif
    838 
    839 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    840 extern ushort4 __attribute__((const, overloadable))
    841     convert_ushort4(ulong4 v);
    842 #endif
    843 
    844 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    845 extern int2 __attribute__((const, overloadable))
    846     convert_int2(double2 v);
    847 #endif
    848 
    849 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    850 extern int3 __attribute__((const, overloadable))
    851     convert_int3(double3 v);
    852 #endif
    853 
    854 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    855 extern int4 __attribute__((const, overloadable))
    856     convert_int4(double4 v);
    857 #endif
    858 
    859 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    860 extern int2 __attribute__((const, overloadable))
    861     convert_int2(long2 v);
    862 #endif
    863 
    864 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    865 extern int3 __attribute__((const, overloadable))
    866     convert_int3(long3 v);
    867 #endif
    868 
    869 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    870 extern int4 __attribute__((const, overloadable))
    871     convert_int4(long4 v);
    872 #endif
    873 
    874 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    875 extern int2 __attribute__((const, overloadable))
    876     convert_int2(ulong2 v);
    877 #endif
    878 
    879 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    880 extern int3 __attribute__((const, overloadable))
    881     convert_int3(ulong3 v);
    882 #endif
    883 
    884 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    885 extern int4 __attribute__((const, overloadable))
    886     convert_int4(ulong4 v);
    887 #endif
    888 
    889 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    890 extern uint2 __attribute__((const, overloadable))
    891     convert_uint2(double2 v);
    892 #endif
    893 
    894 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    895 extern uint3 __attribute__((const, overloadable))
    896     convert_uint3(double3 v);
    897 #endif
    898 
    899 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    900 extern uint4 __attribute__((const, overloadable))
    901     convert_uint4(double4 v);
    902 #endif
    903 
    904 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    905 extern uint2 __attribute__((const, overloadable))
    906     convert_uint2(long2 v);
    907 #endif
    908 
    909 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    910 extern uint3 __attribute__((const, overloadable))
    911     convert_uint3(long3 v);
    912 #endif
    913 
    914 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    915 extern uint4 __attribute__((const, overloadable))
    916     convert_uint4(long4 v);
    917 #endif
    918 
    919 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    920 extern uint2 __attribute__((const, overloadable))
    921     convert_uint2(ulong2 v);
    922 #endif
    923 
    924 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    925 extern uint3 __attribute__((const, overloadable))
    926     convert_uint3(ulong3 v);
    927 #endif
    928 
    929 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    930 extern uint4 __attribute__((const, overloadable))
    931     convert_uint4(ulong4 v);
    932 #endif
    933 
    934 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    935 extern double2 __attribute__((const, overloadable))
    936     convert_double2(float2 v);
    937 #endif
    938 
    939 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    940 extern double3 __attribute__((const, overloadable))
    941     convert_double3(float3 v);
    942 #endif
    943 
    944 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    945 extern double4 __attribute__((const, overloadable))
    946     convert_double4(float4 v);
    947 #endif
    948 
    949 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    950 extern double2 __attribute__((const, overloadable))
    951     convert_double2(char2 v);
    952 #endif
    953 
    954 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    955 extern double3 __attribute__((const, overloadable))
    956     convert_double3(char3 v);
    957 #endif
    958 
    959 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    960 extern double4 __attribute__((const, overloadable))
    961     convert_double4(char4 v);
    962 #endif
    963 
    964 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    965 extern double2 __attribute__((const, overloadable))
    966     convert_double2(uchar2 v);
    967 #endif
    968 
    969 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    970 extern double3 __attribute__((const, overloadable))
    971     convert_double3(uchar3 v);
    972 #endif
    973 
    974 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    975 extern double4 __attribute__((const, overloadable))
    976     convert_double4(uchar4 v);
    977 #endif
    978 
    979 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    980 extern double2 __attribute__((const, overloadable))
    981     convert_double2(short2 v);
    982 #endif
    983 
    984 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    985 extern double3 __attribute__((const, overloadable))
    986     convert_double3(short3 v);
    987 #endif
    988 
    989 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    990 extern double4 __attribute__((const, overloadable))
    991     convert_double4(short4 v);
    992 #endif
    993 
    994 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
    995 extern double2 __attribute__((const, overloadable))
    996     convert_double2(ushort2 v);
    997 #endif
    998 
    999 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1000 extern double3 __attribute__((const, overloadable))
   1001     convert_double3(ushort3 v);
   1002 #endif
   1003 
   1004 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1005 extern double4 __attribute__((const, overloadable))
   1006     convert_double4(ushort4 v);
   1007 #endif
   1008 
   1009 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1010 extern double2 __attribute__((const, overloadable))
   1011     convert_double2(int2 v);
   1012 #endif
   1013 
   1014 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1015 extern double3 __attribute__((const, overloadable))
   1016     convert_double3(int3 v);
   1017 #endif
   1018 
   1019 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1020 extern double4 __attribute__((const, overloadable))
   1021     convert_double4(int4 v);
   1022 #endif
   1023 
   1024 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1025 extern double2 __attribute__((const, overloadable))
   1026     convert_double2(uint2 v);
   1027 #endif
   1028 
   1029 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1030 extern double3 __attribute__((const, overloadable))
   1031     convert_double3(uint3 v);
   1032 #endif
   1033 
   1034 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1035 extern double4 __attribute__((const, overloadable))
   1036     convert_double4(uint4 v);
   1037 #endif
   1038 
   1039 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1040 extern long2 __attribute__((const, overloadable))
   1041     convert_long2(float2 v);
   1042 #endif
   1043 
   1044 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1045 extern long3 __attribute__((const, overloadable))
   1046     convert_long3(float3 v);
   1047 #endif
   1048 
   1049 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1050 extern long4 __attribute__((const, overloadable))
   1051     convert_long4(float4 v);
   1052 #endif
   1053 
   1054 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1055 extern long2 __attribute__((const, overloadable))
   1056     convert_long2(char2 v);
   1057 #endif
   1058 
   1059 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1060 extern long3 __attribute__((const, overloadable))
   1061     convert_long3(char3 v);
   1062 #endif
   1063 
   1064 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1065 extern long4 __attribute__((const, overloadable))
   1066     convert_long4(char4 v);
   1067 #endif
   1068 
   1069 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1070 extern long2 __attribute__((const, overloadable))
   1071     convert_long2(uchar2 v);
   1072 #endif
   1073 
   1074 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1075 extern long3 __attribute__((const, overloadable))
   1076     convert_long3(uchar3 v);
   1077 #endif
   1078 
   1079 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1080 extern long4 __attribute__((const, overloadable))
   1081     convert_long4(uchar4 v);
   1082 #endif
   1083 
   1084 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1085 extern long2 __attribute__((const, overloadable))
   1086     convert_long2(short2 v);
   1087 #endif
   1088 
   1089 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1090 extern long3 __attribute__((const, overloadable))
   1091     convert_long3(short3 v);
   1092 #endif
   1093 
   1094 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1095 extern long4 __attribute__((const, overloadable))
   1096     convert_long4(short4 v);
   1097 #endif
   1098 
   1099 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1100 extern long2 __attribute__((const, overloadable))
   1101     convert_long2(ushort2 v);
   1102 #endif
   1103 
   1104 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1105 extern long3 __attribute__((const, overloadable))
   1106     convert_long3(ushort3 v);
   1107 #endif
   1108 
   1109 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1110 extern long4 __attribute__((const, overloadable))
   1111     convert_long4(ushort4 v);
   1112 #endif
   1113 
   1114 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1115 extern long2 __attribute__((const, overloadable))
   1116     convert_long2(int2 v);
   1117 #endif
   1118 
   1119 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1120 extern long3 __attribute__((const, overloadable))
   1121     convert_long3(int3 v);
   1122 #endif
   1123 
   1124 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1125 extern long4 __attribute__((const, overloadable))
   1126     convert_long4(int4 v);
   1127 #endif
   1128 
   1129 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1130 extern long2 __attribute__((const, overloadable))
   1131     convert_long2(uint2 v);
   1132 #endif
   1133 
   1134 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1135 extern long3 __attribute__((const, overloadable))
   1136     convert_long3(uint3 v);
   1137 #endif
   1138 
   1139 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1140 extern long4 __attribute__((const, overloadable))
   1141     convert_long4(uint4 v);
   1142 #endif
   1143 
   1144 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1145 extern ulong2 __attribute__((const, overloadable))
   1146     convert_ulong2(float2 v);
   1147 #endif
   1148 
   1149 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1150 extern ulong3 __attribute__((const, overloadable))
   1151     convert_ulong3(float3 v);
   1152 #endif
   1153 
   1154 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1155 extern ulong4 __attribute__((const, overloadable))
   1156     convert_ulong4(float4 v);
   1157 #endif
   1158 
   1159 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1160 extern ulong2 __attribute__((const, overloadable))
   1161     convert_ulong2(char2 v);
   1162 #endif
   1163 
   1164 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1165 extern ulong3 __attribute__((const, overloadable))
   1166     convert_ulong3(char3 v);
   1167 #endif
   1168 
   1169 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1170 extern ulong4 __attribute__((const, overloadable))
   1171     convert_ulong4(char4 v);
   1172 #endif
   1173 
   1174 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1175 extern ulong2 __attribute__((const, overloadable))
   1176     convert_ulong2(uchar2 v);
   1177 #endif
   1178 
   1179 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1180 extern ulong3 __attribute__((const, overloadable))
   1181     convert_ulong3(uchar3 v);
   1182 #endif
   1183 
   1184 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1185 extern ulong4 __attribute__((const, overloadable))
   1186     convert_ulong4(uchar4 v);
   1187 #endif
   1188 
   1189 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1190 extern ulong2 __attribute__((const, overloadable))
   1191     convert_ulong2(short2 v);
   1192 #endif
   1193 
   1194 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1195 extern ulong3 __attribute__((const, overloadable))
   1196     convert_ulong3(short3 v);
   1197 #endif
   1198 
   1199 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1200 extern ulong4 __attribute__((const, overloadable))
   1201     convert_ulong4(short4 v);
   1202 #endif
   1203 
   1204 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1205 extern ulong2 __attribute__((const, overloadable))
   1206     convert_ulong2(ushort2 v);
   1207 #endif
   1208 
   1209 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1210 extern ulong3 __attribute__((const, overloadable))
   1211     convert_ulong3(ushort3 v);
   1212 #endif
   1213 
   1214 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1215 extern ulong4 __attribute__((const, overloadable))
   1216     convert_ulong4(ushort4 v);
   1217 #endif
   1218 
   1219 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1220 extern ulong2 __attribute__((const, overloadable))
   1221     convert_ulong2(int2 v);
   1222 #endif
   1223 
   1224 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1225 extern ulong3 __attribute__((const, overloadable))
   1226     convert_ulong3(int3 v);
   1227 #endif
   1228 
   1229 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1230 extern ulong4 __attribute__((const, overloadable))
   1231     convert_ulong4(int4 v);
   1232 #endif
   1233 
   1234 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1235 extern ulong2 __attribute__((const, overloadable))
   1236     convert_ulong2(uint2 v);
   1237 #endif
   1238 
   1239 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1240 extern ulong3 __attribute__((const, overloadable))
   1241     convert_ulong3(uint3 v);
   1242 #endif
   1243 
   1244 #if (defined(RS_VERSION) && (RS_VERSION >= 21))
   1245 extern ulong4 __attribute__((const, overloadable))
   1246     convert_ulong4(uint4 v);
   1247 #endif
   1248 
   1249 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1250 extern half2 __attribute__((const, overloadable))
   1251     convert_half2(half2 v);
   1252 #endif
   1253 
   1254 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1255 extern half3 __attribute__((const, overloadable))
   1256     convert_half3(half3 v);
   1257 #endif
   1258 
   1259 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1260 extern half4 __attribute__((const, overloadable))
   1261     convert_half4(half4 v);
   1262 #endif
   1263 
   1264 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1265 extern float2 __attribute__((const, overloadable))
   1266     convert_float2(half2 v);
   1267 #endif
   1268 
   1269 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1270 extern float3 __attribute__((const, overloadable))
   1271     convert_float3(half3 v);
   1272 #endif
   1273 
   1274 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1275 extern float4 __attribute__((const, overloadable))
   1276     convert_float4(half4 v);
   1277 #endif
   1278 
   1279 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1280 extern double2 __attribute__((const, overloadable))
   1281     convert_double2(half2 v);
   1282 #endif
   1283 
   1284 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1285 extern double3 __attribute__((const, overloadable))
   1286     convert_double3(half3 v);
   1287 #endif
   1288 
   1289 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1290 extern double4 __attribute__((const, overloadable))
   1291     convert_double4(half4 v);
   1292 #endif
   1293 
   1294 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1295 extern char2 __attribute__((const, overloadable))
   1296     convert_char2(half2 v);
   1297 #endif
   1298 
   1299 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1300 extern char3 __attribute__((const, overloadable))
   1301     convert_char3(half3 v);
   1302 #endif
   1303 
   1304 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1305 extern char4 __attribute__((const, overloadable))
   1306     convert_char4(half4 v);
   1307 #endif
   1308 
   1309 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1310 extern uchar2 __attribute__((const, overloadable))
   1311     convert_uchar2(half2 v);
   1312 #endif
   1313 
   1314 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1315 extern uchar3 __attribute__((const, overloadable))
   1316     convert_uchar3(half3 v);
   1317 #endif
   1318 
   1319 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1320 extern uchar4 __attribute__((const, overloadable))
   1321     convert_uchar4(half4 v);
   1322 #endif
   1323 
   1324 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1325 extern short2 __attribute__((const, overloadable))
   1326     convert_short2(half2 v);
   1327 #endif
   1328 
   1329 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1330 extern short3 __attribute__((const, overloadable))
   1331     convert_short3(half3 v);
   1332 #endif
   1333 
   1334 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1335 extern short4 __attribute__((const, overloadable))
   1336     convert_short4(half4 v);
   1337 #endif
   1338 
   1339 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1340 extern ushort2 __attribute__((const, overloadable))
   1341     convert_ushort2(half2 v);
   1342 #endif
   1343 
   1344 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1345 extern ushort3 __attribute__((const, overloadable))
   1346     convert_ushort3(half3 v);
   1347 #endif
   1348 
   1349 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1350 extern ushort4 __attribute__((const, overloadable))
   1351     convert_ushort4(half4 v);
   1352 #endif
   1353 
   1354 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1355 extern int2 __attribute__((const, overloadable))
   1356     convert_int2(half2 v);
   1357 #endif
   1358 
   1359 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1360 extern int3 __attribute__((const, overloadable))
   1361     convert_int3(half3 v);
   1362 #endif
   1363 
   1364 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1365 extern int4 __attribute__((const, overloadable))
   1366     convert_int4(half4 v);
   1367 #endif
   1368 
   1369 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1370 extern uint2 __attribute__((const, overloadable))
   1371     convert_uint2(half2 v);
   1372 #endif
   1373 
   1374 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1375 extern uint3 __attribute__((const, overloadable))
   1376     convert_uint3(half3 v);
   1377 #endif
   1378 
   1379 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1380 extern uint4 __attribute__((const, overloadable))
   1381     convert_uint4(half4 v);
   1382 #endif
   1383 
   1384 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1385 extern long2 __attribute__((const, overloadable))
   1386     convert_long2(half2 v);
   1387 #endif
   1388 
   1389 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1390 extern long3 __attribute__((const, overloadable))
   1391     convert_long3(half3 v);
   1392 #endif
   1393 
   1394 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1395 extern long4 __attribute__((const, overloadable))
   1396     convert_long4(half4 v);
   1397 #endif
   1398 
   1399 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1400 extern ulong2 __attribute__((const, overloadable))
   1401     convert_ulong2(half2 v);
   1402 #endif
   1403 
   1404 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1405 extern ulong3 __attribute__((const, overloadable))
   1406     convert_ulong3(half3 v);
   1407 #endif
   1408 
   1409 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1410 extern ulong4 __attribute__((const, overloadable))
   1411     convert_ulong4(half4 v);
   1412 #endif
   1413 
   1414 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1415 extern half2 __attribute__((const, overloadable))
   1416     convert_half2(float2 v);
   1417 #endif
   1418 
   1419 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1420 extern half3 __attribute__((const, overloadable))
   1421     convert_half3(float3 v);
   1422 #endif
   1423 
   1424 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1425 extern half4 __attribute__((const, overloadable))
   1426     convert_half4(float4 v);
   1427 #endif
   1428 
   1429 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1430 extern half2 __attribute__((const, overloadable))
   1431     convert_half2(double2 v);
   1432 #endif
   1433 
   1434 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1435 extern half3 __attribute__((const, overloadable))
   1436     convert_half3(double3 v);
   1437 #endif
   1438 
   1439 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1440 extern half4 __attribute__((const, overloadable))
   1441     convert_half4(double4 v);
   1442 #endif
   1443 
   1444 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1445 extern half2 __attribute__((const, overloadable))
   1446     convert_half2(char2 v);
   1447 #endif
   1448 
   1449 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1450 extern half3 __attribute__((const, overloadable))
   1451     convert_half3(char3 v);
   1452 #endif
   1453 
   1454 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1455 extern half4 __attribute__((const, overloadable))
   1456     convert_half4(char4 v);
   1457 #endif
   1458 
   1459 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1460 extern half2 __attribute__((const, overloadable))
   1461     convert_half2(uchar2 v);
   1462 #endif
   1463 
   1464 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1465 extern half3 __attribute__((const, overloadable))
   1466     convert_half3(uchar3 v);
   1467 #endif
   1468 
   1469 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1470 extern half4 __attribute__((const, overloadable))
   1471     convert_half4(uchar4 v);
   1472 #endif
   1473 
   1474 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1475 extern half2 __attribute__((const, overloadable))
   1476     convert_half2(short2 v);
   1477 #endif
   1478 
   1479 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1480 extern half3 __attribute__((const, overloadable))
   1481     convert_half3(short3 v);
   1482 #endif
   1483 
   1484 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1485 extern half4 __attribute__((const, overloadable))
   1486     convert_half4(short4 v);
   1487 #endif
   1488 
   1489 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1490 extern half2 __attribute__((const, overloadable))
   1491     convert_half2(ushort2 v);
   1492 #endif
   1493 
   1494 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1495 extern half3 __attribute__((const, overloadable))
   1496     convert_half3(ushort3 v);
   1497 #endif
   1498 
   1499 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1500 extern half4 __attribute__((const, overloadable))
   1501     convert_half4(ushort4 v);
   1502 #endif
   1503 
   1504 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1505 extern half2 __attribute__((const, overloadable))
   1506     convert_half2(int2 v);
   1507 #endif
   1508 
   1509 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1510 extern half3 __attribute__((const, overloadable))
   1511     convert_half3(int3 v);
   1512 #endif
   1513 
   1514 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1515 extern half4 __attribute__((const, overloadable))
   1516     convert_half4(int4 v);
   1517 #endif
   1518 
   1519 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1520 extern half2 __attribute__((const, overloadable))
   1521     convert_half2(uint2 v);
   1522 #endif
   1523 
   1524 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1525 extern half3 __attribute__((const, overloadable))
   1526     convert_half3(uint3 v);
   1527 #endif
   1528 
   1529 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1530 extern half4 __attribute__((const, overloadable))
   1531     convert_half4(uint4 v);
   1532 #endif
   1533 
   1534 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1535 extern half2 __attribute__((const, overloadable))
   1536     convert_half2(long2 v);
   1537 #endif
   1538 
   1539 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1540 extern half3 __attribute__((const, overloadable))
   1541     convert_half3(long3 v);
   1542 #endif
   1543 
   1544 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1545 extern half4 __attribute__((const, overloadable))
   1546     convert_half4(long4 v);
   1547 #endif
   1548 
   1549 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1550 extern half2 __attribute__((const, overloadable))
   1551     convert_half2(ulong2 v);
   1552 #endif
   1553 
   1554 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1555 extern half3 __attribute__((const, overloadable))
   1556     convert_half3(ulong3 v);
   1557 #endif
   1558 
   1559 #if (defined(RS_VERSION) && (RS_VERSION >= 24))
   1560 extern half4 __attribute__((const, overloadable))
   1561     convert_half4(ulong4 v);
   1562 #endif
   1563 
   1564 /*
   1565  * rsPackColorTo8888: Create a uchar4 RGBA from floats
   1566  *
   1567  * Packs three or four floating point RGBA values into a uchar4.
   1568  *
   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.
   1574  *
   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.
   1577  *
   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);
   1587 
   1588 extern uchar4 __attribute__((const, overloadable))
   1589     rsPackColorTo8888(float r, float g, float b, float a);
   1590 
   1591 extern uchar4 __attribute__((const, overloadable))
   1592     rsPackColorTo8888(float3 color);
   1593 
   1594 extern uchar4 __attribute__((const, overloadable))
   1595     rsPackColorTo8888(float4 color);
   1596 
   1597 /*
   1598  * rsUnpackColor8888: Create a float4 RGBA from uchar4
   1599  *
   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);
   1604 
   1605 /*
   1606  * rsYuvToRGBA: Convert a YUV value to RGBA
   1607  *
   1608  * Converts a color from a YUV representation to RGBA.
   1609  *
   1610  * We currently don't provide a function to do the reverse conversion.
   1611  *
   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);
   1619 
   1620 extern uchar4 __attribute__((const, overloadable))
   1621     rsYuvToRGBA_uchar4(uchar y, uchar u, uchar v);
   1622 
   1623 #endif // RENDERSCRIPT_RS_CONVERT_RSH
   1624