def pixels_blue (surface):
    """pygame.surfarray.pixels_blue (Surface): return array

    Reference pixel blue into a 2d array.

    Create a new 2D array that directly references the blue values
    in a Surface. Any changes to the array will affect the pixels
    in the Surface. This is a fast operation since no data is copied.

    This can only work on 24-bit or 32-bit Surfaces.

    The Surface this array references will remain locked for the
    lifetime of the array.
    """
    global numpysf
    try:
        return numpysf.pixels_blue(surface)
    except AttributeError:
        import pygame._numpysurfarray as numpysf
        return numpysf.pixels_blue(surface)
def pixels_blue (surface):
    """pygame.surfarray.pixels_blue (Surface): return array

    Reference pixel blue into a 2d array.

    Create a new 2D array that directly references the blue values
    in a Surface. Any changes to the array will affect the pixels
    in the Surface. This is a fast operation since no data is copied.

    This can only work on 24-bit or 32-bit Surfaces.

    The Surface this array references will remain locked for the
    lifetime of the array.
    """
    return numpysf.pixels_blue (surface)
Exemple #3
0
def pixels_blue (surface):
    """pygame.surfarray.pixels_blue (Surface): return array

    Reference pixel blue into a 2d array.

    Create a new 2D array that directly references the blue values
    in a Surface. Any changes to the array will affect the pixels
    in the Surface. This is a fast operation since no data is copied.

    This can only work on 24-bit or 32-bit Surfaces.

    The Surface this array references will remain locked for the
    lifetime of the array.
    """
    if __arraytype == "numpy":
        return numpysf.pixels_blue (surface)
    raise NotImplementedError("surface arrays are not supported")