![]() |
IOLink Python 1.11.0
|
Public Member Functions | |
| __init__ (self, *args) | |
| is_numeric (self) | |
| is_scalar (self) | |
| is_vector (self) | |
| is_convertible_to (self, other) | |
| get_id (self) | |
| get_bit_depth (self) | |
| get_element_count (self) | |
| bit_count (self) | |
| byte_count (self) | |
| to_string (self) | |
| __eq__ (self, other) | |
| __ne__ (self, other) | |
| __eq__ (self, other) | |
| __ne__ (self, id) | |
| get_primitive_type (self) | |
| get_interpretation (self) | |
| __repr__ (self) | |
Static Public Member Functions | |
| extract_scalar_type (dtype) | |
| standard_range (dtype) | |
Protected Member Functions | |
| _get_primitive_type (self) | |
| _get_interpretation (self) | |
Properties | |
| thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
| id = property(get_id, doc=get_id.__doc__) | |
| bit_depth = property(get_bit_depth, doc=get_bit_depth.__doc__) | |
| element_count = property(get_element_count, doc=get_element_count.__doc__) | |
| primitive_type = property(get_primitive_type, doc=_get_primitive_type.__doc__) | |
| interpretation = property(get_interpretation, doc=_get_interpretation.__doc__) | |
Stores information about a data type. DataType is associated with an ID, with wich the type can be uniquely identified. Although this ID is composed of multiple fields: - ScalarType: base type of each component. - BitDepth: bit depth for each component. - Dimension: the number of components. - Interpretation: What the DataType represents in particular. See [user guide](md_user_guide_docs_howto.html#data_type) for more explainations. These fields can have different meaning bases on the scalar type or the flags. For example the bitDepth field indicate the precision for integer and floating point types, and the size of a coding point in an unicode string.
| iolink.iolink.DataType.__init__ | ( | self, | |
| * | args | ||
| ) |
*Overload 1:*
Default constructor, creating an opaque type.
See also: DataTypeId::UNKNOWN
|
*Overload 2:*
Build a DataType from an id.
|
*Overload 3:*
Build a DataType from a DataTypeId.
|
*Overload 4:*
Build a DataType from its properties.
|
*Overload 5:*
Build a DataType from its properties.
|
protected |
The DataType interpretation.
See also: DataTypeInterpretation
|
protected |
Return the primitive type of the current type.
for example: UINT8 => UNSIGNED_INTEGER
| iolink.iolink.DataType.bit_count | ( | self | ) |
Get the number of bits required to store the type.
| iolink.iolink.DataType.byte_count | ( | self | ) |
Get the number of bits required to store the type.
If the number of bits required to store the type is not aligned to a byte,
the number of byte will be rounded up. For example, a 12 bits integer type
will have a byte count of 2.
|
static |
Return scalar type in case of multi dimensionnal DataType.
If the type is already scalar, it return itself.
| iolink.iolink.DataType.get_bit_depth | ( | self | ) |
Return the bit depth of this type. (i.e. UINT8 => 8 bit depth, VEC3_UINT16 => 16 bit depth)
| iolink.iolink.DataType.get_element_count | ( | self | ) |
Return the number of sub-values included in this type.
For example:
- UINT8 => dimension 1
- VEC3_UINT8 => dimension 3 because it contains three UINT8
| iolink.iolink.DataType.get_id | ( | self | ) |
Return unique id representing this datatype. Can be used inside a
switch/case statement.
| iolink.iolink.DataType.is_convertible_to | ( | self, | |
| other | |||
| ) |
Checks if this type is trivially convertible to another.
See also: DataConverter
| iolink.iolink.DataType.is_numeric | ( | self | ) |
Checks if the type is a mathematical one.
| iolink.iolink.DataType.is_scalar | ( | self | ) |
Checks if the type is a scalar numeric value.
| iolink.iolink.DataType.is_vector | ( | self | ) |
Checks if the type is a vector of numeric values.
|
static |
Return conventional range for given DataType.
By convention, range for INTEGER types are classical min and max representable values.
Range for FLOATING_POINT type is [0, 1]
As returned range is DOUBLE precison, returned value is imprecise for INT64 and UINT64 type.
:raises: Error If no range can be computed for this type.
| iolink.iolink.DataType.to_string | ( | self | ) |
Return a readable version of the DataType.