|
CSUMB 205 Multimedia in PYTHON
0.8.12
An easy-to-use wrapper module for the PIL module
|
Public Member Functions | |
| def | __init__ |
| def | getPixel (self, args) |
| def | getAllPixels (self) |
| def | setName (self, name) |
| def | save |
| def | show (self) |
| def | reset (self) |
| def | __str__ (self) |
Public Attributes | |
| inputFilename | |
| outputFilename | |
| height | |
| pixels | |
Static Public Attributes | |
| string | inputFilename = "" |
| string | outputFilename = "" |
| list | pixels = [] |
| int | height = 0 |
| int | width = 0 |
A simple class for accessing attributes of an RGB Pixel
ATTRIBUTES:
inputFilename String, the absolute path of the file used for input.
Empty if blank image was created
outputFilename String, the absolute path where the image will be saved.
Empty if blank image was created
pixels List, a 2-dimensional array of rgbPixel objects
height Integer, the height of the picture in pixels
width Integer, the width of the pixture in pixels
Definition at line 377 of file simpleImage.py.
| def simpleImage.rgbImage.__init__ | ( | self, | |
inputFilename = "", |
|||
outputFilename = "", |
|||
blank = False, |
|||
width = 100, |
|||
height = 100 |
|||
| ) |
Object initialization
ARGS:
self this Object
inputFilename String, the location of the picture
outputFilename String, the location that this picture will be saved to
blank Boolean, whether this image should be a blank image
width Integer, the width of the blank image
height Integer, the height of the blank image
Definition at line 405 of file simpleImage.py.
| def simpleImage.rgbImage.__str__ | ( | self | ) |
Returns a string representation of this object
Definition at line 686 of file simpleImage.py.
| def simpleImage.rgbImage.getAllPixels | ( | self | ) |
Converts this object's 'pixels' attribute into a 1-dimensional array
Definition at line 537 of file simpleImage.py.
| def simpleImage.rgbImage.getPixel | ( | self, | |
| args | |||
| ) |
Gets an rgbPixel object at the specified (x,y) coordinate
ARGS:
self this Object
x The X coordinate of the pixel
y The Y coordinate of the pixel
or
(x,y) The X and Y coordinate within a tuple or list
RETURNS:
rgbPixel object
RAISES:
ValueError - 'x' or 'y' is out of the picture's bounds
Definition at line 514 of file simpleImage.py.
| def simpleImage.rgbImage.reset | ( | self | ) |
Resets this object to the original image
Definition at line 635 of file simpleImage.py.
| def simpleImage.rgbImage.save | ( | self, | |
filename = "", |
|||
forceOverwrite = False |
|||
| ) |
This will save the current object to a specified location
ARGS:
self this Object
filename OPTIONAL. String, the name or location to be saved to.
forceOverwrite OPTIONAL. Boolean, whether to force overwrite of file
at location 'filename' or 'self.outputFilename'
RETURNS:
none
RAISES:
none.
Definition at line 595 of file simpleImage.py.
| def simpleImage.rgbImage.setName | ( | self, | |
| name | |||
| ) |
Given a new name (as a String), sets the output filename
ARGS:
name String, the new name of the to-be-saved file
RETURNS:
Boolean, True if file does not exist, False otherwise
RAISES:
Value Error if name is not string
Definition at line 546 of file simpleImage.py.
| def simpleImage.rgbImage.show | ( | self | ) |
Shows the image the user is currently working on
Definition at line 629 of file simpleImage.py.
1.8.9.1