| import os | |
| from ctypes import * | |
| from numpy.ctypeslib import ndpointer | |
| libPath = os.path.abspath(os.path.dirname(__file__)) + '/lib/libopycardenv.so' | |
| opycardenv = cdll.LoadLibrary(libPath) | |
| libPath = os.path.abspath(os.path.dirname(__file__)) + '/lib/libopycard.so' | |
| opycard = cdll.LoadLibrary(libPath) | |
| getHWID = opycard.getHWID | |
| getHWID.argtypes = [] | |
| getHWID.restype = c_char_p | |
| setLicenseKey = opycard.setLicenseKey | |
| setLicenseKey.argtypes = [c_char_p] | |
| setLicenseKey.restype = c_int32 | |
| initSDK = opycard.initSDK | |
| initSDK.argtypes = [c_char_p] | |
| initSDK.restype = c_int32 | |
| processImage = opycard.processImage | |
| processImage.argtypes = [ndpointer(c_ubyte, flags='C_CONTIGUOUS'), c_int32, c_int32] | |
| processImage.restype = c_char_p | |