mini_arcade_core.runtime.capture.capture_worker

Capture worker thread for saving screenshots.

Classes

CaptureJob

Job representing a screenshot to be saved.

CaptureResult

Result of a completed capture job.

WorkerConfig

Configuration options for the CaptureWorker.

CaptureWorker

Capture worker thread for saving screenshots asynchronously.

Module Contents

class mini_arcade_core.runtime.capture.capture_worker.CaptureJob

Bases: mini_arcade_core.runtime.capture.base_worker.BaseJob

Job representing a screenshot to be saved.

Variables:
  • (str) (job_id) – Unique identifier for the capture job.

  • (Path) (bmp_path) – Destination path for the saved screenshot.

  • (Path) – Temporary path of the bitmap image to be saved.

out_path: pathlib.Path
bmp_path: pathlib.Path | None = None
w: int = 0
h: int = 0
pixels: bytes | None = None
fmt: str = 'BGRA'
pitch: int | None = None
class mini_arcade_core.runtime.capture.capture_worker.CaptureResult

Result of a completed capture job.

Variables:
  • (str) (job_id) – Unique identifier for the capture job.

  • (Path) (out_path) – Destination path where the screenshot was saved.

  • (bool) (ok) – Whether the capture was successful.

  • (Optional[str]) (error) – Error message if the capture failed.

job_id: str
out_path: pathlib.Path
ok: bool
error: str | None = None
class mini_arcade_core.runtime.capture.capture_worker.WorkerConfig

Configuration options for the CaptureWorker.

Variables:
  • (int) (queue_size) – Maximum number of jobs to queue.

  • None]]) (on_done (Optional[Callable[[CaptureResult],) – Optional callback invoked when a job is done.

  • (str) (name) – Name of the worker thread.

  • (bool) (delete_temp) – Whether the thread is a daemon thread.

  • (bool) – Whether to delete temporary bitmap files after saving.

queue_size: int = 64
on_done: Callable[[CaptureResult], None] | None = None
name: str = 'capture-worker'
daemon: bool = True
delete_temp: bool = True
class mini_arcade_core.runtime.capture.capture_worker.CaptureWorker(worker_config: WorkerConfig | None = None)

Bases: mini_arcade_core.runtime.capture.base_worker.BaseWorker

Capture worker thread for saving screenshots asynchronously.