jjil.algorithm
Class GrayAdd

java.lang.Object
  extended by jjil.algorithm.GrayAdd
All Implemented Interfaces:
Ladder.Join

public class GrayAdd
extends java.lang.Object
implements Ladder.Join

Adds two gray images. To be used as a join operation in a Ladder operation.

Author:
webb

Constructor Summary
GrayAdd()
          Creates a new instance of GrayAdd
 
Method Summary
 Image doJoin(Image imageFirst, Image imageSecond)
          Adds two Gray8Image's.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrayAdd

public GrayAdd()
Creates a new instance of GrayAdd

Method Detail

doJoin

public Image doJoin(Image imageFirst,
                    Image imageSecond)
             throws Error
Adds two Gray8Image's. Result is clamped between Byte.MIN_VALUE and Byte.MAX_VALUE. The first input image is replaced by the result.

Specified by:
doJoin in interface Ladder.Join
Parameters:
imageFirst - the first image (and output)
imageSecond - the second image
Returns:
the sum of the two byte images, replacing the first
Throws:
Error - if either image is not a gray 8-bit image, or they are of different sizes.