OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2006-2009 NVIDIA Corporation. |
| 3 * All rights reserved. |
| 4 * |
| 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: |
| 7 * |
| 8 * Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. |
| 10 * |
| 11 * Redistributions in binary form must reproduce the above copyright notice, |
| 12 * this list of conditions and the following disclaimer in the documentation |
| 13 * and/or other materials provided with the distribution. |
| 14 * |
| 15 * Neither the name of the NVIDIA Corporation nor the names of its contributors |
| 16 * may be used to endorse or promote products derived from this software |
| 17 * without specific prior written permission. |
| 18 * |
| 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 * POSSIBILITY OF SUCH DAMAGE. |
| 30 * |
| 31 */ |
| 32 |
| 33 #ifndef INCLUDED_NVCOLOR_H |
| 34 #define INCLUDED_NVCOLOR_H |
| 35 |
| 36 /* |
| 37 * We provide a very generic, orthogonal way to specify color formats. There |
| 38 * are four steps in specifying a color format: |
| 39 * 1. What is the data type of the color components? |
| 40 * 2. How are the color components packed into words of memory? |
| 41 * 3. How are those color components swizzled into an (x,y,z,w) color vector? |
| 42 * 4. How is that vector interpreted as a color? |
| 43 * |
| 44 * These correspond to NvColorDataType, NvColorComponentPacking, |
| 45 * NV_COLOR_SWIZZLE_*, and NvColorSpace, respectively. |
| 46 * |
| 47 * First, you need to understand NVIDIA's standard way of describing color |
| 48 * units (used in several business units within NVIDIA). Within a word, color |
| 49 * components are ordered from most-significant bit to least-significant bit. |
| 50 * Words are separated by underscores. For example: |
| 51 * |
| 52 * A8R8B8G8 = a single 32-bit word containing 8 bits alpha, 8 bits red, 8 bits |
| 53 * green, 8 bits blue. |
| 54 * |
| 55 * In little endian: Byte 3 || 2 || 1 || 0 |
| 56 * Bits 31 0 |
| 57 * AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB |
| 58 * |
| 59 * In big endian: Byte 0 || 1 || 2 || 3 |
| 60 * Bits 31 0 |
| 61 * AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB |
| 62 * |
| 63 * R8_G8_B8_A8 = four consecutive 8-bit words, consisting the red, green, blue, |
| 64 * and alpha components (in that order). |
| 65 * |
| 66 * In little endian: Byte 0 || 1 || 2 || 3 |
| 67 * Bits 76543210765432107654321076543210 |
| 68 * RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA |
| 69 * |
| 70 * In big endian: Byte 0 || 1 || 2 || 3 |
| 71 * Bits 76543210765432107654321076543210 |
| 72 * RRRRRRRRGGGGGGGGBBBBBBBBAAAAAAAA |
| 73 * |
| 74 * R5G6B5 = a single 16-bit word containing 5 bits red, 6 bits green, 5 bits |
| 75 * blue. |
| 76 * |
| 77 * In little endian: Byte 1 || 0 |
| 78 * Bits 15 0 |
| 79 * RRRRRGGGGGGBBBBB |
| 80 * |
| 81 * In big endian: Byte 0 || 1 |
| 82 * Bits 15 0 |
| 83 * RRRRRGGGGGGBBBBB |
| 84 * |
| 85 * In cases where a word is less than 8 bits (e.g. an A1 1-bit alpha mask |
| 86 * bitmap), pixels are ordered from LSB to MSB within a word. That is, the LSB |
| 87 * of the byte is the pixel at x%8 == 0, while the MSB of the byte is the pixel |
| 88 * at x%8 == 7. |
| 89 * |
| 90 * Also, note equivalences such as the following. |
| 91 * |
| 92 * In little endian: R8_G8_B8_A8 = A8B8G8R8. |
| 93 * In big endian: R8_G8_B8_A8 = R8G8B8A8. |
| 94 * |
| 95 * Some YUV "422" formats have different formats for pixels whose X is even vs. |
| 96 * those whose X is odd. Every pixel contains a Y component, while (for |
| 97 * example) only even pixels might contain a U component and only odd pixels |
| 98 * might contain a V component. Such formats use a double-underscore to |
| 99 * separate the even pixels from the odd pixels. For example, the format just |
| 100 * described might be referred to as Y8_U8__Y8_V8. |
| 101 * |
| 102 * Here is how we would we go about mapping a color format (say, R5G6B5) to the |
| 103 * NvColorFormat enums. |
| 104 * |
| 105 * 1. Remove the color information and rename the component R,G,B to generic |
| 106 * names X,Y,Z. Our NvColorComponentPacking is therefore X5Y6Z5. |
| 107 * |
| 108 * 2. Pick the appropriate color space. This is plain old RGBA, so we pick |
| 109 * NvColorSpace_LinearRGBA. |
| 110 * |
| 111 * 3. Determine what swizzle to use. We need R=X, G=Y, B=Z, and A=1, so we |
| 112 * pick the "XYZ1" swizzle. |
| 113 * |
| 114 * 4. Pick the data type of the color components. This is just plain integers, |
| 115 * so NvColorDataType_Integer is our choice. |
| 116 */ |
| 117 |
| 118 /** |
| 119 * We provide a flexible way to map the input vector (x,y,z,w) to an output |
| 120 * vector (x',y',z',w'). Each output component can select any of the input |
| 121 * components or the constants zero or one. For example, the swizzle "XXX1" |
| 122 * can be used to create a luminance pixel from the input x component, while |
| 123 * the swizzle "ZYXW" swaps the X and Z components (converts between RGBA and |
| 124 * BGRA). |
| 125 */ |
| 126 #define NV_COLOR_SWIZZLE_X 0 |
| 127 #define NV_COLOR_SWIZZLE_Y 1 |
| 128 #define NV_COLOR_SWIZZLE_Z 2 |
| 129 #define NV_COLOR_SWIZZLE_W 3 |
| 130 #define NV_COLOR_SWIZZLE_0 4 |
| 131 #define NV_COLOR_SWIZZLE_1 5 |
| 132 |
| 133 #define NV_COLOR_MAKE_SWIZZLE(x,y,z,w) \ |
| 134 ((NV_COLOR_SWIZZLE_##x) | ((NV_COLOR_SWIZZLE_##y) << 3) | \ |
| 135 ((NV_COLOR_SWIZZLE_##z) << 6) | ((NV_COLOR_SWIZZLE_##w) << 9)) |
| 136 |
| 137 #define NV_COLOR_SWIZZLE_GET_X(swz) (((swz) ) & 7) |
| 138 #define NV_COLOR_SWIZZLE_GET_Y(swz) (((swz) >> 3) & 7) |
| 139 #define NV_COLOR_SWIZZLE_GET_Z(swz) (((swz) >> 6) & 7) |
| 140 #define NV_COLOR_SWIZZLE_GET_W(swz) (((swz) >> 9) & 7) |
| 141 |
| 142 #define NV_COLOR_SWIZZLE_XYZW NV_COLOR_MAKE_SWIZZLE(X,Y,Z,W) |
| 143 #define NV_COLOR_SWIZZLE_ZYXW NV_COLOR_MAKE_SWIZZLE(Z,Y,X,W) |
| 144 #define NV_COLOR_SWIZZLE_WZYX NV_COLOR_MAKE_SWIZZLE(W,Z,Y,X) |
| 145 #define NV_COLOR_SWIZZLE_YZWX NV_COLOR_MAKE_SWIZZLE(Y,Z,W,X) |
| 146 #define NV_COLOR_SWIZZLE_XYZ1 NV_COLOR_MAKE_SWIZZLE(X,Y,Z,1) |
| 147 #define NV_COLOR_SWIZZLE_YZW1 NV_COLOR_MAKE_SWIZZLE(Y,Z,W,1) |
| 148 #define NV_COLOR_SWIZZLE_XXX1 NV_COLOR_MAKE_SWIZZLE(X,X,X,1) |
| 149 #define NV_COLOR_SWIZZLE_XZY1 NV_COLOR_MAKE_SWIZZLE(X,Z,Y,1) |
| 150 #define NV_COLOR_SWIZZLE_ZYX1 NV_COLOR_MAKE_SWIZZLE(Z,Y,X,1) |
| 151 #define NV_COLOR_SWIZZLE_WZY1 NV_COLOR_MAKE_SWIZZLE(W,Z,Y,1) |
| 152 #define NV_COLOR_SWIZZLE_X000 NV_COLOR_MAKE_SWIZZLE(X,0,0,0) |
| 153 #define NV_COLOR_SWIZZLE_0X00 NV_COLOR_MAKE_SWIZZLE(0,X,0,0) |
| 154 #define NV_COLOR_SWIZZLE_00X0 NV_COLOR_MAKE_SWIZZLE(0,0,X,0) |
| 155 #define NV_COLOR_SWIZZLE_000X NV_COLOR_MAKE_SWIZZLE(0,0,0,X) |
| 156 #define NV_COLOR_SWIZZLE_0XY0 NV_COLOR_MAKE_SWIZZLE(0,X,Y,0) |
| 157 #define NV_COLOR_SWIZZLE_XXXY NV_COLOR_MAKE_SWIZZLE(X,X,X,Y) |
| 158 #define NV_COLOR_SWIZZLE_YYYX NV_COLOR_MAKE_SWIZZLE(Y,Y,Y,X) |
| 159 |
| 160 /** |
| 161 * This macro extracts the number of bits per pixel out of an NvColorFormat or |
| 162 * NvColorComponentPacking. |
| 163 */ |
| 164 #define NV_COLOR_GET_BPP(fmt) (((NvU32)(fmt)) >> 24) |
| 165 |
| 166 /** |
| 167 * This macro encodes the number of bits per pixel into an |
| 168 * NvColorComponentPacking enum. |
| 169 */ |
| 170 #define NV_COLOR_SET_BPP(bpp) ((bpp) << 24) |
| 171 |
| 172 /** |
| 173 * NvColorComponentPacking enumerates the possible ways to pack color |
| 174 * components into words in memory. |
| 175 */ |
| 176 typedef enum |
| 177 { |
| 178 NvColorComponentPacking_X1 = 0x01 | NV_COLOR_SET_BPP(1), |
| 179 NvColorComponentPacking_X2 = 0x02 | NV_COLOR_SET_BPP(2), |
| 180 NvColorComponentPacking_X4 = 0x03 | NV_COLOR_SET_BPP(4), |
| 181 NvColorComponentPacking_X8 = 0x04 | NV_COLOR_SET_BPP(8), |
| 182 NvColorComponentPacking_X3Y3Z2 = 0x05 | NV_COLOR_SET_BPP(8), |
| 183 NvColorComponentPacking_Y4X4 = 0x06 | NV_COLOR_SET_BPP(8), |
| 184 NvColorComponentPacking_X16 = 0x07 | NV_COLOR_SET_BPP(16), |
| 185 NvColorComponentPacking_X4Y4Z4W4 = 0x08 | NV_COLOR_SET_BPP(16), |
| 186 NvColorComponentPacking_X1Y5Z5W5 = 0x09 | NV_COLOR_SET_BPP(16), |
| 187 NvColorComponentPacking_X5Y6Z5 = 0x0A | NV_COLOR_SET_BPP(16), |
| 188 NvColorComponentPacking_X8_Y8 = 0x0B | NV_COLOR_SET_BPP(16), |
| 189 NvColorComponentPacking_X8_Y8__X8_Z8 = 0x0C | NV_COLOR_SET_BPP(16), |
| 190 NvColorComponentPacking_Y8_X8__Z8_X8 = 0x0D | NV_COLOR_SET_BPP(16), |
| 191 NvColorComponentPacking_Y6X10 = 0x0E | NV_COLOR_SET_BPP(16), |
| 192 NvColorComponentPacking_Y4X12 = 0x0F | NV_COLOR_SET_BPP(16), |
| 193 NvColorComponentPacking_Y2X14 = 0x10 | NV_COLOR_SET_BPP(16), |
| 194 NvColorComponentPacking_X5Y5Z5W1 = 0x11 | NV_COLOR_SET_BPP(16), |
| 195 NvColorComponentPacking_X8_Y8_Z8 = 0x12 | NV_COLOR_SET_BPP(24), |
| 196 NvColorComponentPacking_X32 = 0x13 | NV_COLOR_SET_BPP(32), |
| 197 NvColorComponentPacking_X8Y8Z8W8 = 0x14 | NV_COLOR_SET_BPP(32), |
| 198 NvColorComponentPacking_X11Y11Z10 = 0x15 | NV_COLOR_SET_BPP(32), |
| 199 NvColorComponentPacking_X16Y16 = 0x16 | NV_COLOR_SET_BPP(32), |
| 200 NvColorComponentPacking_X16_Y16 = 0x17 | NV_COLOR_SET_BPP(32), |
| 201 NvColorComponentPacking_X16_Y16_Z16 = 0x18 | NV_COLOR_SET_BPP(48), |
| 202 NvColorComponentPacking_X16_Y16_Z16_W16 = 0x19 | NV_COLOR_SET_BPP(64), |
| 203 NvColorComponentPacking_X16Y16Z16W16 = 0x20 | NV_COLOR_SET_BPP(64), |
| 204 NvColorComponentPacking_X32_Y32 = 0x21 | NV_COLOR_SET_BPP(64), |
| 205 NvColorComponentPacking_X32_Y32_Z32 = 0x22 | NV_COLOR_SET_BPP(96), |
| 206 NvColorComponentPacking_X32_Y32_Z32_W32 = 0x23 | NV_COLOR_SET_BPP(128), |
| 207 NvColorComponentPacking_X32Y32Z32W32 = 0x24 | NV_COLOR_SET_BPP(128), |
| 208 |
| 209 NvColorComponentPacking_Force32 = 0x7FFFFFFF |
| 210 } NvColorComponentPacking; |
| 211 |
| 212 /** |
| 213 * NvColorDataType defines the data type of color components. |
| 214 * |
| 215 * The default datatype of color components is 'Integer' which should be used |
| 216 * when the color value is to be intepreted as an integer value ranging from 0 |
| 217 * to the maximum value representable by the width of the components (as |
| 218 * specified by the packing of the component). Use 'Integer' also when the |
| 219 * interpretation of color value bits is not known, does not matter or is |
| 220 * context dependent. |
| 221 * |
| 222 * A data type of 'Float' indicates that float values are stored in the |
| 223 * components of the color. The combination of data type 'Float' and the |
| 224 * bit width of the component packing defines the final data format of the |
| 225 * individual component. |
| 226 * |
| 227 * The list below defines the accepted combinations, when adding new |
| 228 * float formats please add an entry into this list. |
| 229 * |
| 230 * - DataType = Float, Component bit width = 32: |
| 231 * A IEEE 754 single precision float (binary32) with 1 sign bit, |
| 232 * 8 exponent bits and 23 mantissa bits. |
| 233 * |
| 234 * - DataType = Float, Component bit width = 16: |
| 235 * A IEEE 754 half precision float (binary16) with 1 sign bit, |
| 236 * 5 exponent bits and 10 mantissa bits. |
| 237 * |
| 238 * - DataType = Float, Component bit width = 10: |
| 239 * An unsigned nvfloat with 5 exponent bits and 5 mantissa bits. |
| 240 * |
| 241 * - DataType = Float, Component bit width = 11: |
| 242 * An unsigned nvfloat with 5 exponent bits and 6 mantissa bits. |
| 243 * |
| 244 */ |
| 245 typedef enum |
| 246 { |
| 247 NvColorDataType_Integer = 0x0, |
| 248 NvColorDataType_Float = 0x1, |
| 249 |
| 250 NvColorDataType_Force32 = 0x7FFFFFFF |
| 251 } NvColorDataType; |
| 252 |
| 253 /** |
| 254 * NvColorSpace defines a number of ways of interpreting an (x,y,z,w) tuple as |
| 255 * a color. The most common and basic is linear RGBA, which simply maps X->R, |
| 256 * Y->G, Z->B, and W->A, but various other color spaces also exist. |
| 257 * |
| 258 * Some future candidates for expansion are premultiplied alpha formats and |
| 259 * Z/stencil formats. They have been omitted for now until there is a need. |
| 260 */ |
| 261 typedef enum |
| 262 { |
| 263 /** Linear RGBA color space. */ |
| 264 NvColorSpace_LinearRGBA = 1, |
| 265 |
| 266 /** sRGB color space with linear alpha. */ |
| 267 NvColorSpace_sRGB, |
| 268 |
| 269 /** Paletted/color index color space. (data is meaningless w/o the palette) |
| 270 */ |
| 271 NvColorSpace_ColorIndex, |
| 272 |
| 273 /** YCbCr ITU-R BT.601 color space. */ |
| 274 NvColorSpace_YCbCr601, |
| 275 |
| 276 /** YCbCr ITU-R BT.601 color space with range reduced YCbCr for VC1 decoded |
| 277 * surfaces. If picture layer of VC1 bit stream has RANGEREDFRM bit set, |
| 278 * decoded YUV data has to be scaled up (range expanded). |
| 279 * For this type of surface, clients should range expand Y,Cb,Cr as follows: |
| 280 * Y = clip( (( Y-128)*2) + 128 ); |
| 281 * Cb = clip( ((Cb-128)*2) + 128 ); |
| 282 * Cr = clip( ((Cr-128)*2) + 128 ); |
| 283 */ |
| 284 NvColorSpace_YCbCr601_RR, |
| 285 |
| 286 /** YCbCr ITU-R BT.709 color space. */ |
| 287 NvColorSpace_YCbCr709, |
| 288 |
| 289 /** |
| 290 * Bayer format with the X component mapped to samples as follows. |
| 291 * span 1: R G R G R G R G |
| 292 * span 2: G B G B G B G B |
| 293 * (Y,Z,W are discarded.) |
| 294 */ |
| 295 NvColorSpace_BayerRGGB, |
| 296 |
| 297 /** |
| 298 * Bayer format with the X component mapped to samples as follows. |
| 299 * span 1: B G B G B G B G |
| 300 * span 2: G R G R G R G R |
| 301 * (Y,Z,W are discarded.) |
| 302 */ |
| 303 NvColorSpace_BayerBGGR, |
| 304 |
| 305 /** |
| 306 * Bayer format with the X component mapped to samples as follows. |
| 307 * span 1: G R G R G R G R |
| 308 * span 2: B G B G B G B G |
| 309 * (Y,Z,W are discarded.) |
| 310 */ |
| 311 NvColorSpace_BayerGRBG, |
| 312 |
| 313 /** |
| 314 * Bayer format with the X component mapped to samples as follows. |
| 315 * span 1: G B G B G B G B |
| 316 * span 2: R G R G R G R G |
| 317 * (Y,Z,W are discarded.) |
| 318 */ |
| 319 NvColorSpace_BayerGBRG, |
| 320 |
| 321 /** |
| 322 * Noncolor data (for example depth, stencil, coverage). |
| 323 */ |
| 324 NvColorSpace_NonColor, |
| 325 |
| 326 NvColorSpace_Force32 = 0x7FFFFFFF |
| 327 } NvColorSpace; |
| 328 |
| 329 /** |
| 330 * NV_COLOR_MAKE_FORMAT_XXX macros build NvColor values out of the |
| 331 * constituent parts. |
| 332 * |
| 333 * NV_COLOR_MAKE_FORMAT_GENERIC is the generic form that accepts |
| 334 * the NvColorDataType of the format as the fourth parameter. |
| 335 * |
| 336 * NV_COLOR_MAKE_FORMAT is used to build DataType = Integer formats. |
| 337 * This special case macro exists because integer formats are the |
| 338 * overwhelming majority and for retaining backwards compatibility with |
| 339 * code written before addition of NvColor data types. |
| 340 */ |
| 341 |
| 342 #define NV_COLOR_MAKE_FORMAT_GENERIC(ColorSpace, Swizzle, ComponentPacking, Data
Type) \ |
| 343 (((NvColorSpace_##ColorSpace) << 20) | \ |
| 344 ((NV_COLOR_SWIZZLE_##Swizzle) << 8) | \ |
| 345 ((NvColorDataType_##DataType) << 6) | \ |
| 346 (NvColorComponentPacking_##ComponentPacking)) |
| 347 |
| 348 #define NV_COLOR_MAKE_FORMAT(ColorSpace, Swizzle, ComponentPacking) \ |
| 349 NV_COLOR_MAKE_FORMAT_GENERIC(ColorSpace, Swizzle, ComponentPacking, Integer) |
| 350 |
| 351 #define NV_COLOR_GET_COLOR_SPACE(fmt) ((NvU32)(((fmt) >> 20) & 0xF)) |
| 352 #define NV_COLOR_GET_SWIZZLE(fmt) ((NvU32)(((fmt) >> 8) & 0xFFF)) |
| 353 #define NV_COLOR_GET_COMPONENT_PACKING(fmt) ((NvU32)((fmt) & 0xFF00003F)) |
| 354 #define NV_COLOR_GET_DATA_TYPE(fmt) ((NvU32)(((fmt) >> 6) & 0x3)) |
| 355 |
| 356 /** |
| 357 * Each value of NvColorFormat represents a way of laying out pixels in memory. |
| 358 * Some of the most common color formats are listed here, but other formats can |
| 359 * be constructed freely using NV_COLOR_MAKE_FORMAT, so you should generally |
| 360 * use NV_COLOR_GET_* to extract out the constituent parts of the color format |
| 361 * if if you want to provide fully general color format support. (There is no |
| 362 * requirement, of course, that any particular API must support all conceivable |
| 363 * color formats.) |
| 364 */ |
| 365 typedef enum |
| 366 { |
| 367 /** |
| 368 * In some cases we don't know or don't care about the color format of a |
| 369 * block of data. This value can be used as a placeholder. It is |
| 370 * guaranteed that this value (zero) will never collide with any real color |
| 371 * format, based on the way that we construct color format enums. |
| 372 */ |
| 373 NvColorFormat_Unspecified = 0, |
| 374 |
| 375 // RGBA color formats |
| 376 NvColorFormat_R3G3B2 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZ1, X3Y3Z2), |
| 377 NvColorFormat_A4R4G4B4 = NV_COLOR_MAKE_FORMAT(LinearRGBA, YZWX, X4Y4Z4W4), |
| 378 NvColorFormat_R4G4B4A4 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZW, X4Y4Z4W4), |
| 379 NvColorFormat_A1R5G5B5 = NV_COLOR_MAKE_FORMAT(LinearRGBA, YZWX, X1Y5Z5W5), |
| 380 NvColorFormat_R5G5B5A1 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZW, X5Y5Z5W1), |
| 381 NvColorFormat_R5G6B5 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZ1, X5Y6Z5), |
| 382 NvColorFormat_R8_G8_B8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZ1, X8_Y8_Z8), |
| 383 NvColorFormat_B8_G8_R8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, ZYX1, X8_Y8_Z8), |
| 384 NvColorFormat_A8R8G8B8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, YZWX, X8Y8Z8W8), |
| 385 NvColorFormat_A8B8G8R8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, WZYX, X8Y8Z8W8), |
| 386 NvColorFormat_R8G8B8A8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZW, X8Y8Z8W8), |
| 387 NvColorFormat_B8G8R8A8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, ZYXW, X8Y8Z8W8), |
| 388 NvColorFormat_X8R8G8B8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, YZW1, X8Y8Z8W8), |
| 389 NvColorFormat_R8G8B8X8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XYZ1, X8Y8Z8W8), |
| 390 NvColorFormat_X8B8G8R8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, WZY1, X8Y8Z8W8), |
| 391 NvColorFormat_B8G8R8X8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, ZYX1, X8Y8Z8W8), |
| 392 |
| 393 NvColorFormat_Float_B10G11R11 = NV_COLOR_MAKE_FORMAT_GENERIC(LinearRGBA,
ZYX1, X11Y11Z10, Float), |
| 394 NvColorFormat_Float_A16B16G16R16 = NV_COLOR_MAKE_FORMAT_GENERIC(LinearRGBA,
WZYX, X16Y16Z16W16, Float), |
| 395 NvColorFormat_Float_X16B16G16R16 = NV_COLOR_MAKE_FORMAT_GENERIC(LinearRGBA,
WZY1, X16Y16Z16W16, Float), |
| 396 |
| 397 // Luminance color formats |
| 398 NvColorFormat_L1 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XXX1, X1), |
| 399 NvColorFormat_L2 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XXX1, X2), |
| 400 NvColorFormat_L4 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XXX1, X4), |
| 401 NvColorFormat_L8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XXX1, X8), |
| 402 NvColorFormat_L16 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XXX1, X16), |
| 403 NvColorFormat_L32 = NV_COLOR_MAKE_FORMAT(LinearRGBA, XXX1, X32), |
| 404 |
| 405 NvColorFormat_Float_L16 = NV_COLOR_MAKE_FORMAT_GENERIC(LinearRGBA, XXX1,
X16, Float), |
| 406 NvColorFormat_Float_A16L16 = NV_COLOR_MAKE_FORMAT_GENERIC(LinearRGBA, YYYX,
X16Y16, Float), |
| 407 |
| 408 // Alpha color formats |
| 409 NvColorFormat_A1 = NV_COLOR_MAKE_FORMAT(LinearRGBA, 000X, X1), |
| 410 NvColorFormat_A2 = NV_COLOR_MAKE_FORMAT(LinearRGBA, 000X, X2), |
| 411 NvColorFormat_A4 = NV_COLOR_MAKE_FORMAT(LinearRGBA, 000X, X4), |
| 412 NvColorFormat_A8 = NV_COLOR_MAKE_FORMAT(LinearRGBA, 000X, X8), |
| 413 NvColorFormat_A16 = NV_COLOR_MAKE_FORMAT(LinearRGBA, 000X, X16), |
| 414 NvColorFormat_A32 = NV_COLOR_MAKE_FORMAT(LinearRGBA, 000X, X32), |
| 415 |
| 416 NvColorFormat_Float_A16 = NV_COLOR_MAKE_FORMAT_GENERIC(LinearRGBA, 000X, X16
, Float), |
| 417 |
| 418 // Color index formats |
| 419 NvColorFormat_I1 = NV_COLOR_MAKE_FORMAT(ColorIndex, X000, X1), |
| 420 NvColorFormat_I2 = NV_COLOR_MAKE_FORMAT(ColorIndex, X000, X2), |
| 421 NvColorFormat_I4 = NV_COLOR_MAKE_FORMAT(ColorIndex, X000, X4), |
| 422 NvColorFormat_I8 = NV_COLOR_MAKE_FORMAT(ColorIndex, X000, X8), |
| 423 |
| 424 // YUV interleaved color formats |
| 425 NvColorFormat_Y8_U8_V8 = NV_COLOR_MAKE_FORMAT(YCbCr601, XYZ1, X8_Y8_Z8), |
| 426 NvColorFormat_UYVY = NV_COLOR_MAKE_FORMAT(YCbCr601, XYZ1, Y8_X8__Z8_X8), |
| 427 NvColorFormat_VYUY = NV_COLOR_MAKE_FORMAT(YCbCr601, XZY1, Y8_X8__Z8_X8), |
| 428 NvColorFormat_YUYV = NV_COLOR_MAKE_FORMAT(YCbCr601, XYZ1, X8_Y8__X8_Z8), |
| 429 NvColorFormat_YVYU = NV_COLOR_MAKE_FORMAT(YCbCr601, XZY1, X8_Y8__X8_Z8), |
| 430 |
| 431 // YUV planar color formats |
| 432 NvColorFormat_Y8 = NV_COLOR_MAKE_FORMAT(YCbCr601, X000, X8), |
| 433 NvColorFormat_U8 = NV_COLOR_MAKE_FORMAT(YCbCr601, 0X00, X8), |
| 434 NvColorFormat_V8 = NV_COLOR_MAKE_FORMAT(YCbCr601, 00X0, X8), |
| 435 NvColorFormat_U8_V8 = NV_COLOR_MAKE_FORMAT(YCbCr601, 0XY0, X8_Y8), |
| 436 |
| 437 // Range Reduced YUV planar color formats |
| 438 NvColorFormat_Y8_RR = NV_COLOR_MAKE_FORMAT(YCbCr601_RR, X000, X8), |
| 439 NvColorFormat_U8_RR = NV_COLOR_MAKE_FORMAT(YCbCr601_RR, 0X00, X8), |
| 440 NvColorFormat_V8_RR = NV_COLOR_MAKE_FORMAT(YCbCr601_RR, 00X0, X8), |
| 441 NvColorFormat_U8_V8_RR = NV_COLOR_MAKE_FORMAT(YCbCr601_RR, 0XY0, X8_Y8), |
| 442 |
| 443 // Bayer color formats |
| 444 NvColorFormat_Bayer8RGGB = NV_COLOR_MAKE_FORMAT(BayerRGGB, X000, X8), |
| 445 NvColorFormat_Bayer8BGGR = NV_COLOR_MAKE_FORMAT(BayerBGGR, X000, X8), |
| 446 NvColorFormat_Bayer8GRBG = NV_COLOR_MAKE_FORMAT(BayerGRBG, X000, X8), |
| 447 NvColorFormat_Bayer8GBRG = NV_COLOR_MAKE_FORMAT(BayerGBRG, X000, X8), |
| 448 NvColorFormat_X6Bayer10RGGB = NV_COLOR_MAKE_FORMAT(BayerRGGB, X000, Y6X10), |
| 449 NvColorFormat_X6Bayer10BGGR = NV_COLOR_MAKE_FORMAT(BayerBGGR, X000, Y6X10), |
| 450 NvColorFormat_X6Bayer10GRBG = NV_COLOR_MAKE_FORMAT(BayerGRBG, X000, Y6X10), |
| 451 NvColorFormat_X6Bayer10GBRG = NV_COLOR_MAKE_FORMAT(BayerGBRG, X000, Y6X10), |
| 452 NvColorFormat_X4Bayer12RGGB = NV_COLOR_MAKE_FORMAT(BayerRGGB, X000, Y4X12), |
| 453 NvColorFormat_X4Bayer12BGGR = NV_COLOR_MAKE_FORMAT(BayerBGGR, X000, Y4X12), |
| 454 NvColorFormat_X4Bayer12GRBG = NV_COLOR_MAKE_FORMAT(BayerGRBG, X000, Y4X12), |
| 455 NvColorFormat_X4Bayer12GBRG = NV_COLOR_MAKE_FORMAT(BayerGBRG, X000, Y4X12), |
| 456 NvColorFormat_X2Bayer14RGGB = NV_COLOR_MAKE_FORMAT(BayerRGGB, X000, Y2X14), |
| 457 NvColorFormat_X2Bayer14BGGR = NV_COLOR_MAKE_FORMAT(BayerBGGR, X000, Y2X14), |
| 458 NvColorFormat_X2Bayer14GRBG = NV_COLOR_MAKE_FORMAT(BayerGRBG, X000, Y2X14), |
| 459 NvColorFormat_X2Bayer14GBRG = NV_COLOR_MAKE_FORMAT(BayerGBRG, X000, Y2X14), |
| 460 NvColorFormat_Bayer16RGGB = NV_COLOR_MAKE_FORMAT(BayerRGGB, X000, X16), |
| 461 NvColorFormat_Bayer16BGGR = NV_COLOR_MAKE_FORMAT(BayerBGGR, X000, X16), |
| 462 NvColorFormat_Bayer16GRBG = NV_COLOR_MAKE_FORMAT(BayerGRBG, X000, X16), |
| 463 NvColorFormat_Bayer16GBRG = NV_COLOR_MAKE_FORMAT(BayerGBRG, X000, X16), |
| 464 |
| 465 // Non color formats |
| 466 NvColorFormat_X4C4 = NV_COLOR_MAKE_FORMAT(NonColor, X000, Y4X4),
// VCAA |
| 467 |
| 468 NvColorFormat_Force32 = 0x7FFFFFFF |
| 469 } NvColorFormat; |
| 470 |
| 471 #endif // INCLUDED_NVCOLOR_H |
OLD | NEW |