@kitware/vtk.js 20.0.2 → 20.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,7 @@ import { i as identity, t as translate, j as transpose, g as invert, m as multip
|
|
|
12
12
|
import { t as transformMat4, s as subtract } from '../../vendor/gl-matrix/esm/vec4.js';
|
|
13
13
|
|
|
14
14
|
var SlicingMode = Constants.SlicingMode;
|
|
15
|
-
var imgFragTemplate = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Image::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n //VTK::Image::Sample\n
|
|
15
|
+
var imgFragTemplate = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::Image::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n //VTK::Image::Sample\n\n // var computedColor: vec4<f32> = vec4<f32>(1.0,0.7, 0.5, 1.0);\n\n//VTK::RenderEncoder::Impl\n\n return output;\n}\n"; // ----------------------------------------------------------------------------
|
|
16
16
|
// helper methods
|
|
17
17
|
// ----------------------------------------------------------------------------
|
|
18
18
|
|
|
@@ -223,10 +223,16 @@ function vtkWebGPUImageMapper(publicAPI, model) {
|
|
|
223
223
|
|
|
224
224
|
{
|
|
225
225
|
for (var _i = 0; _i < model.rowLength; _i++) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
colorArray[
|
|
229
|
-
colorArray[
|
|
226
|
+
var _idx = c * model.rowLength * 8 + _i * 4;
|
|
227
|
+
|
|
228
|
+
colorArray[_idx] = 255.0 * tmpTable[_i * 3];
|
|
229
|
+
colorArray[_idx + 1] = 255.0 * tmpTable[_i * 3 + 1];
|
|
230
|
+
colorArray[_idx + 2] = 255.0 * tmpTable[_i * 3 + 2];
|
|
231
|
+
colorArray[_idx + 3] = 255.0;
|
|
232
|
+
|
|
233
|
+
for (var _j = 0; _j < 4; _j++) {
|
|
234
|
+
colorArray[_idx + model.rowLength * 4 + _j] = colorArray[_idx + _j];
|
|
235
|
+
}
|
|
230
236
|
}
|
|
231
237
|
}
|
|
232
238
|
}
|
|
@@ -238,8 +244,8 @@ function vtkWebGPUImageMapper(publicAPI, model) {
|
|
|
238
244
|
colorArray[_i2 * 4 + 2] = grey;
|
|
239
245
|
colorArray[_i2 * 4 + 3] = 255.0;
|
|
240
246
|
|
|
241
|
-
for (var
|
|
242
|
-
colorArray[_i2 * 4 + model.rowLength * 4 +
|
|
247
|
+
for (var _j2 = 0; _j2 < 4; _j2++) {
|
|
248
|
+
colorArray[_i2 * 4 + model.rowLength * 4 + _j2] = colorArray[_i2 * 4 + _j2];
|
|
243
249
|
}
|
|
244
250
|
}
|
|
245
251
|
}
|