// -*- C++ -*-
#ifndef RIIMAGE_H
#define RIIMAGE_H
/* Copyright 1996 
 * Wed Apr  2 09:27:52 1997  Brian Edward Smits  (bes@burn.cs.utah.edu)
 * 
 * RiImage.H
 * 
 *	
 * 
 * $Id: RiImage.H,v 1.6 1999/01/05 20:41:39 bes Exp $ 
 * 
 */
#ifndef RICOMMON_H
#include <RiCommon.H>
#endif

#ifndef RICOLORXYZV_H
#include <RiColorXYZV.H>
#endif

class ostream;
class istream;

/***************************************************************
CLASS
    RiImage
     Stores an image of data corresponding to RiColorXYZV

DESCRIPTION
     This representation of an image is used for RiColorXYZV images.
     There is no compression.  The format is rough.  

****************************************************************/

class RiImage {
  public:
				//// Construct a void/empty image
    RiImage();
				// Initial image is not cleared.  Use Clear for this.
    RiImage(int width, int height, RiReal fovDeg = 45);
				//// Copy constructor WARNING: Very Expensive
    RiImage(const RiImage &);
				//// clean up the image data.
    ~RiImage();
				// Accessors
				//// Get a pointer to the pixel value
    RiColorXYZV  	operator()(int x, int y) const;
				//// Get a pointer to the pixel value
    RiColorXYZV	       &operator()(int x, int y);
				//// Image Width (0 for an empty image)
    int	 	   GetWidth() const;
				//// Image Height (0 for an empty image)
    int 	   GetHeight() const;
				////  Total viewing angle in degrees for the width of the film plane.
    RiReal	   GetFieldOfView() const;
				//// Total viewing angle in degrees for the width of the film plane.
    void	   SetFieldOfView(RiReal fovDeg);
				// Assignment
				//// assignment (deep copy all data)
    const RiImage &operator=(const RiImage &);
				//// Clears the image (new images are not cleared)
    void	   Clear();
				// IO
				//// Write an image using PRIS format
    friend ostream &operator<<(ostream &, const RiImage &);
				//// Read an image using PRIS format.
    friend istream &operator>>(istream &, RiImage &);
  private:
				//// size data
    int 	  width, height;
				//// field of view value
    RiReal	  fov;
				//// image data array.
    RiColorXYZV	 *img;
};


#endif /* RI_RIIMAGE_H */

