MCPcopy Create free account
hub / github.com/ICE27182/Python-3D-renderer / get_digits

Method get_digits

png.py:363–371  ·  view source on GitHub ↗
(num:int)

Source from the content-addressed store, hash-verified

361 return [[[r, g, b, a], [...], ...], [...], ...]
362 """
363 def get_digits(num:int) -> tuple:
364 if self.bit_depth == 1:
365 return tuple(map(int, format(num, "08b")))
366 elif self.bit_depth == 2:
367 return num // 64, num % 64 // 16, num % 16 // 4, num % 4
368 elif self.bit_depth == 4:
369 return num // 16, num % 16
370 elif self.bit_depth == 8:
371 return num,
372
373 pixels = []
374 # Indexed

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected