# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405

import numpy
import numpy.typing
__all__ = [
    "apply_bayer_dither",
    "apply_floyd_steinberg_dither",
    "apply_minimum_run_length",
]

def apply_bayer_dither(grayscale: numpy.typing.NDArray[numpy.uint8], bayer_matrix: numpy.typing.NDArray[numpy.float32], invert: bool, cell_size: int = 1) -> numpy.typing.NDArray[numpy.uint8]:
    r"""
    Apply ordered (Bayer) dithering using a threshold matrix.
    
    :param grayscale: 2D grayscale image as uint8 array.
    :param bayer_matrix: 2D Bayer threshold matrix as float32.
    :param invert: If True, invert the output.
    :param cell_size: Pixel grouping size for the threshold.
    :returns: 2D binary uint8 array (values 0 or 1).
    :complexity: O(w*h)
    """

def apply_floyd_steinberg_dither(grayscale: numpy.typing.NDArray[numpy.uint8], invert: bool) -> numpy.typing.NDArray[numpy.uint8]:
    r"""
    Apply Floyd-Steinberg error-diffusion dithering.
    
    :param grayscale: 2D grayscale image as uint8 array.
    :param invert: If True, invert the output (swap black/white).
    :returns: 2D binary uint8 array (values 0 or 1).
    :complexity: O(w*h)
    """

def apply_minimum_run_length(binary: numpy.typing.NDArray[numpy.uint8], min_run_length: int) -> numpy.typing.NDArray[numpy.uint8]:
    r"""
    Remove binary runs shorter than the given minimum.
    
    :param binary: 2D binary uint8 array (values 0 or 1).
    :param min_run_length: Minimum run length to keep.
    :returns: 2D binary uint8 array with short runs removed.
    :complexity: O(w*h)
    """

