# automatically generated by the FlatBuffers compiler, do not modify

# namespace: flatbuffers

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

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

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

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

    # Photo
    def Factor(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 1.0

    # Photo
    def Path(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def PhotoStart(builder): builder.StartObject(2)
def PhotoAddFactor(builder, factor): builder.PrependFloat32Slot(0, factor, 1.0)
def PhotoAddPath(builder, path): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(path), 0)
def PhotoEnd(builder): return builder.EndObject()
