Enums.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * Copyright (c) 2023, Nico Weber <thakis@chromium.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/StringView.h>
  8. namespace Gfx::ICC {
  9. // ICC v4, 7.2.5 Profile/device class field
  10. enum class DeviceClass : u32 {
  11. InputDevice = 0x73636E72, // 'scnr'
  12. DisplayDevice = 0x6D6E7472, // 'mntr'
  13. OutputDevice = 0x70727472, // 'prtr'
  14. DeviceLink = 0x6C696E6B, // 'link'
  15. ColorSpace = 0x73706163, // 'spac'
  16. Abstract = 0x61627374, // 'abst'
  17. NamedColor = 0x6E6D636C, // 'nmcl'
  18. };
  19. StringView device_class_name(DeviceClass);
  20. // ICC v4, 7.2.6 Data colour space field, Table 19 — Data colour space signatures
  21. enum class ColorSpace : u32 {
  22. nCIEXYZ = 0x58595A20, // 'XYZ ', used in data color spaces.
  23. PCSXYZ = nCIEXYZ, // Used in profile connection space instead.
  24. CIELAB = 0x4C616220, // 'Lab ', used in data color spaces.
  25. PCSLAB = CIELAB, // Used in profile connection space instead.
  26. CIELUV = 0x4C757620, // 'Luv '
  27. YCbCr = 0x59436272, // 'YCbr'
  28. CIEYxy = 0x59787920, // 'Yxy '
  29. RGB = 0x52474220, // 'RGB '
  30. Gray = 0x47524159, // 'GRAY'
  31. HSV = 0x48535620, // 'HSV '
  32. HLS = 0x484C5320, // 'HLS '
  33. CMYK = 0x434D594B, // 'CMYK'
  34. CMY = 0x434D5920, // 'CMY '
  35. TwoColor = 0x32434C52, // '2CLR'
  36. ThreeColor = 0x33434C52, // '3CLR'
  37. FourColor = 0x34434C52, // '4CLR'
  38. FiveColor = 0x35434C52, // '5CLR'
  39. SixColor = 0x36434C52, // '6CLR'
  40. SevenColor = 0x37434C52, // '7CLR'
  41. EightColor = 0x38434C52, // '8CLR'
  42. NineColor = 0x39434C52, // '9CLR'
  43. TenColor = 0x41434C52, // 'ACLR'
  44. ElevenColor = 0x42434C52, // 'BCLR'
  45. TwelveColor = 0x43434C52, // 'CCLR'
  46. ThirteenColor = 0x44434C52, // 'DCLR'
  47. FourteenColor = 0x45434C52, // 'ECLR'
  48. FifteenColor = 0x46434C52, // 'FCLR'
  49. };
  50. StringView data_color_space_name(ColorSpace);
  51. StringView profile_connection_space_name(ColorSpace);
  52. unsigned number_of_components_in_color_space(ColorSpace);
  53. // ICC v4, 7.2.10 Primary platform field, Table 20 — Primary platforms
  54. enum class PrimaryPlatform : u32 {
  55. Apple = 0x4150504C, // 'APPL'
  56. Microsoft = 0x4D534654, // 'MSFT'
  57. SiliconGraphics = 0x53474920, // 'SGI '
  58. Sun = 0x53554E57, // 'SUNW'
  59. };
  60. StringView primary_platform_name(PrimaryPlatform);
  61. // ICC v4, 7.2.15 Rendering intent field
  62. enum class RenderingIntent {
  63. Perceptual,
  64. MediaRelativeColorimetric,
  65. Saturation,
  66. ICCAbsoluteColorimetric,
  67. };
  68. StringView rendering_intent_name(RenderingIntent);
  69. }