MCPcopy Index your code
hub / github.com/plotly/plotly.py / make_byte

Function make_byte

_plotly_utils/png.py:974–982  ·  view source on GitHub ↗

Take a block of (2, 4, or 8) values, and pack them into a single byte.

(block)

Source from the content-addressed store, hash-verified

972 spb = int(8 / bitdepth)
973
974 def make_byte(block):
975 """Take a block of (2, 4, or 8) values,
976 and pack them into a single byte.
977 """
978
979 res = 0
980 for v in block:
981 res = (res << bitdepth) + v
982 return res
983
984 for row in rows:
985 a = bytearray(row)

Callers 1

pack_rowsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected