_numpysurfarray.py 文件源码

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

项目:Projects 作者: it2school 项目源码 文件源码
def array3d(surface):
    """pygame.numpyarray.array3d(Surface): return array

    copy pixels into a 3d array

    Copy the pixels from a Surface into a 3D array. The bit depth of the
    surface will control the size of the integer values, and will work
    for any type of pixel format.

    This function will temporarily lock the Surface as pixels are copied
    (see the Surface.lock - lock the Surface memory for pixel access
    method).
    """
    w, h = surface.get_size()
    array = numpy.empty((w, h, 3), numpy.uint8)
    surface_to_array(array, surface)
    return array
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号