# automatically generated by the FlatBuffers compiler, do not modify

# namespace: Dim

import flatbuffers

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

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

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

    # RGBTripleArray
    def R(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .UByteArray import UByteArray
            obj = UByteArray()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # RGBTripleArray
    def G(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .UByteArray import UByteArray
            obj = UByteArray()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # RGBTripleArray
    def B(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .UByteArray import UByteArray
            obj = UByteArray()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def RGBTripleArrayStart(builder): builder.StartObject(3)
def RGBTripleArrayAddR(builder, r): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(r), 0)
def RGBTripleArrayAddG(builder, g): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(g), 0)
def RGBTripleArrayAddB(builder, b): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(b), 0)
def RGBTripleArrayEnd(builder): return builder.EndObject()
