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

Function my_transform

imagepy/ui/canvas.py:44–51  ·  view source on GitHub ↗
(img, m, offset=(0,0), output=None, k=0.5, clip=False)

Source from the content-addressed store, hash-verified

42
43@jit
44def my_transform(img, m, offset=(0,0), output=None, k=0.5, clip=False):
45 kr=m[0]; kc=m[1]; ofr=offset[0]; ofc=offset[1];
46 for r in range(output.shape[0]):
47 for c in range(output.shape[1]):
48 rr = int(r*kr+ofr)
49 cc = int(c*kc+ofc)
50 if output[r,c]==0 or not clip:
51 output[r,c] = output[r,c]*(1-k)+img[rr,cc]*k
52
53class Canvas (wx.Panel):
54 scales = [0.03125, 0.0625, 0.125, 0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4, 5, 8, 10]

Callers 1

mergeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected