mosaiccreator
Class Mosaic

public class Mosaic

Title: Mosaic Image

Description: the information of a mosaic image

Version:
1.0
Author:
Lance Finfrock
Constructor Detail

Mosaic

public Mosaic(PicPixels[] subPieces,
              PicPixels Original,
              int divW,
              int divH)
Parameters:
subPieces - PicPixels[] the mosaic pieces
Original - PicPixels the mosaic picture
divW - int the divions wide
divH - int the divions high

Method Detail

getWidth

public int getWidth()
Returns:
int the width of the mosaic image

getSubWidth

public int getSubWidth()
Returns:
int the width of the mosaic pieces

getHeight

public int getHeight()
Returns:
int the height of the mosaic image

getSubHeight

public int getSubHeight()
Returns:
int the height of the mosaic pieces

resizeMosaic

public void resizeMosaic(int maxWidth,
                         int maxHeight,
                         Frame windowCameFrom)
Parameters:
maxWidth - int
maxHeight - int
windowCameFrom - Frame

drawPieces

private void drawPieces(PicPixels picPixels,
                        int w,
                        int h)
draws a picPixels and the sector given by the width and height to the buffered Image
Parameters:
picPixels - PicPixels the mosiac pieces
w - int the width of the sector to be draw
h - int the height of the sector to be draw
MosaicPicture - BufferedImage the image to be draw to

drawPieces

private void drawPieces(PicPixels Original,
                        PicPixels picPixels,
                        int w,
                        int h,
                        BufferedImage MosaicPicture)
draws the orginal picpixels sector and the mosaic piece to the buffered image
Parameters:
Original - PicPixels the mosiac image
picPixels - PicPixels the mosaic piece
w - int the width of the mosiac section
h - int the heigth of the mosaic section
MosaicPicture - BufferedImage the image to be draw to

findColor

private Color findColor(Color colorpiece,
                        Color colorOriginal)
finds the color value from the with the blending
Parameters:
colorpiece - Color the color of the mosaic piece pixel
colorOriginal - Color the color of the mosaic image pixel
Returns:
Color the color to set the pixel to

createMosaicPicture

public void createMosaicPicture(double backgroundIntensity,
                                Frame windowCameFrom)
use to create the viewable moaic with the size of the current screen
Parameters:
backgroundIntensity - double the blending level
windowCameFrom - Frame what window called this function

createMosaicPicture

public BufferedImage createMosaicPicture(int width,
                                         int height,
                                         double backgroundIntensity,
                                         Frame windowCameFrom)
use to create the printable or saveable mosaic with the size that is passed in
Parameters:
width - int the width of the mosaic wanted to be created
height - int the height of the mosaic wanted to be created
backgroundIntensity - double the blending level
windowCameFrom - Frame the window that called this function
Returns:
BufferedImage the mosaic image created