import java.awt.*;
import java.io.*;

/**
 * An application that can be used to determine Color information
 * in a rectangular portion of an image
 *
 * @version 1.0
 */
public class ColorSensor
{
    /**
     * The entry-point of the application
     *
     * @param args  The command line arguments (left, top, width, height, file)
     */
    public static void main(String[] args)
    {
       Color[][]       image;
       int             height, left, max, top, value, width;
       String          name;
       
       // Process the command line arguments
       left     = Integer.parseInt(args[0]);
       top      = Integer.parseInt(args[1]);
       width    = Integer.parseInt(args[2]);
       height   = Integer.parseInt(args[3]);
       name     = args[4];
       
       // Load the image
       image = ImageStorage.loadImage(name);

       // Perform the calculations
       max = findMax(image, left, top, width, height);       

       // Print the result
       System.out.println("Maximum: " + max);       
    }



    /**
     * Finds the pixel in the given rectangle that
     * has the maximum sum of the 
     * R and B components and returns that sum.
     *
     * @param image     The image to use
     * @param left      The coordinate of the left side of the rectangle
     * @param top       The coordinate of the top side of the rectangle
     * @param width     The width of the rectangle
     * @param height    The height of the rectangle
     * @return          The maximum pixel value
     */
    private static int findMax(Color[][] image,
                               int left, int top, int width, int height)
    {




    }
    
}
