智慧水务管理系统 - 精河县供水工程综合管理平台

Tonemapper.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // @ts-check
  2. /**
  3. * A tonemapping algorithm when rendering with high dynamic range.
  4. *
  5. * @enum {string}
  6. */
  7. const Tonemapper = {
  8. /**
  9. * Use the Reinhard tonemapping.
  10. *
  11. * @type {string}
  12. * @constant
  13. */
  14. REINHARD: "REINHARD",
  15. /**
  16. * Use the modified Reinhard tonemapping.
  17. *
  18. * @type {string}
  19. * @constant
  20. */
  21. MODIFIED_REINHARD: "MODIFIED_REINHARD",
  22. /**
  23. * Use the Filmic tonemapping.
  24. *
  25. * @type {string}
  26. * @constant
  27. */
  28. FILMIC: "FILMIC",
  29. /**
  30. * Use the ACES tonemapping.
  31. *
  32. * @type {string}
  33. * @constant
  34. */
  35. ACES: "ACES",
  36. /**
  37. * Use the PBR Neutral tonemapping {@link https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral|from Khronos}.
  38. *
  39. * @type {string}
  40. * @constant
  41. */
  42. PBR_NEUTRAL: "PBR_NEUTRAL",
  43. };
  44. /**
  45. * Validate whether the provided value is a known Tonemapper type
  46. * @private
  47. *
  48. * @param {string} tonemapper
  49. */
  50. export function validateTonemapper(tonemapper) {
  51. return (
  52. tonemapper === Tonemapper.REINHARD ||
  53. tonemapper === Tonemapper.MODIFIED_REINHARD ||
  54. tonemapper === Tonemapper.FILMIC ||
  55. tonemapper === Tonemapper.ACES ||
  56. tonemapper === Tonemapper.PBR_NEUTRAL
  57. );
  58. }
  59. Object.freeze(Tonemapper);
  60. export default Tonemapper;