| |
- DisplayWindow
- Image
class Image |
|
This class describes an image. |
|
Methods defined here:
- __init__(self, filename='', copySurf=None, width=0, height=0)
- Constructor for an Image object. Can be passed a filename
to read from, a copy of a surface to use, or a width and height
to create a new empty Image
- copy(self)
- Returns a copy of this Image
- draw(self, window, x=0, y=0)
- Draws this Image in the given DisplayWindow at the given location
- getHeight(self)
- Gets the height (in pixels) of this Image
- getNumPixels(self)
- Gets the total number of pixels in this Image
- getPixel1D(self, n)
- Gets the pixel at the given index.
Returns a list of 3 ints 0-255.
- getPixel2D(self, x, y)
- Gets the pixel at the given (x, y) location.
Returns a list of 3 ints 0-255
- getWidth(self)
- Gets the width (in pixels) of this Image
- save(self, filename)
- Saves this Image to the given filename
- setPixel1D(self, n, rgb)
- Sets the pixel at the given index.
The pixel information needs to be passed as a list of 3 ints, 0-255
- setPixel2D(self, x, y, rgb)
- Sets the pixel at the given (x, y) location.
The pixel information needs to be passed as a list of 3 ints, 0-255.
| |