summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-08 01:38:39 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-08-08 01:42:06 +0300
commit138450c33f57ec49072cf29fbc10b42987b142f0 (patch)
tree8ec2c7374daccc0684903391f4b54bbf96964b15
parent3876d0f987400355c9865017662e03a7f999be4d (diff)
kmstest: Add additional geometry classes
Add Dist, Point and Size classes in addition to the Rect class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xtests/kmstest.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/kmstest.py b/tests/kmstest.py
index 0281c67..949bb20 100755
--- a/tests/kmstest.py
+++ b/tests/kmstest.py
@@ -205,6 +205,37 @@ class CRCReader(object):
return crcs
+class Dist(object):
+ def __init__(self, x, y):
+ self.x = x
+ self.y = y
+
+ def __repr__(self):
+ return "(%d,%d)" % (self.x, self.y)
+
+
+class Point(object):
+ def __init__(self, x, y):
+ self.x = x
+ self.y = y
+
+ def __repr__(self):
+ return "(%d,%d)" % (self.x, self.y)
+
+ def move(self, distance):
+ self.x += distance.x
+ self.y += distance.y
+
+
+class Size(object):
+ def __init__(self, width, height):
+ self.width = width
+ self.height = height
+
+ def __repr__(self):
+ return "%ux%u" % (self.width, self.height)
+
+
class Rect(object):
def __init__(self, left, top, width, height):
self.left = left