jjil.algorithm
Class RgbMaxContrast2Gray

java.lang.Object
  extended by jjil.core.PipelineStage
      extended by jjil.algorithm.RgbMaxContrast2Gray

public class RgbMaxContrast2Gray
extends PipelineStage

Pipeline stage converts an ARGB color image into a Gray8Image. It does this by choosing at each pixel the value that will give the maximum contrast in the resulting image. That is, it computes the R, G, and B values at each pixel, and chooses the most extreme value -- the one largest in absolute value.

Author:
webb

Constructor Summary
RgbMaxContrast2Gray()
          Creates a new instance of RgbAvg2Gray
 
Method Summary
 void push(Image image)
          Implementation of push operation from PipelineStage.
 
Methods inherited from class jjil.core.PipelineStage
getFront, isEmpty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RgbMaxContrast2Gray

public RgbMaxContrast2Gray()
Creates a new instance of RgbAvg2Gray

Method Detail

push

public void push(Image image)
          throws Error
Implementation of push operation from PipelineStage. Pipeline stage converts an ARGB color image into a Gray8Image. It does this by choosing at each pixel the value that will give the maximum contrast in the resulting image. That is, it computes the R, G, and B values at each pixel, and chooses the most extreme value -- the one largest in absolute value. Note that the RGB->Gray conversion involves changing the data range of each pixel from 0->255 to -128->127 because byte is a signed type.

Specified by:
push in class PipelineStage
Parameters:
image - the input image
Throws:
Error - if image is not an RgbImage