MCPcopy
hub / github.com/microsoft/Magma / draw_marks

Function draw_marks

data/utils/som_tom.py:23–26  ·  view source on GitHub ↗
(draw, points, text_size, id, font_size)

Source from the content-addressed store, hash-verified

21 return [x1-4, y1-4, x2+4, y2+4]
22
23 def draw_marks(draw, points, text_size, id, font_size):
24 txt = str(id)
25 draw.ellipse(((points[0]-max(text_size)//2-1, points[1]-max(text_size)//2-1, points[0]+max(text_size)//2+1, points[1]+max(text_size)//2+1)), fill='red')
26 draw.text((points[0]-text_size[0] // 2, points[1]-text_size[1] // 2-3), txt, fill='white', font=font_size)
27
28 fontsize = 1
29 font = ImageFont.truetype("data/utils/arial.ttf", fontsize)

Callers 2

som_promptingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected