codecs.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:pytoshop 作者: mdboom 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号