python_vali.PySurfaceResizer

class python_vali.PySurfaceResizer

CUDA-accelerated Surface resizer.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: python_vali._python_vali.PySurfaceResizer, format: python_vali._python_vali.PixelFormat, gpu_id: int) -> None

    Constructor for PySurfaceResizer with format and GPU ID.

    Creates a new instance of PySurfaceResizer that will run on the specified GPU with the given pixel format. The CUDA stream will be automatically created and managed.

    param format:

    The pixel format to use for resizing operations

    type format:

    Pixel_Format

    param gpu_id:

    The ID of the GPU to use for resizing

    type gpu_id:

    int

    raises RuntimeError:

    If the specified GPU is not available

  2. __init__(self: python_vali._python_vali.PySurfaceResizer, format: python_vali._python_vali.PixelFormat, gpu_id: int, stream: int) -> None

    Constructor for PySurfaceResizer with format, GPU ID, and CUDA stream.

    Creates a new instance of PySurfaceResizer that will run on the specified GPU with the given pixel format using the provided CUDA stream.

    param format:

    The pixel format to use for resizing operations

    type format:

    Pixel_Format

    param gpu_id:

    The ID of the GPU to use for resizing

    type gpu_id:

    int

    param stream:

    The CUDA stream to use for resizing

    type stream:

    int

    raises RuntimeError:

    If the specified GPU is not available

Methods

Run(self, src, dst)

Resize input Surface synchronously.

RunAsync(self, src, dst)

Resize input Surface asynchronously.

__init__(*args, **kwargs)

Overloaded function.

Attributes

Stream

Get the CUDA stream associated with this instance.

Run(self: python_vali._python_vali.PySurfaceResizer, src: VPF::Surface, dst: VPF::Surface) tuple[bool, python_vali._python_vali.TaskExecInfo]

Resize input Surface synchronously.

Processes the input surface and stores the resized result in the output surface. This method blocks until the resize operation is complete. Both input and output surfaces must use the same pixel format that was specified when creating the resizer instance.

Parameters:
  • src (Surface) – Input surface to be resized

  • dst (Surface) – Output surface to store the resized result

Returns:

Tuple containing: - success (bool): True if resize was successful, False otherwise - info (TaskExecInfo): Detailed execution information

Return type:

tuple[bool, TaskExecInfo]

Raises:

RuntimeError – If the resize operation fails or if surface formats don’t match

RunAsync(self: python_vali._python_vali.PySurfaceResizer, src: VPF::Surface, dst: VPF::Surface) tuple[bool, python_vali._python_vali.TaskExecInfo]

Resize input Surface asynchronously.

Processes the input surface and stores the resized result in the output surface. This method returns immediately without waiting for the resize operation to complete. Both input and output surfaces must use the same pixel format that was specified when creating the resizer instance.

Parameters:
  • src (Surface) – Input surface to be resized

  • dst (Surface) – Output surface to store the resized result

Returns:

Tuple containing: - success (bool): True if resize was successful, False otherwise - info (TaskExecInfo): Detailed execution information

Return type:

tuple[bool, TaskExecInfo]

Raises:

RuntimeError – If the resize operation fails or if surface formats don’t match

property Stream

Get the CUDA stream associated with this instance.

Returns the handle to the CUDA stream used for resize processing.

Returns:

CUDA stream handle

Return type:

int