Jean-Luc Brouillet | be21638 | 2015-03-22 12:44:27 -0700 | [diff] [blame^] | 1 | # |
| 2 | # Copyright (C) 2014 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 | header: |
| 18 | summary: Conversion functions |
| 19 | description: |
| 20 | TODO Add desc. |
| 21 | end: |
| 22 | |
| 23 | function: convert_#3#1 |
| 24 | version: 9 |
| 25 | attrib: const |
| 26 | w: 2, 3, 4 |
| 27 | t: u8, u16, u32, i8, i16, i32, f32 |
| 28 | t: u8, u16, u32, i8, i16, i32, f32 |
| 29 | ret: #3#1 |
| 30 | arg: #2#1 v, compatible(#3) |
| 31 | summary: Converts numerical vectors |
| 32 | description: |
| 33 | Component wise conversion from a numerical type to another. |
| 34 | |
| 35 | Conversions of floating point values to integer will truncate. |
| 36 | |
| 37 | Conversions of numbers too large to fit the destination type yield undefined results. |
| 38 | For example, converting a float that contains 1.0e18 to a short is undefined. |
| 39 | Use @clamp() to avoid this. |
| 40 | end: |
| 41 | |
| 42 | function: convert_#3#1 |
| 43 | version: 21 |
| 44 | attrib: const |
| 45 | w: 2, 3, 4 |
| 46 | t: u64, i64, f64 |
| 47 | t: u64, i64, f64 |
| 48 | ret: #3#1 |
| 49 | arg: #2#1 v, compatible(#3) |
| 50 | end: |
| 51 | |
| 52 | function: convert_#3#1 |
| 53 | version: 21 |
| 54 | attrib: const |
| 55 | w: 2, 3, 4 |
| 56 | t: u64, i64, f64 |
| 57 | t: u8, u16, u32, i8, i16, i32, f32 |
| 58 | ret: #3#1 |
| 59 | arg: #2#1 v, compatible(#3) |
| 60 | end: |
| 61 | |
| 62 | function: convert_#3#1 |
| 63 | version: 21 |
| 64 | attrib: const |
| 65 | w: 2, 3, 4 |
| 66 | t: u8, u16, u32, i8, i16, i32, f32 |
| 67 | t: u64, i64, f64 |
| 68 | ret: #3#1 |
| 69 | arg: #2#1 v, compatible(#3) |
| 70 | end: |
| 71 | |
| 72 | function: rsPackColorTo8888 |
| 73 | attrib: const |
| 74 | ret: uchar4 |
| 75 | arg: float r |
| 76 | arg: float g |
| 77 | arg: float b |
| 78 | summary: |
| 79 | description: |
| 80 | Pack floating point (0-1) RGB values into a uchar4. |
| 81 | |
| 82 | For the float3 variant and the variant that only specifies r, g, b, |
| 83 | the alpha component is set to 255 (1.0). |
| 84 | test: none |
| 85 | end: |
| 86 | |
| 87 | function: rsPackColorTo8888 |
| 88 | attrib: const |
| 89 | ret: uchar4 |
| 90 | arg: float r |
| 91 | arg: float g |
| 92 | arg: float b |
| 93 | arg: float a |
| 94 | test: none |
| 95 | end: |
| 96 | |
| 97 | function: rsPackColorTo8888 |
| 98 | attrib: const |
| 99 | ret: uchar4 |
| 100 | arg: float3 color |
| 101 | test: none |
| 102 | end: |
| 103 | |
| 104 | function: rsPackColorTo8888 |
| 105 | attrib: const |
| 106 | ret: uchar4 |
| 107 | arg: float4 color |
| 108 | test: none |
| 109 | end: |
| 110 | |
| 111 | function: rsUnpackColor8888 |
| 112 | attrib: =const |
| 113 | ret: float4 |
| 114 | arg: uchar4 c |
| 115 | summary: |
| 116 | description: |
| 117 | Unpack a uchar4 color to float4. The resulting float range will be (0-1). |
| 118 | test: none |
| 119 | end: |
| 120 | |
| 121 | function: rsYuvToRGBA_#2#1 |
| 122 | attrib: const |
| 123 | w: 4 |
| 124 | t: u8, f32 |
| 125 | ret: #2#1 |
| 126 | arg: uchar y |
| 127 | arg: uchar u |
| 128 | arg: uchar v |
| 129 | summary: |
| 130 | description: |
| 131 | Convert from YUV to RGBA. |
| 132 | test: none |
| 133 | end: |