# Auto-generated by `python -m gen` — do not edit manually.

from typing import TYPE_CHECKING, Literal

import bpy

from ...builder import BaseNode, SocketAccessor

from ...types import (
    InputBoolean,
    InputColor,
    InputFloat,
    InputInteger,
    InputMenu,
    InputVector,
)

from ...builder.socket import (
    BooleanSocket,
    ColorSocket,
    FloatSocket,
    IntegerSocket,
    MenuSocket,
    VectorSocket,
)


class BoxMask(BaseNode):
    """
    Create rectangular mask suitable for use as a simple matte

    Parameters
    ----------
    operation : InputMenu | Literal['Add', 'Subtract', 'Multiply', 'Not']
        Operation
    mask : InputFloat
        Mask
    value : InputFloat
        Value
    position : InputVector
        Position
    size : InputVector
        Size
    rotation : InputFloat
        Rotation

    Inputs
    ------
    i.operation : MenuSocket
        Operation
    i.mask : FloatSocket
        Mask
    i.value : FloatSocket
        Value
    i.position : VectorSocket
        Position
    i.size : VectorSocket
        Size
    i.rotation : FloatSocket
        Rotation

    Outputs
    -------
    o.mask : FloatSocket
        Mask
    """

    _bl_idname = "CompositorNodeBoxMask"
    node: bpy.types.CompositorNodeBoxMask

    class _Inputs(SocketAccessor):
        operation: MenuSocket
        """Operation"""
        mask: FloatSocket
        """Mask"""
        value: FloatSocket
        """Value"""
        position: VectorSocket
        """Position"""
        size: VectorSocket
        """Size"""
        rotation: FloatSocket
        """Rotation"""

    class _Outputs(SocketAccessor):
        mask: FloatSocket
        """Mask"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        operation: InputMenu | Literal["Add", "Subtract", "Multiply", "Not"] = "Add",
        mask: InputFloat = 0.0,
        value: InputFloat = 1.0,
        position: InputVector = None,
        size: InputVector = None,
        rotation: InputFloat = 0.0,
    ):
        super().__init__()
        key_args = {
            "Operation": operation,
            "Mask": mask,
            "Value": value,
            "Position": position,
            "Size": size,
            "Rotation": rotation,
        }

        self._establish_links(**key_args)


class ChannelKey(BaseNode):
    """
    Create matte based on differences in color channels

    Parameters
    ----------
    image : InputColor
        Image
    minimum : InputFloat
        Minimum
    maximum : InputFloat
        Maximum
    color_space : InputMenu | Literal['RGB', 'HSV', 'YUV', 'YCbCr']
        Color Space
    rgb_key_channel : InputMenu | Literal['R', 'G', 'B']
        RGB Key Channel
    hsv_key_channel : InputMenu | Literal['H', 'S', 'V']
        HSV Key Channel
    yuv_key_channel : InputMenu | Literal['Y', 'U', 'V']
        YUV Key Channel
    ycbcr_key_channel : InputMenu | Literal['Y', 'Cb', 'Cr']
        YCbCr Key Channel
    limit_method : InputMenu | Literal['Single', 'Max']
        Limit Method
    rgb_limit_channel : InputMenu | Literal['R', 'G', 'B']
        RGB Limit Channel
    hsv_limit_channel : InputMenu | Literal['H', 'S', 'V']
        HSV Limit Channel
    yuv_limit_channel : InputMenu | Literal['Y', 'U', 'V']
        YUV Limit Channel
    ycbcr_limit_channel : InputMenu | Literal['Y', 'Cb', 'Cr']
        YCbCr Limit Channel

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.minimum : FloatSocket
        Minimum
    i.maximum : FloatSocket
        Maximum
    i.color_space : MenuSocket
        Color Space
    i.rgb_key_channel : MenuSocket
        RGB Key Channel
    i.hsv_key_channel : MenuSocket
        HSV Key Channel
    i.yuv_key_channel : MenuSocket
        YUV Key Channel
    i.ycbcr_key_channel : MenuSocket
        YCbCr Key Channel
    i.limit_method : MenuSocket
        Limit Method
    i.rgb_limit_channel : MenuSocket
        RGB Limit Channel
    i.hsv_limit_channel : MenuSocket
        HSV Limit Channel
    i.yuv_limit_channel : MenuSocket
        YUV Limit Channel
    i.ycbcr_limit_channel : MenuSocket
        YCbCr Limit Channel

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    """

    _bl_idname = "CompositorNodeChannelMatte"
    node: bpy.types.CompositorNodeChannelMatte

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        minimum: FloatSocket
        """Minimum"""
        maximum: FloatSocket
        """Maximum"""
        color_space: MenuSocket
        """Color Space"""
        rgb_key_channel: MenuSocket
        """RGB Key Channel"""
        hsv_key_channel: MenuSocket
        """HSV Key Channel"""
        yuv_key_channel: MenuSocket
        """YUV Key Channel"""
        ycbcr_key_channel: MenuSocket
        """YCbCr Key Channel"""
        limit_method: MenuSocket
        """Limit Method"""
        rgb_limit_channel: MenuSocket
        """RGB Limit Channel"""
        hsv_limit_channel: MenuSocket
        """HSV Limit Channel"""
        yuv_limit_channel: MenuSocket
        """YUV Limit Channel"""
        ycbcr_limit_channel: MenuSocket
        """YCbCr Limit Channel"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        minimum: InputFloat = 0.0,
        maximum: InputFloat = 1.0,
        color_space: InputMenu | Literal["RGB", "HSV", "YUV", "YCbCr"] = "RGB",
        rgb_key_channel: InputMenu | Literal["R", "G", "B"] = "G",
        hsv_key_channel: InputMenu | Literal["H", "S", "V"] = "H",
        yuv_key_channel: InputMenu | Literal["Y", "U", "V"] = "V",
        ycbcr_key_channel: InputMenu | Literal["Y", "Cb", "Cr"] = "Cr",
        limit_method: InputMenu | Literal["Single", "Max"] = "Max",
        rgb_limit_channel: InputMenu | Literal["R", "G", "B"] = "R",
        hsv_limit_channel: InputMenu | Literal["H", "S", "V"] = "S",
        yuv_limit_channel: InputMenu | Literal["Y", "U", "V"] = "U",
        ycbcr_limit_channel: InputMenu | Literal["Y", "Cb", "Cr"] = "Cb",
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Minimum": minimum,
            "Maximum": maximum,
            "Color Space": color_space,
            "RGB Key Channel": rgb_key_channel,
            "HSV Key Channel": hsv_key_channel,
            "YUV Key Channel": yuv_key_channel,
            "YCbCr Key Channel": ycbcr_key_channel,
            "Limit Method": limit_method,
            "RGB Limit Channel": rgb_limit_channel,
            "HSV Limit Channel": hsv_limit_channel,
            "YUV Limit Channel": yuv_limit_channel,
            "YCbCr Limit Channel": ycbcr_limit_channel,
        }

        self._establish_links(**key_args)


class ChromaKey(BaseNode):
    """
    Create matte based on chroma values

    Parameters
    ----------
    image : InputColor
        Image
    key_color : InputColor
        Key Color
    minimum : InputFloat
        Minimum
    maximum : InputFloat
        Maximum
    falloff : InputFloat
        Falloff

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.key_color : ColorSocket
        Key Color
    i.minimum : FloatSocket
        Minimum
    i.maximum : FloatSocket
        Maximum
    i.falloff : FloatSocket
        Falloff

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    """

    _bl_idname = "CompositorNodeChromaMatte"
    node: bpy.types.CompositorNodeChromaMatte

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        key_color: ColorSocket
        """Key Color"""
        minimum: FloatSocket
        """Minimum"""
        maximum: FloatSocket
        """Maximum"""
        falloff: FloatSocket
        """Falloff"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        key_color: InputColor = None,
        minimum: InputFloat = 0.1745,
        maximum: InputFloat = 0.5236,
        falloff: InputFloat = 1.0,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Key Color": key_color,
            "Minimum": minimum,
            "Maximum": maximum,
            "Falloff": falloff,
        }

        self._establish_links(**key_args)


class ColorKey(BaseNode):
    """
    Create matte using a given color, for green or blue screen footage

    Parameters
    ----------
    image : InputColor
        Image
    key_color : InputColor
        Key Color
    hue : InputFloat
        Hue
    saturation : InputFloat
        Saturation
    value : InputFloat
        Value

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.key_color : ColorSocket
        Key Color
    i.hue : FloatSocket
        Hue
    i.saturation : FloatSocket
        Saturation
    i.value : FloatSocket
        Value

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    """

    _bl_idname = "CompositorNodeColorMatte"
    node: bpy.types.CompositorNodeColorMatte

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        key_color: ColorSocket
        """Key Color"""
        hue: FloatSocket
        """Hue"""
        saturation: FloatSocket
        """Saturation"""
        value: FloatSocket
        """Value"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        key_color: InputColor = None,
        hue: InputFloat = 0.01,
        saturation: InputFloat = 0.1,
        value: InputFloat = 0.1,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Key Color": key_color,
            "Hue": hue,
            "Saturation": saturation,
            "Value": value,
        }

        self._establish_links(**key_args)


class ColorSpill(BaseNode):
    """
    Remove colors from a blue or green screen, by reducing one RGB channel compared to the others

    Parameters
    ----------
    image : InputColor
        Image
    fac : InputFloat
        Factor
    spill_channel : InputMenu | Literal['R', 'G', 'B']
        Spill Channel
    limit_method : InputMenu | Literal['Single', 'Average']
        Limit Method
    limit_channel : InputMenu | Literal['R', 'G', 'B']
        Limit Channel
    limit_strength : InputFloat
        Limit Strength
    use_spill_strength : InputBoolean
        Use Spill Strength
    spill_strength : InputColor
        Strength

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.fac : FloatSocket
        Factor
    i.spill_channel : MenuSocket
        Spill Channel
    i.limit_method : MenuSocket
        Limit Method
    i.limit_channel : MenuSocket
        Limit Channel
    i.limit_strength : FloatSocket
        Limit Strength
    i.use_spill_strength : BooleanSocket
        Use Spill Strength
    i.spill_strength : ColorSocket
        Strength

    Outputs
    -------
    o.image : ColorSocket
        Image
    """

    _bl_idname = "CompositorNodeColorSpill"
    node: bpy.types.CompositorNodeColorSpill

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        fac: FloatSocket
        """Factor"""
        spill_channel: MenuSocket
        """Spill Channel"""
        limit_method: MenuSocket
        """Limit Method"""
        limit_channel: MenuSocket
        """Limit Channel"""
        limit_strength: FloatSocket
        """Limit Strength"""
        use_spill_strength: BooleanSocket
        """Use Spill Strength"""
        spill_strength: ColorSocket
        """Strength"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        fac: InputFloat = 1.0,
        spill_channel: InputMenu | Literal["R", "G", "B"] = "G",
        limit_method: InputMenu | Literal["Single", "Average"] = "Single",
        limit_channel: InputMenu | Literal["R", "G", "B"] = "R",
        limit_strength: InputFloat = 1.0,
        use_spill_strength: InputBoolean = False,
        spill_strength: InputColor = None,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Fac": fac,
            "Spill Channel": spill_channel,
            "Limit Method": limit_method,
            "Limit Channel": limit_channel,
            "Limit Strength": limit_strength,
            "Use Spill Strength": use_spill_strength,
            "Spill Strength": spill_strength,
        }

        self._establish_links(**key_args)


class DifferenceKey(BaseNode):
    """
    Produce a matte that isolates foreground content by comparing it with a reference background image

    Parameters
    ----------
    image_1 : InputColor
        Image 1
    image_2 : InputColor
        Image 2
    tolerance : InputFloat
        Tolerance
    falloff : InputFloat
        Falloff

    Inputs
    ------
    i.image_1 : ColorSocket
        Image 1
    i.image_2 : ColorSocket
        Image 2
    i.tolerance : FloatSocket
        Tolerance
    i.falloff : FloatSocket
        Falloff

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    """

    _bl_idname = "CompositorNodeDiffMatte"
    node: bpy.types.CompositorNodeDiffMatte

    class _Inputs(SocketAccessor):
        image_1: ColorSocket
        """Image 1"""
        image_2: ColorSocket
        """Image 2"""
        tolerance: FloatSocket
        """Tolerance"""
        falloff: FloatSocket
        """Falloff"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image_1: InputColor = None,
        image_2: InputColor = None,
        tolerance: InputFloat = 0.1,
        falloff: InputFloat = 0.1,
    ):
        super().__init__()
        key_args = {
            "Image 1": image_1,
            "Image 2": image_2,
            "Tolerance": tolerance,
            "Falloff": falloff,
        }

        self._establish_links(**key_args)


class DistanceKey(BaseNode):
    """
    Create matte based on 3D distance between colors

    Parameters
    ----------
    image : InputColor
        Image
    key_color : InputColor
        Key Color
    color_space : InputMenu | Literal['RGB', 'YCC']
        Color Space
    tolerance : InputFloat
        Tolerance
    falloff : InputFloat
        Falloff

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.key_color : ColorSocket
        Key Color
    i.color_space : MenuSocket
        Color Space
    i.tolerance : FloatSocket
        Tolerance
    i.falloff : FloatSocket
        Falloff

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    """

    _bl_idname = "CompositorNodeDistanceMatte"
    node: bpy.types.CompositorNodeDistanceMatte

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        key_color: ColorSocket
        """Key Color"""
        color_space: MenuSocket
        """Color Space"""
        tolerance: FloatSocket
        """Tolerance"""
        falloff: FloatSocket
        """Falloff"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        key_color: InputColor = None,
        color_space: InputMenu | Literal["RGB", "YCC"] = "RGB",
        tolerance: InputFloat = 0.1,
        falloff: InputFloat = 0.1,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Key Color": key_color,
            "Color Space": color_space,
            "Tolerance": tolerance,
            "Falloff": falloff,
        }

        self._establish_links(**key_args)


class DoubleEdgeMask(BaseNode):
    """
    Create a gradient between two masks

    Parameters
    ----------
    outer_mask : InputFloat
        Outer Mask
    inner_mask : InputFloat
        Inner Mask
    image_edges : InputBoolean
        Image Edges
    only_inside_outer : InputBoolean
        Only Inside Outer

    Inputs
    ------
    i.outer_mask : FloatSocket
        Outer Mask
    i.inner_mask : FloatSocket
        Inner Mask
    i.image_edges : BooleanSocket
        Image Edges
    i.only_inside_outer : BooleanSocket
        Only Inside Outer

    Outputs
    -------
    o.mask : FloatSocket
        Mask
    """

    _bl_idname = "CompositorNodeDoubleEdgeMask"
    node: bpy.types.CompositorNodeDoubleEdgeMask

    class _Inputs(SocketAccessor):
        outer_mask: FloatSocket
        """Outer Mask"""
        inner_mask: FloatSocket
        """Inner Mask"""
        image_edges: BooleanSocket
        """Image Edges"""
        only_inside_outer: BooleanSocket
        """Only Inside Outer"""

    class _Outputs(SocketAccessor):
        mask: FloatSocket
        """Mask"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        outer_mask: InputFloat = 0.8,
        inner_mask: InputFloat = 0.8,
        image_edges: InputBoolean = False,
        only_inside_outer: InputBoolean = False,
    ):
        super().__init__()
        key_args = {
            "Outer Mask": outer_mask,
            "Inner Mask": inner_mask,
            "Image Edges": image_edges,
            "Only Inside Outer": only_inside_outer,
        }

        self._establish_links(**key_args)


class EllipseMask(BaseNode):
    """
    Create elliptical mask suitable for use as a simple matte or vignette mask

    Parameters
    ----------
    operation : InputMenu | Literal['Add', 'Subtract', 'Multiply', 'Not']
        Operation
    mask : InputFloat
        Mask
    value : InputFloat
        Value
    position : InputVector
        Position
    size : InputVector
        Size
    rotation : InputFloat
        Rotation

    Inputs
    ------
    i.operation : MenuSocket
        Operation
    i.mask : FloatSocket
        Mask
    i.value : FloatSocket
        Value
    i.position : VectorSocket
        Position
    i.size : VectorSocket
        Size
    i.rotation : FloatSocket
        Rotation

    Outputs
    -------
    o.mask : FloatSocket
        Mask
    """

    _bl_idname = "CompositorNodeEllipseMask"
    node: bpy.types.CompositorNodeEllipseMask

    class _Inputs(SocketAccessor):
        operation: MenuSocket
        """Operation"""
        mask: FloatSocket
        """Mask"""
        value: FloatSocket
        """Value"""
        position: VectorSocket
        """Position"""
        size: VectorSocket
        """Size"""
        rotation: FloatSocket
        """Rotation"""

    class _Outputs(SocketAccessor):
        mask: FloatSocket
        """Mask"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        operation: InputMenu | Literal["Add", "Subtract", "Multiply", "Not"] = "Add",
        mask: InputFloat = 0.0,
        value: InputFloat = 1.0,
        position: InputVector = None,
        size: InputVector = None,
        rotation: InputFloat = 0.0,
    ):
        super().__init__()
        key_args = {
            "Operation": operation,
            "Mask": mask,
            "Value": value,
            "Position": position,
            "Size": size,
            "Rotation": rotation,
        }

        self._establish_links(**key_args)


class Keying(BaseNode):
    """
    Perform both chroma keying (to remove the backdrop) and despill (to correct color cast from the backdrop)

    Parameters
    ----------
    image : InputColor
        Image
    key_color : InputColor
        Key Color
    preprocess_blur_size : InputInteger
        Blur Size
    key_balance : InputFloat
        Balance
    black_level : InputFloat
        Black Level
    white_level : InputFloat
        White Level
    edge_search_size : InputInteger
        Size
    edge_tolerance : InputFloat
        Tolerance
    garbage_matte : InputFloat
        Garbage Matte
    core_matte : InputFloat
        Core Matte
    postprocess_blur_size : InputInteger
        Blur Size
    postprocess_dilate_size : InputInteger
        Dilate Size
    postprocess_feather_size : InputInteger
        Feather Size
    feather_falloff : InputMenu | Literal['Smooth', 'Sphere', 'Root', 'Inverse Square', 'Sharp', 'Linear']
        Feather Falloff
    despill_strength : InputFloat
        Strength
    despill_balance : InputFloat
        Balance

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.key_color : ColorSocket
        Key Color
    i.preprocess_blur_size : IntegerSocket
        Blur Size
    i.key_balance : FloatSocket
        Balance
    i.black_level : FloatSocket
        Black Level
    i.white_level : FloatSocket
        White Level
    i.edge_search_size : IntegerSocket
        Size
    i.edge_tolerance : FloatSocket
        Tolerance
    i.garbage_matte : FloatSocket
        Garbage Matte
    i.core_matte : FloatSocket
        Core Matte
    i.postprocess_blur_size : IntegerSocket
        Blur Size
    i.postprocess_dilate_size : IntegerSocket
        Dilate Size
    i.postprocess_feather_size : IntegerSocket
        Feather Size
    i.feather_falloff : MenuSocket
        Feather Falloff
    i.despill_strength : FloatSocket
        Strength
    i.despill_balance : FloatSocket
        Balance

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    o.edges : FloatSocket
        Edges
    """

    _bl_idname = "CompositorNodeKeying"
    node: bpy.types.CompositorNodeKeying

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        key_color: ColorSocket
        """Key Color"""
        preprocess_blur_size: IntegerSocket
        """Blur Size"""
        key_balance: FloatSocket
        """Balance"""
        black_level: FloatSocket
        """Black Level"""
        white_level: FloatSocket
        """White Level"""
        edge_search_size: IntegerSocket
        """Size"""
        edge_tolerance: FloatSocket
        """Tolerance"""
        garbage_matte: FloatSocket
        """Garbage Matte"""
        core_matte: FloatSocket
        """Core Matte"""
        postprocess_blur_size: IntegerSocket
        """Blur Size"""
        postprocess_dilate_size: IntegerSocket
        """Dilate Size"""
        postprocess_feather_size: IntegerSocket
        """Feather Size"""
        feather_falloff: MenuSocket
        """Feather Falloff"""
        despill_strength: FloatSocket
        """Strength"""
        despill_balance: FloatSocket
        """Balance"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""
        edges: FloatSocket
        """Edges"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        key_color: InputColor = None,
        preprocess_blur_size: InputInteger = 0,
        key_balance: InputFloat = 0.5,
        black_level: InputFloat = 0.0,
        white_level: InputFloat = 1.0,
        edge_search_size: InputInteger = 3,
        edge_tolerance: InputFloat = 0.1,
        garbage_matte: InputFloat = 0.0,
        core_matte: InputFloat = 0.0,
        postprocess_blur_size: InputInteger = 0,
        postprocess_dilate_size: InputInteger = 0,
        postprocess_feather_size: InputInteger = 0,
        feather_falloff: InputMenu
        | Literal[
            "Smooth", "Sphere", "Root", "Inverse Square", "Sharp", "Linear"
        ] = "Smooth",
        despill_strength: InputFloat = 1.0,
        despill_balance: InputFloat = 0.5,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Key Color": key_color,
            "Preprocess Blur Size": preprocess_blur_size,
            "Key Balance": key_balance,
            "Black Level": black_level,
            "White Level": white_level,
            "Edge Search Size": edge_search_size,
            "Edge Tolerance": edge_tolerance,
            "Garbage Matte": garbage_matte,
            "Core Matte": core_matte,
            "Postprocess Blur Size": postprocess_blur_size,
            "Postprocess Dilate Size": postprocess_dilate_size,
            "Postprocess Feather Size": postprocess_feather_size,
            "Feather Falloff": feather_falloff,
            "Despill Strength": despill_strength,
            "Despill Balance": despill_balance,
        }

        self._establish_links(**key_args)


class KeyingScreen(BaseNode):
    """
    Create plates for use as a color reference for keying nodes

    Parameters
    ----------
    smoothness : InputFloat
        Smoothness

    Inputs
    ------
    i.smoothness : FloatSocket
        Smoothness

    Outputs
    -------
    o.screen : ColorSocket
        Screen
    """

    _bl_idname = "CompositorNodeKeyingScreen"
    node: bpy.types.CompositorNodeKeyingScreen

    class _Inputs(SocketAccessor):
        smoothness: FloatSocket
        """Smoothness"""

    class _Outputs(SocketAccessor):
        screen: ColorSocket
        """Screen"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        smoothness: InputFloat = 0.0,
        *,
        tracking_object: str = "",
    ):
        super().__init__()
        key_args = {"Smoothness": smoothness}
        self.tracking_object = tracking_object
        self._establish_links(**key_args)

    @property
    def tracking_object(self) -> str:
        return self.node.tracking_object

    @tracking_object.setter
    def tracking_object(self, value: str):
        self.node.tracking_object = value


class LuminanceKey(BaseNode):
    """
    Create a matte based on luminance (brightness) difference

    Parameters
    ----------
    image : InputColor
        Image
    minimum : InputFloat
        Minimum
    maximum : InputFloat
        Maximum

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.minimum : FloatSocket
        Minimum
    i.maximum : FloatSocket
        Maximum

    Outputs
    -------
    o.image : ColorSocket
        Image
    o.matte : FloatSocket
        Matte
    """

    _bl_idname = "CompositorNodeLumaMatte"
    node: bpy.types.CompositorNodeLumaMatte

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        minimum: FloatSocket
        """Minimum"""
        maximum: FloatSocket
        """Maximum"""

    class _Outputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        matte: FloatSocket
        """Matte"""

    if TYPE_CHECKING:

        @property
        def i(self) -> _Inputs: ...
        @property
        def o(self) -> _Outputs: ...

    def __init__(
        self,
        image: InputColor = None,
        minimum: InputFloat = 0.0,
        maximum: InputFloat = 1.0,
    ):
        super().__init__()
        key_args = {"Image": image, "Minimum": minimum, "Maximum": maximum}

        self._establish_links(**key_args)
