Skip to content

Replace pixel_search GetPixel with GetDIBits buffer scan #19

@mark-e-deyoung

Description

@mark-e-deyoung

Problem

pixel_search iterates pixel-by-pixel calling GetPixel() — a GDI round-trip per pixel. A full-screen 1920×1080 region = 2M GDI calls taking seconds.

Proposed Solution

Use GetDIBits to capture the entire region into a memory buffer (one GDI call), then scan the buffer in-memory. Trade-off: ~8MB memory for full-screen 32-bit capture, released immediately after search. Speedup: 100-1000× for large regions.

References

  • Performance audit item 5
  • core/src/win32_backend.cpp:439-458

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions