MCPcopy Create free account
hub / github.com/Image-Py/imagepy / cross

Function cross

imagepy/ui/canvas.py:19–23  ·  view source on GitHub ↗
(r1, r2)

Source from the content-addressed store, hash-verified

17if sys.version_info[0]==2:memoryview=np.getbuffer
18
19def cross(r1, r2):
20 x,y = max(r1[0], r2[0]),max(r1[1], r2[1])
21 w = min(r1[0]+r1[2], r2[0]+r2[2])-x
22 h = min(r1[1]+r1[3], r2[1]+r2[3])-y
23 return [x, y, w, h]
24
25def multiply(r, kx, ky):
26 r = [r[0]*kx, r[1]*ky, r[2]*kx, r[3]*ky]

Callers 1

draw_imageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected