class DataMatrix – DataMatrix object

The datamatrix object is returned by Image.find_datamatrices(). It is an attrtuple with 12 fields.

class image.datamatrix

Please call Image.find_datamatrices() to create this object. It has no public constructor.

x() int

Returns the datamatrix’s bounding box x coordinate (int).

You may also get this value doing [0] on the object.

y() int

Returns the datamatrix’s bounding box y coordinate (int).

You may also get this value doing [1] on the object.

w() int

Returns the datamatrix’s bounding box w coordinate (int).

You may also get this value doing [2] on the object.

h() int

Returns the datamatrix’s bounding box h coordinate (int).

You may also get this value doing [3] on the object.

payload() str

Returns the payload string of the datamatrix (str).

You may also get this value doing [4] on the object.

rotation() float

Returns the rotation of the datamatrix in radians (float).

You may also get this value doing [5] on the object.

rows() int

Returns the number of rows in the data matrix (int).

You may also get this value doing [6] on the object.

columns() int

Returns the number of columns in the data matrix (int).

You may also get this value doing [7] on the object.

capacity() int

Returns how many characters could fit in this data matrix (int).

You may also get this value doing [8] on the object.

padding() int

Returns how many unused characters are in this data matrix (int).

You may also get this value doing [9] on the object.

corners() Tuple[Tuple[int, int], Tuple[int, int], Tuple[int, int], Tuple[int, int]]

Returns a tuple of 4 (x, y) tuples of the 4 corners of the object. Corners are returned in sorted clock-wise order starting from the top left.

You may also get this value doing [10] on the object.

rect() Tuple[int, int, int, int]

Returns a rectangle tuple (x, y, w, h) of the datamatrix’s bounding box for use with other image methods like Image.draw_rectangle().

You may also get this value doing [11] on the object.