How to serve a screen image as a program entry in Haskell

I would like to write a function (I use Haskell) that can display the actual contents of the screen, if you look at the user, to pre-develop (granulate and / or some screen convolution through the repa package) and feed it into a neural network or other AI architecture.

The type will look like watch :: IO img Is there a library that provides such functions? And if I need not the whole screen, but only the visual output of the program, is there any other way than manually cutting the image?

+4
source share
2 answers

Screen capture is platform dependent. And you need to find the C library that will do this, and then write the Haskell binding to this low-level functionality. On some systems, you can open the frame buffer as a file, how to capture an image.

So the answer is the same as for C , but you are writing a binding from Haskell to this function.

+5
source

Maybe you can see the scrot source code

0
source

All Articles