Lut.html 4.0 KB

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