Beispiel #1
0
def array3d(surface):
    """pygame.surfarray.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).
    """
    if __arraytype == "numeric":
        return numericsf.array3d(surface)
    elif __arraytype == "numpy":
        return numpysf.array3d(surface)
    raise NotImplementedError("surface arrays are not supported")
Beispiel #2
0
def array3d(surface):
    """pygame.surfarray.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).
    """
    if __arraytype == "numeric":
        return numericsf.array3d(surface)
    elif __arraytype == "numpy":
        return numpysf.array3d(surface)
    raise NotImplementedError("surface arrays are not supported")