net.sourceforge.javaocr.filter
Class RGBAToGrayscale

java.lang.Object
  extended by net.sourceforge.javaocr.filter.AbstractSinglePixelFilter
      extended by net.sourceforge.javaocr.filter.RGBAToGrayscale
All Implemented Interfaces:
ImageFilter

public class RGBAToGrayscale
extends AbstractSinglePixelFilter

converts RGBA image to grayscale

Author:
Konstantin Pribluda

Field Summary
(package private)  int cB
           
(package private)  int cG
           
(package private)  int cR
           
 
Constructor Summary
RGBAToGrayscale()
          construct with default coefficients (306,601,117)
RGBAToGrayscale(int cR, int cG, int cB)
          construct with weight coefficients.
 
Method Summary
protected  void processPixel(Image image)
          convert RGBA to grayscale
 
Methods inherited from class net.sourceforge.javaocr.filter.AbstractSinglePixelFilter
process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cR

final int cR

cG

final int cG

cB

final int cB
Constructor Detail

RGBAToGrayscale

public RGBAToGrayscale()
construct with default coefficients (306,601,117)


RGBAToGrayscale

public RGBAToGrayscale(int cR,
                       int cG,
                       int cB)
construct with weight coefficients. multiplication results are divided by 1024

Parameters:
cR -
cG -
cB -
Method Detail

processPixel

protected void processPixel(Image image)
convert RGBA to grayscale

Specified by:
processPixel in class AbstractSinglePixelFilter
Parameters:
image - to be processed


Copyright © -2012. All Rights Reserved.