| IOLink Python 1.11.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
iolink.iolink.DataType Class Reference
Inheritance diagram for iolink.iolink.DataType:

## 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__)

## Detailed Description

    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.

## Constructor & Destructor Documentation

## ◆ __init__()

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.

## Member Function Documentation

## ◆ _get_interpretation()

iolink.iolink.DataType._get_interpretation | ( |  | self | ) |
| protected

        The DataType interpretation.

        See also: DataTypeInterpretation

## ◆ _get_primitive_type()

iolink.iolink.DataType._get_primitive_type | ( |  | self | ) |
| protected

        Return the primitive type of the current type.

        for example: UINT8 => UNSIGNED_INTEGER

## ◆ bit_count()

iolink.iolink.DataType.bit_count | ( |  | self | ) |

    Get the number of bits required to store the type.

## ◆ byte_count()

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.

## ◆ extract_scalar_type()

iolink.iolink.DataType.extract_scalar_type | ( |  | dtype | ) |
| static

        Return scalar type in case of multi dimensionnal DataType.

        If the type is already scalar, it return itself.

## ◆ get_bit_depth()

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)

## ◆ get_element_count()

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

## ◆ get_id()

iolink.iolink.DataType.get_id | ( |  | self | ) |

        Return unique id representing this datatype. Can be used inside a
        switch/case statement.

## ◆ is_convertible_to()

iolink.iolink.DataType.is_convertible_to | ( |  | self,
|  |  | other
| ) |  |

        Checks if this type is trivially convertible to another.

        See also: DataConverter

## ◆ is_numeric()

iolink.iolink.DataType.is_numeric | ( |  | self | ) |

    Checks if the type is a mathematical one.

## ◆ is_scalar()

iolink.iolink.DataType.is_scalar | ( |  | self | ) |

    Checks if the type is a scalar numeric value.

## ◆ is_vector()

iolink.iolink.DataType.is_vector | ( |  | self | ) |

    Checks if the type is a vector of numeric values.

## ◆ standard_range()

iolink.iolink.DataType.standard_range | ( |  | dtype | ) |
| 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.

## ◆ to_string()

iolink.iolink.DataType.to_string | ( |  | self | ) |

    Return a readable version of the DataType.

The documentation for this class was generated from the following file:

- Release/python/iolink/iolink.py