MCPcopy
hub / github.com/XingangPan/DragGAN / is_compatible

Method is_compatible

gui_utils/gl_utils.py:202–217  ·  view source on GitHub ↗
(self, *, image=None, width=None, height=None, channels=None, dtype=None)

Source from the content-addressed store, hash-verified

200 gl.glPopAttrib()
201
202 def is_compatible(self, *, image=None, width=None, height=None, channels=None, dtype=None): # pylint: disable=too-many-return-statements
203 if image is not None:
204 if image.ndim != 3:
205 return False
206 ih, iw, ic = image.shape
207 if not self.is_compatible(width=iw, height=ih, channels=ic, dtype=image.dtype):
208 return False
209 if width is not None and self.width != width:
210 return False
211 if height is not None and self.height != height:
212 return False
213 if channels is not None and self.channels != channels:
214 return False
215 if dtype is not None and self.dtype != dtype:
216 return False
217 return True
218
219#----------------------------------------------------------------------------
220

Callers 3

__init__Method · 0.95
updateMethod · 0.95
draw_frameMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected