1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-11 20:05:03 -05:00
Simba/Projects/MMLLib/pymml/mmlcolor.py

31 lines
740 B
Python
Raw Normal View History

2010-05-31 19:59:48 -04:00
from ctypes import *
from mmltypes import isiterable
from mmltypes import POINT, PPOINT, PINTEGER
class ColorException(Exception):
def __init__(self, err):
Exception.__init__(self, err)
# FIXME: Complete...
class Color(object):
'''
The Color class.
'''
_mc = None
def __init__(self, MC):
self._mc = MC
self._initialiseDLLFuncs()
def find(self, box, color):
x, y = (c_int(-1), c_int(-1))
self._mc.dll.findColor(byref(x), byref(y), color, *box)
return (x, y)
def _initialiseDLLFuncs(self):
2010-05-31 20:03:25 -04:00
self._mc.dll.findColor.restype = c_int
2010-05-31 19:59:48 -04:00
self._mc.dll.findColor.argtypes = [PINTEGER, PINTEGER, c_int, c_int,
c_int, c_int, c_int]