/*
 *  @# ImageBuffer.java 1.0 96/9/20
 *  Copyright (c) 1996 Lawrence Rodrigues
 */
import java.io.*;
import java.awt.*;
import java.util.*;
import java.net.URL;
import java.awt.image.*;

public class  ImageBuffer {
  
   public Image  image;
   public int width = -1, height = -1;
   public int origPixels[];
   public ColorModel cm;
   public URL url= null;
   public String fileName = null;
   public String dir;
   public String imageName;
   public int imageId;
   public int loadStatus;

   public ImageBuffer(){
      
   }

   public Image getImage() {
      return image;
   }

   public int getLoadStatus() {
      return loadStatus;
   }

   public void setLoadStatus(int status) {
      loadStatus = status;
   }


   public void setWidHt(int wd,  int ht){
      width = wd; height = ht;
   }

   public void setParams(int rwIm[], int wd, int ht, ColorModel colCm){
      width = wd; height = ht;
      cm = colCm;
      origPixels = rwIm;
      //loadStatus |= (LOAD_REQUESTED | HT_WID_KNOWN| PIXELS_AVAILABLE);
   }

   public void setFileInfo(String path, String name, int id){
      if(path == null || name == null) return;
      dir = path;
      imageName = name;
      imageId = id;
      fileName = new String(dir+File.separatorChar+imageName);
      url = null;
   }

   public  void setUrlInfo(URL ul, String name, int id){
      if(ul == null || name == null) return;
      url = ul;
      imageName = name;
      imageId = id;
      fileName = null;
   }
 }


