Class Image

java.lang.Object
  extended by Image

public class Image
extends java.lang.Object


Constructor Summary
Image(java.lang.String filename)
          Constructor creates a new Image given the path to a PPM file.
 
Method Summary
 void flipHorizontal()
          Flip the image horizontally
 void flipVertical()
          Flip the image vertically
 void inverseTransform()
          This transformation inverts all Pixels in the current Image.
 void logTransform(double coeff)
          This transformation adjusts the intensity of all Pixels in the current Image using the Log function.
 void open(java.lang.String filename)
          Open a PPM file and return a 2D array of pixels
 void powerLawTransform(double coeff, double gamma)
          This transformation adjusts the intensity of all Pixels in the current Image using the Power Law.
 void rotateClockwise()
          Rotate image left
 void rotateCounterClockwise()
          Rotate image right
 void save(java.lang.String filename)
          Writes contents of current Image into the file specified
 java.lang.String toString()
          The String representation of this image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Image

public Image(java.lang.String filename)
Constructor creates a new Image given the path to a PPM file. Populates the working image.

Parameters:
filename -
Method Detail

flipHorizontal

public void flipHorizontal()
Flip the image horizontally


flipVertical

public void flipVertical()
Flip the image vertically


inverseTransform

public void inverseTransform()
This transformation inverts all Pixels in the current Image.


logTransform

public void logTransform(double coeff)
This transformation adjusts the intensity of all Pixels in the current Image using the Log function.

Parameters:
coeff - non-negative coefficient

open

public void open(java.lang.String filename)
Open a PPM file and return a 2D array of pixels

Parameters:
filename - is a path to the PPM file to be opened

powerLawTransform

public void powerLawTransform(double coeff,
                              double gamma)
This transformation adjusts the intensity of all Pixels in the current Image using the Power Law.

Parameters:
coeff - non-negative coefficient
gamma - exponent

rotateClockwise

public void rotateClockwise()
Rotate image left


rotateCounterClockwise

public void rotateCounterClockwise()
Rotate image right


save

public void save(java.lang.String filename)
Writes contents of current Image into the file specified

Parameters:
filename - The name of file into which to save current image.

toString

public java.lang.String toString()
The String representation of this image. The format is: PPM_VERSION width height 255 (pixel values)

Overrides:
toString in class java.lang.Object