# automatically generated by the FlatBuffers compiler, do not modify

# namespace: foxglove

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

# A circle annotation on a 2D image
class CircleAnnotation(object):
    __slots__ = ['_tab']

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

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

    # Timestamp of circle
    # CircleAnnotation
    def Timestamp(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from .Time import Time
            obj = Time()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Center of the circle in 2D image coordinates (pixels).
    # The coordinate uses the top-left corner of the top-left pixel of the image as the origin.
    # CircleAnnotation
    def Position(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Point2 import Point2
            obj = Point2()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Circle diameter in pixels
    # CircleAnnotation
    def Diameter(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Line thickness in pixels
    # CircleAnnotation
    def Thickness(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # Fill color
    # CircleAnnotation
    def FillColor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Color import Color
            obj = Color()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Outline color
    # CircleAnnotation
    def OutlineColor(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Color import Color
            obj = Color()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def CircleAnnotationStart(builder): builder.StartObject(6)
def Start(builder):
    return CircleAnnotationStart(builder)
def CircleAnnotationAddTimestamp(builder, timestamp): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(timestamp), 0)
def AddTimestamp(builder, timestamp):
    return CircleAnnotationAddTimestamp(builder, timestamp)
def CircleAnnotationAddPosition(builder, position): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(position), 0)
def AddPosition(builder, position):
    return CircleAnnotationAddPosition(builder, position)
def CircleAnnotationAddDiameter(builder, diameter): builder.PrependFloat64Slot(2, diameter, 0.0)
def AddDiameter(builder, diameter):
    return CircleAnnotationAddDiameter(builder, diameter)
def CircleAnnotationAddThickness(builder, thickness): builder.PrependFloat64Slot(3, thickness, 0.0)
def AddThickness(builder, thickness):
    return CircleAnnotationAddThickness(builder, thickness)
def CircleAnnotationAddFillColor(builder, fillColor): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(fillColor), 0)
def AddFillColor(builder, fillColor):
    return CircleAnnotationAddFillColor(builder, fillColor)
def CircleAnnotationAddOutlineColor(builder, outlineColor): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(outlineColor), 0)
def AddOutlineColor(builder, outlineColor):
    return CircleAnnotationAddOutlineColor(builder, outlineColor)
def CircleAnnotationEnd(builder): return builder.EndObject()
def End(builder):
    return CircleAnnotationEnd(builder)