# This file is automatically generated by pyo3_stub_gen
# ruff: noqa: E501, F401, F403, F405
r"""
Image processing functions for CNC engraving applications.

Provides sRGB/linear color space conversions, RGBA-to-grayscale/binary conversions with alpha unpremultiplication, grayscale normalization with auto-levels, dithering algorithms (Floyd-Steinberg, Bayer, minimum run length) for converting grayscale images to binary output, and scanline rasterization for converting Ops scanlines into pixel buffers.
"""

import numpy
import numpy.typing
from raygeo import ops
from . import convert
from . import dither
from . import grayscale
from . import preprocess
from . import render
from . import scan
from . import srgb
from . import transparency
__all__ = [
    "convert",
    "dither",
    "grayscale",
    "preprocess",
    "rasterize_scanlines",
    "render",
    "scan",
    "srgb",
    "transparency",
]

def rasterize_scanlines(ops: ops.Ops, width_px: int, height_px: int, px_per_mm: tuple[float, float], origin_mm: tuple[float, float] = (0, 0)) -> numpy.typing.NDArray[numpy.uint8]:
    r"""
    Rasterize ScanLine commands from *ops* into a 2D power-map buffer.
    
    Iterates all scanline commands in *ops*, converts their mm coordinates
    to pixel space using *px_per_mm*, and returns a uint8 array where each
    pixel holds the maximum power value written to it.
    
    :param ops: Command sequence to rasterize.
    :param width_px: Width of the output texture in pixels.
    :param height_px: Height of the output texture in pixels.
    :param px_per_mm: (x, y) resolution in pixels per millimeter.
    :param origin_mm: (x, y) origin offset in mm (default ``(0.0, 0.0)``).
    :returns: 2D uint8 array of shape (height_px, width_px).
    :complexity: O(scanline_pixels)
    """

