package yi.iu.processor.channel;

import java.awt.*;
import yi.iu.processor.channel.ChannelMaker;

public class I2ChnlMaker extends yi.iu.processor.channel.ChannelMaker
{
    public int[] getProcessed(int rgb[], Dimension d)
    {
	    int width=d.width, height=d.height;
	    int size=width*height;
	    int[] i2= new int[size];

	    for (int i=0;i<size;i++) {
	        int red=rgb[i]>>16&255;
	        int green=rgb[i]>>8&255;
	        int blue=rgb[i]&255;
	        i2[i]= (red-blue)/2+128;
	    }
	    return i2;
    }

}
