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

Method merge

imagepy/ui/canvas.py:179–196  ·  view source on GitHub ↗
(self, img, back, M, O, mode, shape, win, lookup)

Source from the content-addressed store, hash-verified

177 wx.BufferedPaintDC(self, self.buffer)
178
179 def merge(self, img, back, M, O, mode, shape, win, lookup):
180 if img.ndim == 2:
181 rstarr = np.zeros(shape, dtype=img.dtype)
182 my_transform(img, M, offset=O, output=rstarr, k=1, clip=False)
183 if rstarr.dtype == np.complex128: rstarr = np.abs(rstarr)
184 rstarr = lookup(rstarr)
185 if img.ndim == 3:
186 rstarr = np.zeros((win[3], win[2], 3), dtype=img.dtype)
187 for i in range(3):
188 my_transform(img[:,:,i], M, offset=O,
189 output=rstarr[:,:,i], k=1, clip=False)
190
191 if not back is None:
192 for i in range(3):
193 my_transform(back[:,:,i] if back.ndim==3 else back, M, offset=O,
194 output=rstarr[:,:,i], k=mode[0], clip = mode[1]=='Clip')
195
196 return rstarr
197
198 def draw_image(self, dc, ndarr, back, mode, rect, scale, dirty):
199 #print(rect, self.box)

Callers 1

draw_imageMethod · 0.95

Calls 1

my_transformFunction · 0.85

Tested by

no test coverage detected