简体   繁体   中英

CUDA how to get pixels from screen?

Good afternoon. I found this article, but it shows how to take pixels from the image that is in the folder. Is it possible to take pixels straight from the desktop?

How to get image pixel value and image height and width in CUDA C?

It's not possible to use CUDA to get pixels from the screen/desktop/application window. You would have to use some sort of graphics API, like some X extension or DirectX (or OpenGL if the window you are working on is under control of OpenGL).

Once you have acquired the pixels via your graphics API, you can pass that to CUDA using CUDA/Graphics interop .

There are many resources for screen capture. Here is one example. There are many others.

One possible suggestion is to use NVIDIA capture SDK . However this is not formally part of CUDA. It is one possible method to get the screen pixels into a resource accessible to CUDA. (And, the functionality is deprecated on Windows.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM