Guest User

Untitled

a guest
Dec 25th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #!/usr/bin/python3
  2. import ctypes
  3. import os
  4. import time
  5. from PIL import Image
  6.  
  7. #from libsoul import stem
  8.  
  9. soFile = ctypes.CDLL('/home/scratch/mp3/get_screen.so')
  10.  
  11. def getScreen(disp,ox,oy,lx,ly):
  12.   size = lx * ly
  13.   objlength = size * 3
  14.  
  15.   soFile.get_screen.argtypes = []
  16.   result = (ctypes.c_ubyte*objlength)()
  17.  
  18.   soFile.get_screen(disp, ox, oy, lx, ly, result)
  19.   return Image.frombuffer('RGB', (lx, ly), result, 'raw', 'RGB', 0, 1)
Add Comment
Please, Sign In to add comment