Skip to content

Commit

Permalink
fix(ImageProperty): color + opacity funcs can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
floryst committed Jun 18, 2024
1 parent b793230 commit 6d24013
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Sources/Rendering/Core/ImageProperty/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { vtkObject } from '../../../interfaces';
import { Nullable } from '../../../types';
import vtkColorTransferFunction from '../ColorTransferFunction';
import vtkPiecewiseFunction from '../../../Common/DataModel/PiecewiseFunction';
import { InterpolationType } from './Constants';
Expand Down Expand Up @@ -79,13 +80,13 @@ export interface vtkImageProperty extends vtkObject {
* Get the component weighting function.
* @param {Number} [idx]
*/
getPiecewiseFunction(idx?: number): vtkPiecewiseFunction;
getPiecewiseFunction(idx?: number): Nullable<vtkPiecewiseFunction>;

/**
* Get the currently set RGB transfer function.
* @param {Number} [idx]
*/
getRGBTransferFunction(idx?: number): vtkColorTransferFunction;
getRGBTransferFunction(idx?: number): Nullable<vtkColorTransferFunction>;

/**
* Alias to get the piecewise function (backwards compatibility)
Expand Down Expand Up @@ -176,7 +177,10 @@ export interface vtkImageProperty extends vtkObject {
* @param {Number} index
* @param {vtkPiecewiseFunction} func
*/
setPiecewiseFunction(index: number, func: vtkPiecewiseFunction): boolean;
setPiecewiseFunction(
index: number,
func: Nullable<vtkPiecewiseFunction>
): boolean;

/**
* Set the color of a volume to an RGB transfer function
Expand All @@ -185,15 +189,18 @@ export interface vtkImageProperty extends vtkObject {
*/
setRGBTransferFunction(
index: number,
func: vtkColorTransferFunction
func: Nullable<vtkColorTransferFunction>
): boolean;

/**
* Alias to set the piecewise function
* @param {Number} index
* @param {vtkPiecewiseFunction} func
*/
setScalarOpacity(index: number, func: vtkPiecewiseFunction): boolean;
setScalarOpacity(
index: number,
func: Nullable<vtkPiecewiseFunction>
): boolean;

/**
* Use the range that is set on the lookup table, instead of setting the range from the
Expand Down

0 comments on commit 6d24013

Please sign in to comment.