import * as VScript from "http://172.16.0.12/bladerunner_sdk/vscript@2.5.2/deno/release/mod.ts";
import * as VAPI from "./mod.ts";
export const lift = {
  ColorSpaceInfo: (
    _raw: [
      VAPI.Video.ColorSpace,
      VAPI.Video.ColorSpace,
      VAPI.ColorCorrection.LutRange,
      VAPI.ColorCorrection.LutRange,
    ],
    _socket: VScript.VSocket,
  ): ColorSpaceInfo => {
    return {
      input_cs: _raw[0],
      output_cs: _raw[1],
      lut_input_range: _raw[2],
      lut_output_range: _raw[3],
    };
  },
  LutComponent: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new LutComponent(_raw),
  ProcAmpComponent: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new ProcAmpComponent(_raw),
  YUV: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) => new YUV(_raw),
  CC3DLutInfo: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new CC3DLutInfo(_raw),
  CC1DRgb: (_raw: VScript.DataViews.Subtree<VScript.VSocket>) =>
    new CC1DRgb(_raw),
} as const;
export const lower = {
  ColorSpaceInfo: (
    _x: {
      input_cs: VAPI.Video.ColorSpace;
      output_cs: VAPI.Video.ColorSpace;
      lut_input_range: VAPI.ColorCorrection.LutRange;
      lut_output_range: VAPI.ColorCorrection.LutRange;
    },
    _socket: VScript.VSocket,
  ): [
    VAPI.Video.ColorSpace,
    VAPI.Video.ColorSpace,
    VAPI.ColorCorrection.LutRange,
    VAPI.ColorCorrection.LutRange,
  ] => [_x.input_cs, _x.output_cs, _x.lut_input_range, _x.lut_output_range],
  LutComponent: (_x: LutComponent) => _x.raw.kwl,
  ProcAmpComponent: (_x: ProcAmpComponent) => _x.raw.kwl,
  YUV: (_x: YUV) => _x.raw.kwl,
  CC3DLutInfo: (_x: CC3DLutInfo) => _x.raw.kwl,
  CC1DRgb: (_x: CC1DRgb) => _x.raw.kwl,
} as const;
export type ColorSchema = "BRIGHTNESS_CONTRAST" | "BLACK_GAIN";
export interface ColorSpaceInfo {
  input_cs: VAPI.Video.ColorSpace;
  output_cs: VAPI.Video.ColorSpace;
  lut_input_range: VAPI.ColorCorrection.LutRange;
  lut_output_range: VAPI.ColorCorrection.LutRange;
}
export class LutComponent
  implements VScript.Referenceable<"ColorCorrection::Data::LutComponent">
{
  readonly type_identifier = "ColorCorrection::Data::LutComponent" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}

  /**
    in BLACK_GAIN mode this parameter is the black value
  */
  get brightness(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.LutComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.LutComponent
    >(
      this,
      "brightness" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }

  /**
    in BLACK_GAIN mode this parameter is ignored
  */
  get contrast(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.LutComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.LutComponent
    >(
      this,
      "contrast" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }

  /**
    in BRIGHTNESS_CONTRAST mode this parameter is ignored
  */
  get gain(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.LutComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.LutComponent
    >(
      this,
      "gain" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get gamma(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.LutComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.LutComponent
    >(
      this,
      "gamma" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
}
export type LutRange = "NORMAL" | "EXTENDED";
export type OffGamut = "CLIP_TO_0" | "SYMMETRIC" | "LINEAR";
export class ProcAmpComponent
  implements VScript.Referenceable<"ColorCorrection::Data::ProcAmpComponent">
{
  readonly type_identifier = "ColorCorrection::Data::ProcAmpComponent" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}

  /**
    in BLACK_GAIN mode this parameter is the black value
  */
  get brightness(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.ProcAmpComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.ProcAmpComponent
    >(
      this,
      "brightness" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }

  /**
    in BLACK_GAIN mode this parameter is ignored
  */
  get contrast(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.ProcAmpComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.ProcAmpComponent
    >(
      this,
      "contrast" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }

  /**
    in BRIGHTNESS_CONTRAST mode this parameter is ignored
  */
  get gain(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.ProcAmpComponent
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.ProcAmpComponent
    >(
      this,
      "gain" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
}
export class YUV
  implements VScript.Referenceable<"ColorCorrection::Data::YUV">
{
  readonly type_identifier = "ColorCorrection::Data::YUV" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get active(): VScript.dKeyword<
    VScript.VSocket,
    boolean,
    boolean,
    boolean,
    boolean,
    VAPI.ColorCorrection.YUV
  > {
    return new VScript.dKeyword<
      VScript.VSocket,
      boolean,
      boolean,
      boolean,
      boolean,
      VAPI.ColorCorrection.YUV
    >(
      this,
      "active" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get hue_offset(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.YUV
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.YUV
    >(
      this,
      "hue_offset" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get saturation(): VScript.rwKeyword<
    VScript.VSocket,
    number,
    number,
    number,
    number,
    VAPI.ColorCorrection.YUV
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      number,
      number,
      number,
      number,
      VAPI.ColorCorrection.YUV
    >(
      this,
      "saturation" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get y() {
    return VAPI.ColorCorrection.lift.ProcAmpComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 3, "y"),
    );
  }
  get cb() {
    return VAPI.ColorCorrection.lift.ProcAmpComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 4, "cb"),
    );
  }
  get cr() {
    return VAPI.ColorCorrection.lift.ProcAmpComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 5, "cr"),
    );
  }
}
export type CC1DIssues = {
  missing_input_mapper: boolean;
  no_hw_resources_available: boolean;
  no_uhd_resources_allocated: boolean;
};
export type CC3DIssues = {
  missing_input_mapper: boolean;
  no_hw_resources_available: boolean;
  no_uhd_resources_allocated: boolean;
};
export class CC3DLutInfo
  implements VScript.Referenceable<"ColorCorrection::Data::CC3D::LutInfo">
{
  readonly type_identifier = "ColorCorrection::Data::CC3D::LutInfo" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get title(): VScript.rKeyword<
    VScript.VSocket,
    string,
    string,
    VAPI.ColorCorrection.CC3DLutInfo
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      string,
      string,
      VAPI.ColorCorrection.CC3DLutInfo
    >(this, "title" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get comments(): VScript.rKeyword<
    VScript.VSocket,
    string,
    string,
    VAPI.ColorCorrection.CC3DLutInfo
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      string,
      string,
      VAPI.ColorCorrection.CC3DLutInfo
    >(this, "comments" as VScript.SysName, {
      lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
      lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
    });
  }
  get colorspace(): VScript.rKeyword<
    VScript.VSocket,
    | null
    | [
        VAPI.Video.ColorSpace,
        VAPI.Video.ColorSpace,
        VAPI.ColorCorrection.LutRange,
        VAPI.ColorCorrection.LutRange,
      ],
    null | VAPI.ColorCorrection.ColorSpaceInfo,
    VAPI.ColorCorrection.CC3DLutInfo
  > {
    return new VScript.rKeyword<
      VScript.VSocket,
      | null
      | [
          VAPI.Video.ColorSpace,
          VAPI.Video.ColorSpace,
          VAPI.ColorCorrection.LutRange,
          VAPI.ColorCorrection.LutRange,
        ],
      null | VAPI.ColorCorrection.ColorSpaceInfo,
      VAPI.ColorCorrection.CC3DLutInfo
    >(this, "colorspace" as VScript.SysName, {
      lift: VScript.VAPIHelpers.liftOrLowerNullable(
        VAPI.ColorCorrection.lift.ColorSpaceInfo,
      ),
      lower: VScript.VAPIHelpers.liftOrLowerNullable(
        VAPI.ColorCorrection.lower.ColorSpaceInfo,
      ),
    });
  }
}
export class CC1DRgb
  implements VScript.Referenceable<"ColorCorrection::Data::CC1D::Rgb">
{
  readonly type_identifier = "ColorCorrection::Data::CC1D::Rgb" as const;
  constructor(readonly raw: VScript.DataViews.Subtree<VScript.VSocket>) {}
  get active(): VScript.dKeyword<
    VScript.VSocket,
    boolean,
    boolean,
    boolean,
    boolean,
    VAPI.ColorCorrection.CC1DRgb
  > {
    return new VScript.dKeyword<
      VScript.VSocket,
      boolean,
      boolean,
      boolean,
      boolean,
      VAPI.ColorCorrection.CC1DRgb
    >(
      this,
      "active" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get off_gamut(): VScript.rwKeyword<
    VScript.VSocket,
    VAPI.ColorCorrection.OffGamut,
    VAPI.ColorCorrection.OffGamut,
    VAPI.ColorCorrection.OffGamut,
    VAPI.ColorCorrection.OffGamut,
    VAPI.ColorCorrection.CC1DRgb
  > {
    return new VScript.rwKeyword<
      VScript.VSocket,
      VAPI.ColorCorrection.OffGamut,
      VAPI.ColorCorrection.OffGamut,
      VAPI.ColorCorrection.OffGamut,
      VAPI.ColorCorrection.OffGamut,
      VAPI.ColorCorrection.CC1DRgb
    >(
      this,
      "off_gamut" as VScript.SysName,
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      {
        lift: (x: any /* FIXME */, _: VScript.VSocket) => x,
        lower: (x: any /* FIXME */, _: VScript.VSocket) => x,
      },
      null,
    );
  }
  get global() {
    return VAPI.ColorCorrection.lift.LutComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 2, "global"),
    );
  }
  get red() {
    return VAPI.ColorCorrection.lift.LutComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 3, "red"),
    );
  }
  get green() {
    return VAPI.ColorCorrection.lift.LutComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 4, "green"),
    );
  }
  get blue() {
    return VAPI.ColorCorrection.lift.LutComponent(
      VScript.VAPIHelpers.subtree_child_checked(this.raw, 5, "blue"),
    );
  }
}
export const Enums = {
  OffGamut: ["CLIP_TO_0", "SYMMETRIC", "LINEAR"] as OffGamut[],
  LutRange: ["NORMAL", "EXTENDED"] as LutRange[],
  ColorSchema: ["BRIGHTNESS_CONTRAST", "BLACK_GAIN"] as ColorSchema[],
} as const;
