Skip to content

Commit 4f5dc39

Browse files
fix(LookupTableProxy): Support midpoint/sharpness in rgbpoints
1 parent d53c834 commit 4f5dc39

File tree

2 files changed

+6
-6
lines changed
  • Sources

2 files changed

+6
-6
lines changed

Sources/Proxy/Core/LookupTableProxy/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ function vtkLookupTableProxy(publicAPI, model) {
3030
}
3131
};
3232

33-
// Takes an array of points [x, r, g, b]
33+
// Takes an array of points [x, r, g, b, m=0.5, s=0.0]
3434
publicAPI.setRGBPoints = (rgbPoints) => {
3535
if (model.rgbPoints !== rgbPoints) {
3636
model.rgbPoints = (rgbPoints || Defaults.RGBPoints).slice();
3737
publicAPI.applyMode();
3838
}
3939
};
4040

41-
// Takes an array of points [x, h, s, v]
41+
// Takes an array of points [x, h, s, v, m=0.5, s=0.0]
4242
publicAPI.setHSVPoints = (hsvPoints) => {
4343
if (model.hsvPoints !== hsvPoints) {
4444
model.hsvPoints = (hsvPoints || Defaults.HSVPoints).slice();
@@ -75,14 +75,14 @@ function vtkLookupTableProxy(publicAPI, model) {
7575
case Mode.RGBPoints:
7676
model.lookupTable.removeAllPoints();
7777
model.rgbPoints.forEach((point) =>
78-
model.lookupTable.addRGBPoint(...point)
78+
model.lookupTable.addRGBPointLong(...point)
7979
);
8080
break;
8181

8282
case Mode.HSVPoints:
8383
model.lookupTable.removeAllPoints();
8484
model.hsvPoints.forEach((point) =>
85-
model.lookupTable.addHSVPoint(...point)
85+
model.lookupTable.addHSVPointLong(...point)
8686
);
8787
break;
8888

Sources/Rendering/Core/ColorTransferFunction/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function vtkColorTransferFunction(publicAPI, model) {
147147

148148
//----------------------------------------------------------------------------
149149
// Add a point defined in RGB
150-
publicAPI.addRGBPointLong = (x, r, g, b, midpoint, sharpness) => {
150+
publicAPI.addRGBPointLong = (x, r, g, b, midpoint = 0.5, sharpness = 0.0) => {
151151
// Error check
152152
if (midpoint < 0.0 || midpoint > 1.0) {
153153
vtkErrorMacro('Midpoint outside range [0.0, 1.0]');
@@ -196,7 +196,7 @@ function vtkColorTransferFunction(publicAPI, model) {
196196

197197
//----------------------------------------------------------------------------
198198
// Add a point defined in HSV
199-
publicAPI.addHSVPointLong = (x, h, s, v, midpoint, sharpness) => {
199+
publicAPI.addHSVPointLong = (x, h, s, v, midpoint = 0.5, sharpness = 0.0) => {
200200
const rgb = [];
201201
const hsv = [h, s, v];
202202

0 commit comments

Comments
 (0)