import java.awt.*;
import java.awt.image.*;
import java.io.*;

// Channels the red component of image
public class redfilt extends EffectFilter
{
	// Create object
	public redfilt()
	{
	}
	
	// Runs algorithm
	public void performEffect()
	{
		int newPixels[] = new int[width*height];
		int red = 0;
		
		// Moves through the input array pixel by pixel
		for(int k=0;k<width*height;k++)
		{
			// Isolates red component
			red = ((pixels[k]>>16)&0xff);
			
			// Outputs red component in greyscale
			newPixels[k] = (255<<24 | (red<<16) | (red<<8) | red);
		}

		this.pixels = newPixels;
	}
}
