# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

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

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

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

    @classmethod
    def GetRootAsInterp(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # Interp
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

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

    # Interp
    def HeightScale(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

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

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

    # Interp
    def ResizeType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # Interp
    def AlignCorners(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # Interp
    def HalfPixelCenters(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

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

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

    # Interp
    def CubicCoeffA(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return -0.75

    # Interp
    def Ctm(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int8Flags, o + self._tab.Pos)
        return 0

    # Interp
    def InterpSuperacme(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = InterpSuperAcmeQuantizedParam()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def InterpStart(builder): builder.StartObject(12)
def Start(builder):
    return InterpStart(builder)
def InterpAddWidthScale(builder, widthScale): builder.PrependFloat32Slot(0, widthScale, 0.0)
def AddWidthScale(builder, widthScale):
    return InterpAddWidthScale(builder, widthScale)
def InterpAddHeightScale(builder, heightScale): builder.PrependFloat32Slot(1, heightScale, 0.0)
def AddHeightScale(builder, heightScale):
    return InterpAddHeightScale(builder, heightScale)
def InterpAddOutputWidth(builder, outputWidth): builder.PrependInt32Slot(2, outputWidth, 0)
def AddOutputWidth(builder, outputWidth):
    return InterpAddOutputWidth(builder, outputWidth)
def InterpAddOutputHeight(builder, outputHeight): builder.PrependInt32Slot(3, outputHeight, 0)
def AddOutputHeight(builder, outputHeight):
    return InterpAddOutputHeight(builder, outputHeight)
def InterpAddResizeType(builder, resizeType): builder.PrependInt32Slot(4, resizeType, 0)
def AddResizeType(builder, resizeType):
    return InterpAddResizeType(builder, resizeType)
def InterpAddAlignCorners(builder, alignCorners): builder.PrependBoolSlot(5, alignCorners, 0)
def AddAlignCorners(builder, alignCorners):
    return InterpAddAlignCorners(builder, alignCorners)
def InterpAddHalfPixelCenters(builder, halfPixelCenters): builder.PrependBoolSlot(6, halfPixelCenters, 0)
def AddHalfPixelCenters(builder, halfPixelCenters):
    return InterpAddHalfPixelCenters(builder, halfPixelCenters)
def InterpAddWidthOffset(builder, widthOffset): builder.PrependFloat32Slot(7, widthOffset, 0.0)
def AddWidthOffset(builder, widthOffset):
    return InterpAddWidthOffset(builder, widthOffset)
def InterpAddHeightOffset(builder, heightOffset): builder.PrependFloat32Slot(8, heightOffset, 0.0)
def AddHeightOffset(builder, heightOffset):
    return InterpAddHeightOffset(builder, heightOffset)
def InterpAddCubicCoeffA(builder, cubicCoeffA): builder.PrependFloat32Slot(9, cubicCoeffA, -0.75)
def AddCubicCoeffA(builder, cubicCoeffA):
    return InterpAddCubicCoeffA(builder, cubicCoeffA)
def InterpAddCtm(builder, ctm): builder.PrependInt8Slot(10, ctm, 0)
def AddCtm(builder, ctm):
    return InterpAddCtm(builder, ctm)
def InterpAddInterpSuperacme(builder, interpSuperacme): builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(interpSuperacme), 0)
def AddInterpSuperacme(builder, interpSuperacme):
    return InterpAddInterpSuperacme(builder, interpSuperacme)
def InterpEnd(builder): return builder.EndObject()
def End(builder):
    return InterpEnd(builder)