import java.awt.*;

/**
 * An three-level gray-based threshold filter.
 * 
 * @author Michael Kolling and David J Barnes 
 * @version 1.0
 */
public class RedFilter extends Filter
{
	/**
	 * Constructor for objects of class MikesFilter
	 */
	public RedFilter(String name)
    {
        super(name);
	}

    /**
     * Apply this filter to an image.
     * 
     * @param  image  The image to be changed by this filter.
     */
    public void apply(OFImage image)
    {
        int height = image.getHeight();
        int width = image.getWidth();
        for(int y = 0; y < height; y++) {
            for(int x = 0; x < width; x++) {
                Color pixel = image.getPixel(x, y);
                int r = pixel.getRed(); 
                image.setPixel(x, y, new Color(r,0,0));
            }
        }
    }
}
