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

from typing import TYPE_CHECKING, Literal

import bpy

from mathutils import Color

from ...builder import BaseNode, SocketAccessor

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

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


class AlphaOver(BaseNode):
    """
    Overlay a foreground image onto a background image

    Parameters
    ----------
    background : InputColor
        Background
    foreground : InputColor
        Foreground
    fac : InputFloat
        Factor
    type : InputMenu | Literal['Over', 'Disjoint Over', 'Conjoint Over']
        Type
    straight_alpha : InputBoolean
        Straight Alpha

    Inputs
    ------
    i.background : ColorSocket
        Background
    i.foreground : ColorSocket
        Foreground
    i.fac : FloatSocket
        Factor
    i.type : MenuSocket
        Type
    i.straight_alpha : BooleanSocket
        Straight Alpha

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

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

    class _Inputs(SocketAccessor):
        background: ColorSocket
        """Background"""
        foreground: ColorSocket
        """Foreground"""
        fac: FloatSocket
        """Factor"""
        type: MenuSocket
        """Type"""
        straight_alpha: BooleanSocket
        """Straight Alpha"""

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

    if TYPE_CHECKING:

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

    def __init__(
        self,
        background: InputColor = None,
        foreground: InputColor = None,
        fac: InputFloat = 1.0,
        type: InputMenu | Literal["Over", "Disjoint Over", "Conjoint Over"] = "Over",
        straight_alpha: InputBoolean = False,
    ):
        super().__init__()
        key_args = {
            "Background": background,
            "Foreground": foreground,
            "Fac": fac,
            "Type": type,
            "Straight Alpha": straight_alpha,
        }

        self._establish_links(**key_args)

    @classmethod
    def over(
        cls,
        background: InputColor = None,
        foreground: InputColor = None,
        fac: InputFloat = 1.0,
        straight_alpha: InputBoolean = False,
    ) -> "AlphaOver":
        """Create Alpha Over node with type 'Over'."""
        return cls(
            background=background,
            foreground=foreground,
            fac=fac,
            straight_alpha=straight_alpha,
            type="Over",
        )

    @classmethod
    def disjoint_over(
        cls,
        background: InputColor = None,
        foreground: InputColor = None,
        fac: InputFloat = 1.0,
        straight_alpha: InputBoolean = False,
    ) -> "AlphaOver":
        """Create Alpha Over node with type 'Disjoint Over'."""
        return cls(
            background=background,
            foreground=foreground,
            fac=fac,
            straight_alpha=straight_alpha,
            type="Disjoint Over",
        )

    @classmethod
    def conjoint_over(
        cls,
        background: InputColor = None,
        foreground: InputColor = None,
        fac: InputFloat = 1.0,
        straight_alpha: InputBoolean = False,
    ) -> "AlphaOver":
        """Create Alpha Over node with type 'Conjoint Over'."""
        return cls(
            background=background,
            foreground=foreground,
            fac=fac,
            straight_alpha=straight_alpha,
            type="Conjoint Over",
        )


class BrightnessContrast(BaseNode):
    """
    Adjust brightness and contrast

    Parameters
    ----------
    image : InputColor
        Image
    bright : InputFloat
        Brightness
    contrast : InputFloat
        Contrast

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.bright : FloatSocket
        Brightness
    i.contrast : FloatSocket
        Contrast

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        bright: FloatSocket
        """Brightness"""
        contrast: FloatSocket
        """Contrast"""

    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,
        bright: InputFloat = 0.0,
        contrast: InputFloat = 0.0,
    ):
        super().__init__()
        key_args = {"Image": image, "Bright": bright, "Contrast": contrast}

        self._establish_links(**key_args)


class ColorBalance(BaseNode):
    """
    Adjust color and values

    Parameters
    ----------
    image : InputColor
        Image
    fac : InputFloat
        Factor
    type : InputMenu | Literal['Lift/Gamma/Gain', 'Offset/Power/Slope (ASC-CDL)', 'White Point']
        Type
    base_lift : InputFloat
        Lift
    color_lift : InputColor
        Lift
    base_gamma : InputFloat
        Gamma
    color_gamma : InputColor
        Gamma
    base_gain : InputFloat
        Gain
    color_gain : InputColor
        Gain
    base_offset : InputFloat
        Offset
    color_offset : InputColor
        Offset
    base_power : InputFloat
        Power
    color_power : InputColor
        Power
    base_slope : InputFloat
        Slope
    color_slope : InputColor
        Slope
    input_temperature : InputFloat
        Temperature
    input_tint : InputFloat
        Tint
    output_temperature : InputFloat
        Temperature
    output_tint : InputFloat
        Tint

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.fac : FloatSocket
        Factor
    i.type : MenuSocket
        Type
    i.base_lift : FloatSocket
        Lift
    i.color_lift : ColorSocket
        Lift
    i.base_gamma : FloatSocket
        Gamma
    i.color_gamma : ColorSocket
        Gamma
    i.base_gain : FloatSocket
        Gain
    i.color_gain : ColorSocket
        Gain
    i.base_offset : FloatSocket
        Offset
    i.color_offset : ColorSocket
        Offset
    i.base_power : FloatSocket
        Power
    i.color_power : ColorSocket
        Power
    i.base_slope : FloatSocket
        Slope
    i.color_slope : ColorSocket
        Slope
    i.input_temperature : FloatSocket
        Temperature
    i.input_tint : FloatSocket
        Tint
    i.output_temperature : FloatSocket
        Temperature
    i.output_tint : FloatSocket
        Tint

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        fac: FloatSocket
        """Factor"""
        type: MenuSocket
        """Type"""
        base_lift: FloatSocket
        """Lift"""
        color_lift: ColorSocket
        """Lift"""
        base_gamma: FloatSocket
        """Gamma"""
        color_gamma: ColorSocket
        """Gamma"""
        base_gain: FloatSocket
        """Gain"""
        color_gain: ColorSocket
        """Gain"""
        base_offset: FloatSocket
        """Offset"""
        color_offset: ColorSocket
        """Offset"""
        base_power: FloatSocket
        """Power"""
        color_power: ColorSocket
        """Power"""
        base_slope: FloatSocket
        """Slope"""
        color_slope: ColorSocket
        """Slope"""
        input_temperature: FloatSocket
        """Temperature"""
        input_tint: FloatSocket
        """Tint"""
        output_temperature: FloatSocket
        """Temperature"""
        output_tint: FloatSocket
        """Tint"""

    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,
        type: InputMenu
        | Literal[
            "Lift/Gamma/Gain", "Offset/Power/Slope (ASC-CDL)", "White Point"
        ] = "Lift/Gamma/Gain",
        base_lift: InputFloat = 0.0,
        color_lift: InputColor = None,
        base_gamma: InputFloat = 1.0,
        color_gamma: InputColor = None,
        base_gain: InputFloat = 1.0,
        color_gain: InputColor = None,
        base_offset: InputFloat = 0.0,
        color_offset: InputColor = None,
        base_power: InputFloat = 1.0,
        color_power: InputColor = None,
        base_slope: InputFloat = 1.0,
        color_slope: InputColor = None,
        input_temperature: InputFloat = 6500.0,
        input_tint: InputFloat = 10.0,
        output_temperature: InputFloat = 6500.0,
        output_tint: InputFloat = 10.0,
        *,
        input_whitepoint: tuple[float, float, float] = (0.735, 0.735, 0.735),
        output_whitepoint: tuple[float, float, float] = (0.735, 0.735, 0.735),
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Fac": fac,
            "Type": type,
            "Base Lift": base_lift,
            "Color Lift": color_lift,
            "Base Gamma": base_gamma,
            "Color Gamma": color_gamma,
            "Base Gain": base_gain,
            "Color Gain": color_gain,
            "Base Offset": base_offset,
            "Color Offset": color_offset,
            "Base Power": base_power,
            "Color Power": color_power,
            "Base Slope": base_slope,
            "Color Slope": color_slope,
            "Input Temperature": input_temperature,
            "Input Tint": input_tint,
            "Output Temperature": output_temperature,
            "Output Tint": output_tint,
        }
        self.input_whitepoint = input_whitepoint
        self.output_whitepoint = output_whitepoint
        self._establish_links(**key_args)

    @classmethod
    def lift_gamma_gain(
        cls,
        image: InputColor = None,
        fac: InputFloat = 1.0,
        base_lift: InputFloat = 0.0,
        color_lift: InputColor = None,
        base_gamma: InputFloat = 1.0,
        color_gamma: InputColor = None,
        base_gain: InputFloat = 1.0,
        color_gain: InputColor = None,
    ) -> "ColorBalance":
        """Create Color Balance node with type 'Lift/Gamma/Gain'."""
        return cls(
            image=image,
            fac=fac,
            base_lift=base_lift,
            color_lift=color_lift,
            base_gamma=base_gamma,
            color_gamma=color_gamma,
            base_gain=base_gain,
            color_gain=color_gain,
            type="Lift/Gamma/Gain",
        )

    @classmethod
    def offset_power_slope_asc_cdl(
        cls,
        image: InputColor = None,
        fac: InputFloat = 1.0,
        base_offset: InputFloat = 0.0,
        color_offset: InputColor = None,
        base_power: InputFloat = 1.0,
        color_power: InputColor = None,
        base_slope: InputFloat = 1.0,
        color_slope: InputColor = None,
    ) -> "ColorBalance":
        """Create Color Balance node with type 'Offset/Power/Slope (ASC-CDL)'."""
        return cls(
            image=image,
            fac=fac,
            base_offset=base_offset,
            color_offset=color_offset,
            base_power=base_power,
            color_power=color_power,
            base_slope=base_slope,
            color_slope=color_slope,
            type="Offset/Power/Slope (ASC-CDL)",
        )

    @classmethod
    def white_point(
        cls,
        image: InputColor = None,
        fac: InputFloat = 1.0,
        input_temperature: InputFloat = 6500.0,
        input_tint: InputFloat = 10.0,
        output_temperature: InputFloat = 6500.0,
        output_tint: InputFloat = 10.0,
    ) -> "ColorBalance":
        """Create Color Balance node with type 'White Point'."""
        return cls(
            image=image,
            fac=fac,
            input_temperature=input_temperature,
            input_tint=input_tint,
            output_temperature=output_temperature,
            output_tint=output_tint,
            type="White Point",
        )

    @property
    def input_whitepoint(self) -> Color:
        return self.node.input_whitepoint

    @input_whitepoint.setter
    def input_whitepoint(self, value: Color | tuple[float, float, float]):
        self.node.input_whitepoint = value

    @property
    def output_whitepoint(self) -> Color:
        return self.node.output_whitepoint

    @output_whitepoint.setter
    def output_whitepoint(self, value: Color | tuple[float, float, float]):
        self.node.output_whitepoint = value


class ColorCorrection(BaseNode):
    """
    Adjust the color of an image, separately in several tonal ranges (highlights, midtones and shadows)

    Parameters
    ----------
    image : InputColor
        Image
    mask : InputFloat
        Mask
    master_saturation : InputFloat
        Saturation
    master_contrast : InputFloat
        Contrast
    master_gamma : InputFloat
        Gamma
    master_gain : InputFloat
        Gain
    master_offset : InputFloat
        Offset
    highlights_saturation : InputFloat
        Saturation
    highlights_contrast : InputFloat
        Contrast
    highlights_gamma : InputFloat
        Gamma
    highlights_gain : InputFloat
        Gain
    highlights_offset : InputFloat
        Offset
    midtones_saturation : InputFloat
        Saturation
    midtones_contrast : InputFloat
        Contrast
    midtones_gamma : InputFloat
        Gamma
    midtones_gain : InputFloat
        Gain
    midtones_offset : InputFloat
        Offset
    shadows_saturation : InputFloat
        Saturation
    shadows_contrast : InputFloat
        Contrast
    shadows_gamma : InputFloat
        Gamma
    shadows_gain : InputFloat
        Gain
    shadows_offset : InputFloat
        Offset
    midtones_start : InputFloat
        Midtones Start
    midtones_end : InputFloat
        Midtones End
    apply_on_red : InputBoolean
        Red
    apply_on_green : InputBoolean
        Green
    apply_on_blue : InputBoolean
        Blue

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.mask : FloatSocket
        Mask
    i.master_saturation : FloatSocket
        Saturation
    i.master_contrast : FloatSocket
        Contrast
    i.master_gamma : FloatSocket
        Gamma
    i.master_gain : FloatSocket
        Gain
    i.master_offset : FloatSocket
        Offset
    i.highlights_saturation : FloatSocket
        Saturation
    i.highlights_contrast : FloatSocket
        Contrast
    i.highlights_gamma : FloatSocket
        Gamma
    i.highlights_gain : FloatSocket
        Gain
    i.highlights_offset : FloatSocket
        Offset
    i.midtones_saturation : FloatSocket
        Saturation
    i.midtones_contrast : FloatSocket
        Contrast
    i.midtones_gamma : FloatSocket
        Gamma
    i.midtones_gain : FloatSocket
        Gain
    i.midtones_offset : FloatSocket
        Offset
    i.shadows_saturation : FloatSocket
        Saturation
    i.shadows_contrast : FloatSocket
        Contrast
    i.shadows_gamma : FloatSocket
        Gamma
    i.shadows_gain : FloatSocket
        Gain
    i.shadows_offset : FloatSocket
        Offset
    i.midtones_start : FloatSocket
        Midtones Start
    i.midtones_end : FloatSocket
        Midtones End
    i.apply_on_red : BooleanSocket
        Red
    i.apply_on_green : BooleanSocket
        Green
    i.apply_on_blue : BooleanSocket
        Blue

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        mask: FloatSocket
        """Mask"""
        master_saturation: FloatSocket
        """Saturation"""
        master_contrast: FloatSocket
        """Contrast"""
        master_gamma: FloatSocket
        """Gamma"""
        master_gain: FloatSocket
        """Gain"""
        master_offset: FloatSocket
        """Offset"""
        highlights_saturation: FloatSocket
        """Saturation"""
        highlights_contrast: FloatSocket
        """Contrast"""
        highlights_gamma: FloatSocket
        """Gamma"""
        highlights_gain: FloatSocket
        """Gain"""
        highlights_offset: FloatSocket
        """Offset"""
        midtones_saturation: FloatSocket
        """Saturation"""
        midtones_contrast: FloatSocket
        """Contrast"""
        midtones_gamma: FloatSocket
        """Gamma"""
        midtones_gain: FloatSocket
        """Gain"""
        midtones_offset: FloatSocket
        """Offset"""
        shadows_saturation: FloatSocket
        """Saturation"""
        shadows_contrast: FloatSocket
        """Contrast"""
        shadows_gamma: FloatSocket
        """Gamma"""
        shadows_gain: FloatSocket
        """Gain"""
        shadows_offset: FloatSocket
        """Offset"""
        midtones_start: FloatSocket
        """Midtones Start"""
        midtones_end: FloatSocket
        """Midtones End"""
        apply_on_red: BooleanSocket
        """Red"""
        apply_on_green: BooleanSocket
        """Green"""
        apply_on_blue: BooleanSocket
        """Blue"""

    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,
        mask: InputFloat = 1.0,
        master_saturation: InputFloat = 1.0,
        master_contrast: InputFloat = 1.0,
        master_gamma: InputFloat = 1.0,
        master_gain: InputFloat = 1.0,
        master_offset: InputFloat = 0.0,
        highlights_saturation: InputFloat = 1.0,
        highlights_contrast: InputFloat = 1.0,
        highlights_gamma: InputFloat = 1.0,
        highlights_gain: InputFloat = 1.0,
        highlights_offset: InputFloat = 0.0,
        midtones_saturation: InputFloat = 1.0,
        midtones_contrast: InputFloat = 1.0,
        midtones_gamma: InputFloat = 1.0,
        midtones_gain: InputFloat = 1.0,
        midtones_offset: InputFloat = 0.0,
        shadows_saturation: InputFloat = 1.0,
        shadows_contrast: InputFloat = 1.0,
        shadows_gamma: InputFloat = 1.0,
        shadows_gain: InputFloat = 1.0,
        shadows_offset: InputFloat = 0.0,
        midtones_start: InputFloat = 0.2,
        midtones_end: InputFloat = 0.7,
        apply_on_red: InputBoolean = True,
        apply_on_green: InputBoolean = True,
        apply_on_blue: InputBoolean = True,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Mask": mask,
            "Master Saturation": master_saturation,
            "Master Contrast": master_contrast,
            "Master Gamma": master_gamma,
            "Master Gain": master_gain,
            "Master Offset": master_offset,
            "Highlights Saturation": highlights_saturation,
            "Highlights Contrast": highlights_contrast,
            "Highlights Gamma": highlights_gamma,
            "Highlights Gain": highlights_gain,
            "Highlights Offset": highlights_offset,
            "Midtones Saturation": midtones_saturation,
            "Midtones Contrast": midtones_contrast,
            "Midtones Gamma": midtones_gamma,
            "Midtones Gain": midtones_gain,
            "Midtones Offset": midtones_offset,
            "Shadows Saturation": shadows_saturation,
            "Shadows Contrast": shadows_contrast,
            "Shadows Gamma": shadows_gamma,
            "Shadows Gain": shadows_gain,
            "Shadows Offset": shadows_offset,
            "Midtones Start": midtones_start,
            "Midtones End": midtones_end,
            "Apply On Red": apply_on_red,
            "Apply On Green": apply_on_green,
            "Apply On Blue": apply_on_blue,
        }

        self._establish_links(**key_args)


class DepthCombine(BaseNode):
    """
    Combine two images using depth maps

    Parameters
    ----------
    a : InputColor
        A
    depth_a : InputFloat
        Depth A
    b : InputColor
        B
    depth_b : InputFloat
        Depth B
    use_alpha : InputBoolean
        Use Alpha
    anti_alias : InputBoolean
        Anti-Alias

    Inputs
    ------
    i.a : ColorSocket
        A
    i.depth_a : FloatSocket
        Depth A
    i.b : ColorSocket
        B
    i.depth_b : FloatSocket
        Depth B
    i.use_alpha : BooleanSocket
        Use Alpha
    i.anti_alias : BooleanSocket
        Anti-Alias

    Outputs
    -------
    o.result : ColorSocket
        Result
    o.depth : FloatSocket
        Depth
    """

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

    class _Inputs(SocketAccessor):
        a: ColorSocket
        """A"""
        depth_a: FloatSocket
        """Depth A"""
        b: ColorSocket
        """B"""
        depth_b: FloatSocket
        """Depth B"""
        use_alpha: BooleanSocket
        """Use Alpha"""
        anti_alias: BooleanSocket
        """Anti-Alias"""

    class _Outputs(SocketAccessor):
        result: ColorSocket
        """Result"""
        depth: FloatSocket
        """Depth"""

    if TYPE_CHECKING:

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

    def __init__(
        self,
        a: InputColor = None,
        depth_a: InputFloat = 1.0,
        b: InputColor = None,
        depth_b: InputFloat = 1.0,
        use_alpha: InputBoolean = False,
        anti_alias: InputBoolean = True,
    ):
        super().__init__()
        key_args = {
            "A": a,
            "Depth A": depth_a,
            "B": b,
            "Depth B": depth_b,
            "Use Alpha": use_alpha,
            "Anti-Alias": anti_alias,
        }

        self._establish_links(**key_args)


class Exposure(BaseNode):
    """
    Adjust brightness using a camera exposure parameter

    Parameters
    ----------
    image : InputColor
        Image
    exposure : InputFloat
        Exposure

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.exposure : FloatSocket
        Exposure

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        exposure: FloatSocket
        """Exposure"""

    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,
        exposure: InputFloat = 0.0,
    ):
        super().__init__()
        key_args = {"Image": image, "Exposure": exposure}

        self._establish_links(**key_args)


class HueCorrect(BaseNode):
    """
    Adjust hue, saturation, and value with a curve

    Parameters
    ----------
    image : InputColor
        Image
    fac : InputFloat
        Factor

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.fac : FloatSocket
        Factor

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        fac: FloatSocket
        """Factor"""

    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,
    ):
        super().__init__()
        key_args = {"Image": image, "Fac": fac}

        self._establish_links(**key_args)


class HueSaturationValue(BaseNode):
    """
    Apply a color transformation in the HSV color model

    Parameters
    ----------
    image : InputColor
        Image
    hue : InputFloat
        Hue
    saturation : InputFloat
        Saturation
    value : InputFloat
        Value
    fac : InputFloat
        Factor

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.hue : FloatSocket
        Hue
    i.saturation : FloatSocket
        Saturation
    i.value : FloatSocket
        Value
    i.fac : FloatSocket
        Factor

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        hue: FloatSocket
        """Hue"""
        saturation: FloatSocket
        """Saturation"""
        value: FloatSocket
        """Value"""
        fac: FloatSocket
        """Factor"""

    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,
        hue: InputFloat = 0.5,
        saturation: InputFloat = 1.0,
        value: InputFloat = 1.0,
        fac: InputFloat = 1.0,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Hue": hue,
            "Saturation": saturation,
            "Value": value,
            "Fac": fac,
        }

        self._establish_links(**key_args)


class InvertColor(BaseNode):
    """
    Invert colors, producing a negative

    Parameters
    ----------
    color : InputColor
        Color
    fac : InputFloat
        Factor
    invert_color : InputBoolean
        Invert Color
    invert_alpha : InputBoolean
        Invert Alpha

    Inputs
    ------
    i.color : ColorSocket
        Color
    i.fac : FloatSocket
        Factor
    i.invert_color : BooleanSocket
        Invert Color
    i.invert_alpha : BooleanSocket
        Invert Alpha

    Outputs
    -------
    o.color : ColorSocket
        Color
    """

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

    class _Inputs(SocketAccessor):
        color: ColorSocket
        """Color"""
        fac: FloatSocket
        """Factor"""
        invert_color: BooleanSocket
        """Invert Color"""
        invert_alpha: BooleanSocket
        """Invert Alpha"""

    class _Outputs(SocketAccessor):
        color: ColorSocket
        """Color"""

    if TYPE_CHECKING:

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

    def __init__(
        self,
        color: InputColor = None,
        fac: InputFloat = 1.0,
        invert_color: InputBoolean = True,
        invert_alpha: InputBoolean = False,
    ):
        super().__init__()
        key_args = {
            "Color": color,
            "Fac": fac,
            "Invert Color": invert_color,
            "Invert Alpha": invert_alpha,
        }

        self._establish_links(**key_args)


class Posterize(BaseNode):
    """
    Reduce number of colors in an image, converting smooth gradients into sharp transitions

    Parameters
    ----------
    image : InputColor
        Image
    steps : InputFloat
        Steps

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.steps : FloatSocket
        Steps

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        steps: FloatSocket
        """Steps"""

    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,
        steps: InputFloat = 8.0,
    ):
        super().__init__()
        key_args = {"Image": image, "Steps": steps}

        self._establish_links(**key_args)


class RGBCurves(BaseNode):
    """
    Perform level adjustments on each color channel of an image

    Parameters
    ----------
    image : InputColor
        Image
    fac : InputFloat
        Factor
    black_level : InputColor
        Black Level
    white_level : InputColor
        White Level

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.fac : FloatSocket
        Factor
    i.black_level : ColorSocket
        Black Level
    i.white_level : ColorSocket
        White Level

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        fac: FloatSocket
        """Factor"""
        black_level: ColorSocket
        """Black Level"""
        white_level: ColorSocket
        """White Level"""

    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,
        black_level: InputColor = None,
        white_level: InputColor = None,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Fac": fac,
            "Black Level": black_level,
            "White Level": white_level,
        }

        self._establish_links(**key_args)


class Tonemap(BaseNode):
    """
    Map one set of colors to another in order to approximate the appearance of high dynamic range

    Parameters
    ----------
    image : InputColor
        Image
    type : InputMenu | Literal['R/D Photoreceptor', 'Rh Simple']
        Type
    key : InputFloat
        Key
    balance : InputFloat
        Balance
    gamma : InputFloat
        Gamma
    intensity : InputFloat
        Intensity
    contrast : InputFloat
        Contrast
    light_adaptation : InputFloat
        Light Adaptation
    chromatic_adaptation : InputFloat
        Chromatic Adaptation

    Inputs
    ------
    i.image : ColorSocket
        Image
    i.type : MenuSocket
        Type
    i.key : FloatSocket
        Key
    i.balance : FloatSocket
        Balance
    i.gamma : FloatSocket
        Gamma
    i.intensity : FloatSocket
        Intensity
    i.contrast : FloatSocket
        Contrast
    i.light_adaptation : FloatSocket
        Light Adaptation
    i.chromatic_adaptation : FloatSocket
        Chromatic Adaptation

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

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

    class _Inputs(SocketAccessor):
        image: ColorSocket
        """Image"""
        type: MenuSocket
        """Type"""
        key: FloatSocket
        """Key"""
        balance: FloatSocket
        """Balance"""
        gamma: FloatSocket
        """Gamma"""
        intensity: FloatSocket
        """Intensity"""
        contrast: FloatSocket
        """Contrast"""
        light_adaptation: FloatSocket
        """Light Adaptation"""
        chromatic_adaptation: FloatSocket
        """Chromatic Adaptation"""

    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,
        type: InputMenu
        | Literal["R/D Photoreceptor", "Rh Simple"] = "R/D Photoreceptor",
        key: InputFloat = 0.18,
        balance: InputFloat = 1.0,
        gamma: InputFloat = 1.0,
        intensity: InputFloat = 0.0,
        contrast: InputFloat = 0.0,
        light_adaptation: InputFloat = 0.0,
        chromatic_adaptation: InputFloat = 0.0,
    ):
        super().__init__()
        key_args = {
            "Image": image,
            "Type": type,
            "Key": key,
            "Balance": balance,
            "Gamma": gamma,
            "Intensity": intensity,
            "Contrast": contrast,
            "Light Adaptation": light_adaptation,
            "Chromatic Adaptation": chromatic_adaptation,
        }

        self._establish_links(**key_args)

    @classmethod
    def r_d_photoreceptor(
        cls,
        image: InputColor = None,
        intensity: InputFloat = 0.0,
        contrast: InputFloat = 0.0,
        light_adaptation: InputFloat = 0.0,
        chromatic_adaptation: InputFloat = 0.0,
    ) -> "Tonemap":
        """Create Tonemap node with type 'R/D Photoreceptor'."""
        return cls(
            image=image,
            intensity=intensity,
            contrast=contrast,
            light_adaptation=light_adaptation,
            chromatic_adaptation=chromatic_adaptation,
            type="R/D Photoreceptor",
        )

    @classmethod
    def rh_simple(
        cls,
        image: InputColor = None,
        key: InputFloat = 0.18,
        balance: InputFloat = 1.0,
        gamma: InputFloat = 1.0,
    ) -> "Tonemap":
        """Create Tonemap node with type 'Rh Simple'."""
        return cls(image=image, key=key, balance=balance, gamma=gamma, type="Rh Simple")
