ImfRgba.h 1.3 KB

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