# automatically generated by the FlatBuffers compiler, do not modify

# namespace: API

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class IDFDescriptor(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAsIDFDescriptor(cls, buf, offset):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = IDFDescriptor()
        x.Init(buf, n + offset)
        return x

    # IDFDescriptor
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # IDFDescriptor
    def Uri(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # IDFDescriptor
    def Resolution(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

    # IDFDescriptor
    def XArity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

    # IDFDescriptor
    def YArity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

    # IDFDescriptor
    def Shape(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from SEAScope.API.Shape import Shape
            obj = Shape()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # IDFDescriptor
    def SubsamplingFactor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

def IDFDescriptorStart(builder): builder.StartObject(6)
def IDFDescriptorAddUri(builder, uri): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(uri), 0)
def IDFDescriptorAddResolution(builder, resolution): builder.PrependFloat32Slot(1, resolution, 0.0)
def IDFDescriptorAddXArity(builder, xArity): builder.PrependUint32Slot(2, xArity, 0)
def IDFDescriptorAddYArity(builder, yArity): builder.PrependUint32Slot(3, yArity, 0)
def IDFDescriptorAddShape(builder, shape): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(shape), 0)
def IDFDescriptorAddSubsamplingFactor(builder, subsamplingFactor): builder.PrependUint32Slot(5, subsamplingFactor, 0)
def IDFDescriptorEnd(builder): return builder.EndObject()
