//Class Palette contains the color table associated with an object
//Author: Tommy Grandefors
//Date: December 1996

#ifndef PALETTE_HH
	#define PALETTE_HH

#include "typedef.hh"	//Type defines such as 'unsigned char' means 'UBYTE'

class Palette
{
public:
  Palette(void);
  ~Palette(void);
  friend class Graphix;  //There is nothing wrong with a good friend!
  void ConvertToNegativePalette(void);
  void ConvertToGreyScalePalette(void);
  void RotatePalette(UBYTE dist);
  void SetRed(UBYTE index,UBYTE value);
  void SetGreen(UBYTE index,UBYTE value);
  void SetBlue(UBYTE index,UBYTE value);
  UBYTE GetRed(UBYTE index);
  UBYTE GetGreen(UBYTE index);
  UBYTE GetBlue(UBYTE index);
  void SetRGB(UBYTE index,UBYTE red,UBYTE green,UBYTE blue);
  void GetRGB(UBYTE index,UBYTE &red,UBYTE &green,UBYTE &blue);
private:
  void SmoothPalette(UBYTE r, UBYTE g, UBYTE b);
  UBYTE VGA_pal[768]; //The color table for Red,Green and Blue
};

#endif
