import {BaseNodeGlMathFunctionArg5GlNode} from "./_BaseMathFunction";
import {BaseNodeGlMathFunctionArg3GlNode} from "./_BaseMathFunction";
import FitMethods from "./gl/fit.glsl";
import {FunctionGLDefinition} from "./utils/GLDefinition";
const FitDefaultValues = {
  srcMin: 0,
  srcMax: 1,
  destMin: 0,
  destMax: 1
};
export class FitGlNode extends BaseNodeGlMathFunctionArg5GlNode {
  static type() {
    return "fit";
  }
  _gl_input_name(index) {
    return ["val", "srcMin", "srcMax", "destMin", "destMax"][index];
  }
  param_default_value(name) {
    return FitDefaultValues[name];
  }
  gl_method_name() {
    return "fit";
  }
  gl_function_definitions() {
    return [new FunctionGLDefinition(this, FitMethods)];
  }
}
const FitTo01DefaultValues = {
  srcMin: 0,
  srcMax: 1
};
export class FitTo01GlNode extends BaseNodeGlMathFunctionArg3GlNode {
  static type() {
    return "fitTo01";
  }
  _gl_input_name(index) {
    return ["val", "srcMin", "srcMax"][index];
  }
  param_default_value(name) {
    return FitTo01DefaultValues[name];
  }
  gl_method_name() {
    return "fitTo01";
  }
  gl_function_definitions() {
    return [new FunctionGLDefinition(this, FitMethods)];
  }
}
const FitFrom01DefaultValues = {
  destMin: 0,
  destMax: 1
};
export class FitFrom01GlNode extends BaseNodeGlMathFunctionArg3GlNode {
  static type() {
    return "fitFrom01";
  }
  _gl_input_name(index) {
    return ["val", "destMin", "destMax"][index];
  }
  param_default_value(name) {
    return FitFrom01DefaultValues[name];
  }
  gl_method_name() {
    return "fitFrom01";
  }
  gl_function_definitions() {
    return [new FunctionGLDefinition(this, FitMethods)];
  }
}
const FitFrom01ToVarianceDefaultValues = {
  center: 0.5,
  variance: 0.5
};
export class FitFrom01ToVarianceGlNode extends BaseNodeGlMathFunctionArg3GlNode {
  static type() {
    return "fitFrom01ToVariance";
  }
  _gl_input_name(index) {
    return ["val", "center", "variance"][index];
  }
  param_default_value(name) {
    return FitFrom01ToVarianceDefaultValues[name];
  }
  gl_method_name() {
    return "fitFrom01ToVariance";
  }
  gl_function_definitions() {
    return [new FunctionGLDefinition(this, FitMethods)];
  }
}
