// -*- C++ -*-
#ifndef RICONVERTIMAGE_H
#define RICONVERTIMAGE_H
/* Copyright 1996 
 * Mon Sep 15 13:43:51 1997  Brian Smits  (bes@phoenix.cs.utah.edu)
 * 
 * RiConvertImage.H
 * 
 *	
 * 
 * $Id: RiConvertImage.H,v 1.2 1998/08/12 20:18:40 bes Exp $ 
 * 
 */
#ifndef RICOMMON_H
#include <RiCommon.H>
#endif


#ifndef RIIMAGE_H
#include <RiImage.H>
#endif



const int RI_GAMMA_TABLE_SIZE = 2048;

class RiConvertImage {
  public:
				//// Default constructor.  sets the monitor coordinates to something reasonable
				//  and the gamma to 1.4 (enough to finish the SGI default correction
    RiConvertImage();
				//// Set the luminance of the white point.  
    void SetY(RiReal newY);
				//// Set the chromaticity coordinates of the white point
    void SetWhitePoint(RiReal x, RiReal y);
				//// Set the chromaticity coordinates of the red phosphor
    void SetRedPoint(RiReal x, RiReal y);
				//// Set the chromaticity coordinates of the green phosphor
    void SetGreenPoint(RiReal x, RiReal y);
				//// Set the chromaticity coordinates of the blue phosphor
    void SetBluePoint(RiReal x, RiReal y);
				//// Set the gamma of the monitor/screen (ie 2.5 not .4)
    void SetGamma(RiReal gamma);
				//// Write the image to the file.  Determine type from the filename.
    void	WriteScreenFile(RiImage &img, const char *fname) const;
				//// Read the image from the file.  Determine type from the filename.
    bool 	ReadScreenFile(RiImage &img, const char *fname) const;
				//// Write the image to a data array (in proper order for glDrawPixels)
    void	WriteScreenData(RiImage &img, unsigned char *data);
  private:
    RiReal rX, rY, gX, gY, bX, bY;
    RiReal wX, wY, wLum;
    RiReal gamma;
};





#endif /* RICONVERTIMAGE_H */

