Skip to content
Back to top
View this page

# BlobLayout

class dsviper.BlobLayout(data_type='uchar', components=1)

  Bases: `object`

  A class used to describe the layout of the element in a blob. data_type is ‘uchar’, ‘ushort’, ‘uint’, ‘ulong’, ‘char’, ‘short’, ‘int’, ‘long’, ‘half’, ‘float’ or ‘double’, and components is limited to 255. The default layout is ‘uchar-1’ (aka a BLOB).

  byte_count() → int

    Return the size of an element in bytes.

  components() → int

    Return the number of packed values in an element.

  data_type() → int

    Return the data type.

  data_type_byte_count() → int

    Return the size of the data type in bytes.

  data_type_representation() → str

    Return the data_type representation.

  static parse(representation: str) → BlobLayout

    Return a BlobLayout by parsing the string ‘<data_type>-<components>’ ex: ‘uchar-1’, ‘float-2’, ‘float-3’, ‘half-4’, ‘double-16’.

  representation() → str

    Return a string representation.