Lut.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. Represents a lookup table for colormaps. It is used to determine the color values from a range of data values.
  13. </p>
  14. <h2>Code Example</h2>
  15. <code>
  16. const lut = new Lut( 'rainbow', 512 );
  17. const color = lut.getColor( 0.5 );
  18. </code>
  19. <h2>Constructor</h2>
  20. <h3>[name]( colormap, numberOfColors )</h3>
  21. <p>
  22. colormap - optional argument that sets a colormap from predefined colormaps. Available colormaps are : "rainbow", "cooltowarm", "blackbody".
  23. numberOfColors - optional argument that sets the number of colors used to represent the data array.
  24. </p>
  25. <h2>Properties</h2>
  26. <h3>[property:Float minV]</h3>
  27. <p>
  28. The minimum value to be represented with the lookup table. Default is 0.
  29. </p>
  30. <h3>[property:Float maxV]</h3>
  31. <p>
  32. The maximum value to be represented with the lookup table. Default is 1.
  33. </p>
  34. <h3>.[legend]</h3>
  35. <p>
  36. The legend of the lookup table.
  37. </p>
  38. <h2>Methods</h2>
  39. <h3>[method:null copy]( [param:Lut lut] ) [param:Lut this]</h3>
  40. <p>
  41. color — Lut to copy.
  42. </p>
  43. <p>
  44. Copies given lut.
  45. </p>
  46. <h3>.setLegendOn [parameters]</h3>
  47. <p>
  48. parameters - { layout: value, position: { x: value, y: value, z: value }, dimensions: { width: value, height: value } }
  49. layout — Horizontal or vertical layout. Default is vertical.<br />
  50. position — The position x,y,z of the legend.<br />
  51. dimensions — The dimensions (width and height) of the legend.<br />
  52. </p>
  53. <p>
  54. Sets this Lut with the legend on.
  55. </p>
  56. <h3>.setLegendOff</h3>
  57. <p>
  58. </p>
  59. <p>
  60. Sets this Lut with the legend off.
  61. </p>
  62. <h3>.setLegendLabels [parameters, callback]</h3>
  63. <p>
  64. parameters - { fontsize: value, fontface: value, title: value, um: value, ticks: value, decimal: value, notation: value }
  65. fontsize — Font size to be used for labels.<br />
  66. fontface — Font type to be used for labels.<br />
  67. title — The title of the legend.<br />
  68. um — The unit of measurements of the legend.<br />
  69. ticks — The number of ticks to be displayed.<br />
  70. decimal — The number of decimals to be used for legend values.<br />
  71. notation — Legend notation: standard (default) or scientific.<br />
  72. callback — An optional callback to be used to format the legend labels.<br />
  73. </p>
  74. <p>
  75. Sets the labels of the legend of this Lut.
  76. </p>
  77. <h3>[method:Lut setMin]( [param:Float minV] )</h3>
  78. <p>
  79. minV — The minimum value to be represented with the lookup table.<br />
  80. </p>
  81. <p>
  82. Sets this Lut with the minimum value to be represented.
  83. </p>
  84. <h3>[method:Lut setMax]( [param:Float maxV] )</h3>
  85. <p>
  86. maxV — The maximum value to be represented with the lookup table.<br />
  87. </p>
  88. <p>
  89. Sets this Lut with the maximum value to be represented.
  90. </p>
  91. <h3>[method:Lut changeNumberOfColors]( [param:Float numberOfColors] )</h3>
  92. <p>
  93. numberOfColors — The number of colors to be used to represent the data array.<br />
  94. </p>
  95. <p>
  96. Sets this Lut with the number of colors to be used.
  97. </p>
  98. <h3>[method:Lut changeColorMap]( [param:Float colorMap] )</h3>
  99. <p>
  100. colorMap — The name of the color map to be used to represent the data array.<br />
  101. </p>
  102. <p>
  103. Sets this Lut with the colormap to be used.
  104. </p>
  105. <h3>[method:Lut addColorMap]( colorMapName, arrayOfColors )</h3>
  106. <p>
  107. Insert a new color map into the set of available color maps.
  108. </p>
  109. <h3>[method:Lut getColor]( value ) [param:Lut this]</h3>
  110. <p>
  111. value -- the data value to be displayed as a color.
  112. </p>
  113. <p>
  114. Returns a [page:Color].
  115. </p>
  116. <h2>Source</h2>
  117. <p>
  118. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/Lut.js examples/jsm/math/Lut.js]
  119. </p>
  120. </body>
  121. </html>