Class ImageWrangler

java.lang.Object
  |
  +--ImageWrangler

public class ImageWrangler
extends java.lang.Object


Field Summary
 java.awt.image.ConvolveOp blur
          A ConvolveOp object for blurring.
 java.awt.image.ConvolveOp edge
          A ConvolveOp object for finding edges.
 
Constructor Summary
ImageWrangler(int _kWidth, int _kHeight, int[] masks)
          This has a bunch of utilities for going between images and arrays and for taking advantage of native convolveOps for edge detection and blur..
 
Method Summary
 void arrayFromImage(java.awt.image.BufferedImage inImage, int[] outPixis)
          You give me an image and some pixels and I will transfer the image into the array.
 void arrayFromImageWithAlpha(java.awt.image.BufferedImage inImage, int[] pixis)
           
 void blurArray(int[] pixis)
           
 java.awt.image.BufferedImage blurArrayToImage(int[] pixis)
          You give me an array of pixels, I give you them back blurred in an image.
 void blurImage(java.awt.image.BufferedImage inImage, java.awt.image.BufferedImage outImage)
          You give me an image and I will blur it and return it in your destination image
 java.awt.image.BufferedImage edge(int[] myArray)
          You give me an array of pixels, I find the edges and give it back in an image
 java.awt.image.BufferedImage imageFromArray(int[] pixis)
          You give me an array of pixels, I give you back and image.
 void imageFromArray(int[] pixis, java.awt.image.BufferedImage outImage)
          You give me an array of pixels, and the image you want them returned in and I will blur them.
 java.awt.image.BufferedImage imageWithAlphaFromArray(int[] pixis)
          You give me an array, I give you back an image with Alpha.
 void imageWithAlphaFromArray(int[] pixis, java.awt.image.BufferedImage outImage)
          You give me an image with Alpha, I give you back an array.
 void makePictureFile(java.awt.image.BufferedImage bi, java.lang.String pathname, java.lang.String filename, float quality, int threshold)
          You give me an image and I will encode it and write it to a file.
 void setBlur(int size)
          Sets the degree of blur.
 void setEdge(float[] matrix, int size)
          Set up the edge detection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blur

public java.awt.image.ConvolveOp blur
A ConvolveOp object for blurring.


edge

public java.awt.image.ConvolveOp edge
A ConvolveOp object for finding edges.

Constructor Detail

ImageWrangler

public ImageWrangler(int _kWidth,
                     int _kHeight,
                     int[] masks)
This has a bunch of utilities for going between images and arrays and for taking advantage of native convolveOps for edge detection and blur..

Method Detail

setEdge

public void setEdge(float[] matrix,
                    int size)
Set up the edge detection. This sets the kernel in case you know what that is. You never really have to set this. The default matrix is,
{ 0.0f, -1.0f, 0.0f,
-1.0f, 4.0f, -1.0f,
0.0f, -1.0f, 0.0f };
always a classic. The size is 3 as in 3x3.


setBlur

public void setBlur(int size)
Sets the degree of blur. This takes an integer that describes how many pixels around each pixel to take into account when averaging. The default is 5 and bigger numbers will really slow things down.


blurArray

public void blurArray(int[] pixis)

blurArrayToImage

public java.awt.image.BufferedImage blurArrayToImage(int[] pixis)
You give me an array of pixels, I give you them back blurred in an image.


edge

public java.awt.image.BufferedImage edge(int[] myArray)
You give me an array of pixels, I find the edges and give it back in an image


imageFromArray

public void imageFromArray(int[] pixis,
                           java.awt.image.BufferedImage outImage)
You give me an array of pixels, and the image you want them returned in and I will blur them.


imageFromArray

public java.awt.image.BufferedImage imageFromArray(int[] pixis)
You give me an array of pixels, I give you back and image.


imageWithAlphaFromArray

public void imageWithAlphaFromArray(int[] pixis,
                                    java.awt.image.BufferedImage outImage)
You give me an image with Alpha, I give you back an array.


imageWithAlphaFromArray

public java.awt.image.BufferedImage imageWithAlphaFromArray(int[] pixis)
You give me an array, I give you back an image with Alpha.


blurImage

public void blurImage(java.awt.image.BufferedImage inImage,
                      java.awt.image.BufferedImage outImage)
You give me an image and I will blur it and return it in your destination image


arrayFromImage

public void arrayFromImage(java.awt.image.BufferedImage inImage,
                           int[] outPixis)
You give me an image and some pixels and I will transfer the image into the array.


arrayFromImageWithAlpha

public void arrayFromImageWithAlpha(java.awt.image.BufferedImage inImage,
                                    int[] pixis)

makePictureFile

public void makePictureFile(java.awt.image.BufferedImage bi,
                            java.lang.String pathname,
                            java.lang.String filename,
                            float quality,
                            int threshold)
You give me an image and I will encode it and write it to a file.