jjil.algorithm
Class GraySub

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

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

Subtracts one gray image from another. To be used as a join operation in a Ladder operation.

Author:
webb

Constructor Summary
GraySub()
          Creates a new instance of GraySub
 
Method Summary
 Image doJoin(Image imageFirst, Image imageSecond)
          Subtracts one gray image from another.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraySub

public GraySub()
Creates a new instance of GraySub

Method Detail

doJoin

public Image doJoin(Image imageFirst,
                    Image imageSecond)
             throws Error
Subtracts one gray image from another. Result is clamped between Byte.MIN_VALUE and Byte.MAX_VALUE.

Specified by:
doJoin in interface Ladder.Join
Parameters:
imageFirst - the first image (and output)
imageSecond - the second image
Returns:
the difference 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.