scistag.shapestag.shape.Shape¶
- class Shape(class_name, hashable_properties)[source]¶
Bases:
objectDefines a shape which can be rendered
Initializer
- Parameters
Methods
Draws the shape into the defined canvas
A unique hash of the data in this shape.
Renders the shape to an image.
Attributes
HASHABLE_PROPERTIES__annotations____dataclass_fields____dataclass_params____dict____doc____hash____module____weakref__list of weak references to the object (if defined)
The region to be covered overall
The shape's class
- get_hash()[source]¶
A unique hash of the data in this shape. Is used to cache the shape’s renderings when it has not been modified.
- Return type
- Returns
The hash value
- to_image(background_color=Color(r=0.0, g=0.0, b=0.0, a=0.0, _rgba=(0.0, 0.0, 0.0, 0.0), _int_rgba=(0, 0, 0, 0)))[source]¶
Renders the shape to an image.
The shape needs to either specify it’s bounding or it’s size as member variable to be convertible.
- Parameters
background_color – The background color
- Return type
- bounding: Bounding2D = Bounding2D(0.0,0.0,0.0,0.0)¶
The region to be covered overall