| 1 | // |
| 2 | // SPDX-License-Identifier: BSD-3-Clause |
| 3 | // Copyright (c) Contributors to the OpenEXR Project. |
| 4 | // |
| 5 | |
| 6 | #ifndef INCLUDED_IMF_RGBA_H |
| 7 | #define INCLUDED_IMF_RGBA_H |
| 8 | |
| 9 | //----------------------------------------------------------------------------- |
| 10 | // |
| 11 | // class Rgba |
| 12 | // |
| 13 | //----------------------------------------------------------------------------- |
| 14 | |
| 15 | #include "ImfExport.h" |
| 16 | #include "ImfNamespace.h" |
| 17 | |
| 18 | #include <half.h> |
| 19 | |
| 20 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER |
| 21 | |
| 22 | |
| 23 | // |
| 24 | // RGBA pixel |
| 25 | // |
| 26 | |
| 27 | struct Rgba |
| 28 | { |
| 29 | half r; |
| 30 | half g; |
| 31 | half b; |
| 32 | half a; |
| 33 | |
| 34 | Rgba () {} |
| 35 | Rgba (half r, half g, half b, half a = 1.f): r (r), g (g), b (b), a (a) {} |
| 36 | }; |
| 37 | |
| 38 | |
| 39 | // |
| 40 | // Channels in an RGBA file |
| 41 | // |
| 42 | |
| 43 | enum IMF_EXPORT_ENUM RgbaChannels |
| 44 | { |
| 45 | WRITE_R = 0x01, // Red |
| 46 | WRITE_G = 0x02, // Green |
| 47 | WRITE_B = 0x04, // Blue |
| 48 | WRITE_A = 0x08, // Alpha |
| 49 | |
| 50 | WRITE_Y = 0x10, // Luminance, for black-and-white images, |
| 51 | // or in combination with chroma |
| 52 | |
| 53 | WRITE_C = 0x20, // Chroma (two subsampled channels, RY and BY, |
| 54 | // supported only for scanline-based files) |
| 55 | |
| 56 | WRITE_RGB = 0x07, // Red, green, blue |
| 57 | WRITE_RGBA = 0x0f, // Red, green, blue, alpha |
| 58 | |
| 59 | WRITE_YC = 0x30, // Luminance, chroma |
| 60 | WRITE_YA = 0x18, // Luminance, alpha |
| 61 | WRITE_YCA = 0x38 // Luminance, chroma, alpha |
| 62 | }; |
| 63 | |
| 64 | |
| 65 | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | #endif |
| 72 | |