-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathICIfunctions.py
28 lines (22 loc) · 922 Bytes
/
ICIfunctions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# python 2.7
import ctypes
import os
# load the cpp functions from the .dll
# PROPRIETARY - DO NOT REDISTRIBUTE ICI.dll
os.chdir("lib")
lib = ctypes.WinDLL('ICI.dll')
os.chdir("../")
# define the C input/output ("arg"/"res") types (i.e. "ctypes") for each function used
sensReadings = lib.ImgGetSensorReadings
sensReadings.argtypes = [ctypes.POINTER(ctypes.c_long),
ctypes.POINTER(ctypes.c_float), ctypes.POINTER(ctypes.c_float)]
sensReadings.restype = ctypes.c_int
ImgLoad = lib.ImgLoad
ImgLoad.argtypes = [ctypes.c_char_p]
ImgLoad.restype = ctypes.POINTER(ctypes.c_long)
delImgHandle = lib.ImgDeleteHandle
ImgGetPixelTemperature = lib.ImgGetPixelTemperature
ImgGetPixelTemperature.argtypes = [ctypes.POINTER(ctypes.c_long),
ctypes.POINTER(ctypes.c_float),
ctypes.c_int,
ctypes.c_int]