import java.awt.*;
import Raster;

public class ZRaster extends Raster {
  public final static int MAXZ = (1 << 16) - 1;
  public int zbuff[];
  
  ///////////////////////// Constructors //////////////////////
  
  /**
   *  This constructor which takes no arguments
   *  allows for future extension.
   */
  public ZRaster()
  {
  }
  
  /**
   *  This constructor creates an uninitialized
   *  Raster Object of a given size (w x h).
   */
  public ZRaster(int w, int h)
  {
    super(w, h);
    zbuff = new int[w*h];
  }

  /**
   *  This constructor creates an Raster initialized
   *  with the contents of an image.
   */
  public ZRaster(Image img)
  {
    super(img);
    zbuff = new int[this.size()];
  }
  
  /**
   *    Set all z values in the zbuffer
   *    to the maximum value
   */
  public final void resetz()
  {
    for (int i = 0; i < zbuff.length; i++)
      zbuff[i] = MAXZ;
  }
}
