def compress_constant_zip(fd, # type: BinaryIO
value, # type: int
width, # type: int
rows, # type: int
depth, # type: int
version # type: int
): # type: (...) -> None
"""
Write a virtual image containing a constant to a zip compressed
stream.
{}
"""
if depth == 1:
image = _make_onebit_constant(value, width, rows)
compress_zip(fd, image, depth, version)
else:
row = _make_constant_row(value, width, depth)
row = row.tobytes()
fd.write(zlib.compress(row * rows))
评论列表
文章目录