2D and 3D direct pixel access¶
PixelView(source : object)¶
NoteIf necessary, the source surface will be locked for accessing its pixel data. The lock will be removed once the
PixelViewis garbage-collected or deleted.
PixelViewuses a y/x-layout. Accessing
view[N]will operate on the Nth row of the underlying surface. To access a specific column within that row,
view[N][C]has to be used.
pixels2d(source : object)¶
Creates a 2D pixel array, based on
numpy.ndarray, from the passed source. source can be a
SDL_Surfaceof the source will be locked and unlocked automatically.
The source pixels will be accessed and manipulated directly.