jjil.algorithm
Class GrayLinComb

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

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

Computes linear combination of two Gray8Images. Result is (a*first image + b*second image) / c. The signed image values are shifted so the minimum value is 0 and the result is then shifted back to the signed range.
Intended to be used as a combination stage in a ladder operation.

Author:
webb

Constructor Summary
GrayLinComb(int a, int b, int c)
          Creates a new instance of GrayLinComb
 
Method Summary
 Image doJoin(Image imageFirst, Image imageSecond)
          Computes the linear combination of the two images, forming a*the first image + b *the second image, all divided by c.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrayLinComb

public GrayLinComb(int a,
                   int b,
                   int c)
            throws Error
Creates a new instance of GrayLinComb

Parameters:
a - Multiplier for first image.
b - Multiplier for second image.
c - Divisor for linear combination.
Throws:
Error - if the divisor (c) is 0.
Method Detail

doJoin

public Image doJoin(Image imageFirst,
                    Image imageSecond)
             throws Error
Computes the linear combination of the two images, forming a*the first image + b *the second image, all divided by c.

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