|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimplePicture Picture
public class Picture
A class that represents a picture. This class inherits from SimplePicture and allows the student to add functionality to the Picture class. Copyright Georgia Institute of Technology 2004-2008
Constructor Summary | |
---|---|
Picture()
Constructor that takes no arguments |
|
Picture(BufferedImage image)
Constructor that takes a buffered image |
|
Picture(int width,
int height)
Constructor that takes the width and height |
|
Picture(Picture copyPicture)
Constructor that takes a picture and creates a copy of that picture |
|
Picture(String fileName)
Constructor that takes a file name and creates the picture |
Method Summary | |
---|---|
void |
blueScreen(Picture target,
int targetX,
int targetY)
Method to do chromakey assuming a blue background |
void |
chromakey(Picture target,
Color bgColor,
int threshold,
int targetX,
int targetY)
Method to do chromakey using an input color for the background and a point for the upper left corner of where to copy |
void |
compose(Picture target,
int targetX,
int targetY)
Method to compose (copy) this picture onto a target picture at a given point. |
Picture |
copy()
A method create a copy of the current picture and return it |
void |
decreaseRed()
Method to decrease the red by half in the current picture |
void |
decreaseRed(double amount)
Method to decrease the red by an amount |
Picture |
flip()
Method to flip a picture |
void |
grayscaleWithLuminance()
Method to change the picture to gray scale with luminance |
void |
increaseRed()
Method to increase the red in a picture. |
void |
negate()
Method to negate a picture |
Picture |
oilPaint(int dist)
Method to do an oil paint effect on a picture |
static Picture |
pickAndShow()
Class method to let the user pick a file name and then create the picture and show it |
Picture |
scale(double factor)
Method to scale the picture by a factor, and return the result |
static Picture |
showNamed(String fileName)
Class method to create a picture object from the passed file name and then show it |
String |
toString()
Method to return a string with information about this picture. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Picture()
public Picture(String fileName)
fileName
- the name of the file to create the picture frompublic Picture(int width, int height)
width
- the width of the desired pictureheight
- the height of the desired picturepublic Picture(Picture copyPicture)
public Picture(BufferedImage image)
image
- the buffered image to useMethod Detail |
---|
public String toString()
toString
in class SimplePicture
public static Picture pickAndShow()
public static Picture showNamed(String fileName)
fileName
- the name of the file that has a picture in it
public Picture copy()
public void increaseRed()
public void negate()
public Picture flip()
public void decreaseRed()
public void decreaseRed(double amount)
amount
- the amount to change the red bypublic void compose(Picture target, int targetX, int targetY)
target
- the picture onto which we copy this picturetargetX
- target X position to start attargetY
- target Y position to start atpublic Picture scale(double factor)
factor
- the factor to scale by (1.0 stays the same,
0.5 decreases each side by 0.5, 2.0 doubles each side)
public void chromakey(Picture target, Color bgColor, int threshold, int targetX, int targetY)
target
- the picture onto which we chromakey this picturebgColor
- the color to make transparentthreshold
- within this distance from bgColor, make transparenttargetX
- target X position to start attargetY
- target Y position to start atpublic void blueScreen(Picture target, int targetX, int targetY)
target
- the picture onto which we chromakey this picturetargetX
- target X position to start attargetY
- target Y position to start atpublic void grayscaleWithLuminance()
public Picture oilPaint(int dist)
dist
- the distance from the current pixel
to use in the range
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |