funworld
Class ImageMaker

java.lang.Object
  extended by funworld.ImageMaker

public class ImageMaker
extends java.lang.Object

This class allows the user to read image data from a .png file and save it as a RenderedImage in the format that is used for the World when drawing on its Canvas.

Since:
February 4 2012
Author:
Viera K. Proulx

Field Summary
static java.awt.image.ColorModel canvasColorModel
           
 java.awt.image.ColorModel cmodel
           
 java.awt.image.ColorConvertOp colorOp
           
 int height
           
 java.awt.image.BufferedImage image
           
 java.awt.image.BufferedImage imageSource
          the buffer that saves the user-generated image
static java.util.HashMap<java.lang.String,java.awt.image.BufferedImage> loadedImages
           
 int width
           
 
Constructor Summary
ImageMaker(java.lang.String filename)
           
 
Method Summary
 java.awt.Color getColorPixel(int x, int y)
          Get the specified pixel in the image as an RGB color.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

public int width

height

public int height

loadedImages

public static java.util.HashMap<java.lang.String,java.awt.image.BufferedImage> loadedImages

imageSource

public java.awt.image.BufferedImage imageSource
the buffer that saves the user-generated image


image

public java.awt.image.BufferedImage image

cmodel

public java.awt.image.ColorModel cmodel

canvasColorModel

public static java.awt.image.ColorModel canvasColorModel

colorOp

public java.awt.image.ColorConvertOp colorOp
Constructor Detail

ImageMaker

public ImageMaker(java.lang.String filename)
Method Detail

getColorPixel

public java.awt.Color getColorPixel(int x,
                                    int y)
Get the specified pixel in the image as an RGB color.

Parameters:
x - the x coordinate of the pixel
y - the y coordinate of the pixel