/usr/local/include/OpenEXR/ImfRgba.h
Line | Count | Source (jump to first uncovered line) |
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 | | // RGBA pixel |
24 | | // |
25 | | |
26 | | struct Rgba |
27 | | { |
28 | | half r; |
29 | | half g; |
30 | | half b; |
31 | | half a; |
32 | | |
33 | 3.61G | Rgba () {} |
34 | 0 | Rgba (half r, half g, half b, half a = 1.f) : r (r), g (g), b (b), a (a) {} |
35 | | }; |
36 | | |
37 | | // |
38 | | // Channels in an RGBA file |
39 | | // |
40 | | |
41 | | enum IMF_EXPORT_ENUM RgbaChannels |
42 | | { |
43 | | WRITE_R = 0x01, // Red |
44 | | WRITE_G = 0x02, // Green |
45 | | WRITE_B = 0x04, // Blue |
46 | | WRITE_A = 0x08, // Alpha |
47 | | |
48 | | WRITE_Y = 0x10, // Luminance, for black-and-white images, |
49 | | // or in combination with chroma |
50 | | |
51 | | WRITE_C = 0x20, // Chroma (two subsampled channels, RY and BY, |
52 | | // supported only for scanline-based files) |
53 | | |
54 | | WRITE_RGB = 0x07, // Red, green, blue |
55 | | WRITE_RGBA = 0x0f, // Red, green, blue, alpha |
56 | | |
57 | | WRITE_YC = 0x30, // Luminance, chroma |
58 | | WRITE_YA = 0x18, // Luminance, alpha |
59 | | WRITE_YCA = 0x38 // Luminance, chroma, alpha |
60 | | }; |
61 | | |
62 | | OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT |
63 | | |
64 | | #endif |