savant_rs.draw_spec

class savant_rs.draw_spec.BoundingBoxDraw(border_color=Ellipsis, background_color=Ellipsis, thickness=2, padding=Ellipsis)

Represents the draw specification for a bounding box.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

background_color

Returns the background color of the bounding box

border_color

Returns the border color of the bounding box

Returns:

The ColorDraw object

from savant_rs.draw_spec import ColorDraw, PaddingDraw, BoundingBoxDraw
border_color = ColorDraw(255, 255, 255, 255)
background_color = ColorDraw(0, 0, 0, 0)
box = BoundingBoxDraw(border_color, background_color, 1, PaddingDraw(1, 2, 3, 4))
border_color = box.border_color
copy()

Returns a copy of the bounding box

padding

Returns the padding of the bounding box

thickness

Returns the thickness of the bounding box

class savant_rs.draw_spec.ColorDraw(red=0, green=255, blue=0, alpha=255)

Represents the draw specification for a color.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

Constructor arguments:

red (int): red component, default 0 green (int): green component, default 255 blue (int): blue component, default 0 alpha (int): alpha component, default 255

Returns:

The color object

from savant_rs.draw_spec import ColorDraw
color = ColorDraw(1, 2, 3, 4)
alpha

The alpha component of the color (int)

bgra

The color as a BGRA tuple

Returns:

(blue, green, red, alpha)

blue

The blue component of the color (int)

copy()

Returns a copy of the color

green

The green component of the color (int)

red

The red component of the color (int)

rgba

The color as a RGBA tuple

Returns:

(red, green, blue, alpha)

static transparent()

Creates a new transparent color

Returns:

The color object

from savant_rs.draw_spec import ColorDraw
color = ColorDraw.transparent()
class savant_rs.draw_spec.DotDraw(color, radius=2)

Represents the draw specification for a central body bullet visualization.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

color

Returns the color of the central body

copy()

Returns a copy of the central body

radius

Returns the radius of the central body

class savant_rs.draw_spec.LabelDraw(font_color, background_color=Ellipsis, border_color=Ellipsis, font_scale=1.0, thickness=1, position=Ellipsis, padding=Ellipsis, format=Ellipsis)

Represents the draw specification for a label.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

background_color

Returns the background color

border_color

Returns the border color

copy()

Returns a copy of the label draw specification

font_color

Returns the label font color

font_scale

Returns the font cloud

format

Returns the label formatted strings

padding
position
thickness

Returns the thickness

class savant_rs.draw_spec.LabelPosition(position=Ellipsis, margin_x=0, margin_y=Ellipsis)

Represents the draw specification for a position of a label versus object bounding box.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

copy()

Returns a copy of the label position

static default_position()

Returns the default label position specification

margin_x

Returns the margin of the label

margin_y

Returns the margin of the label

position

Returns the position of the label

class savant_rs.draw_spec.LabelPositionKind

Represents the draw specification for a position of a label versus object bounding box.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

Center = LabelPositionKind.Center
TopLeftInside = LabelPositionKind.TopLeftInside
TopLeftOutside = LabelPositionKind.TopLeftOutside
class savant_rs.draw_spec.ObjectDraw(bounding_box=None, central_dot=None, label=None, blur=False)

Represents the draw specification for an object.

blur

Returns blur specification

bounding_box

Returns the bounding box draw specification

central_dot

Returns the central dot draw specification

copy()

Returns a copy of the object draw specification

label

Returns the label draw specification

class savant_rs.draw_spec.PaddingDraw(left=0, top=0, right=0, bottom=0)

Defines the padding for a draw operation.

The object is read-only after creation in Python. You may construct it, make a copy or get properties. There is no way to update properties inplace. Fields are not available in Python, use getters.

Constructor arguments:

left (int): left padding, default 0 top (int): top padding, default 0 right (int): right padding, default 0 bottom (int): bottom padding, default 0

Returns:

The padding object

from savant_rs.draw_spec import PaddingDraw
padding = PaddingDraw(1, 2, 3, 4)
bottom

Returns the bottom padding (int)

copy()

Returns a copy of the padding object

Returns:

The padding object

from savant_rs.draw_spec import PaddingDraw
padding = PaddingDraw(1, 2, 3, 4)
padding_copy = padding.copy()
static default_padding()

Creates a new padding object with all fields set to 0

Returns:

The padding object

from savant_rs.draw_spec import PaddingDraw
padding = PaddingDraw.default_padding()
left

Returns the left padding (int)

padding

Returns the padding as a tuple

Returns:

(left, top, right, bottom)

right

Returns the right padding (int)

top

Returns the top padding (int)

class savant_rs.draw_spec.SetDrawLabelKind
get_label()
is_own_label()
is_parent_label()
static own(label)
static parent(label)