#ifndef __DVB_SUBTITLES_CLUT_H
#define __DVB_SUBTITLES_CLUT_H
#include <stdint.h>

// forward declarations

#define MAX_COLORS 256
class cSubtitlesPalette
{
 public:
  cSubtitlesPalette(int bpp);
  ~cSubtitlesPalette();
  
  uint32_t GetColor(int index) const;
  void SetColor(int index, uint32_t value);

  const uint32_t *GetColors() const {return colors;}
  int GetNumColors() const {return maxColors;}

 private:
  int maxColors;
  uint32_t colors[MAX_COLORS];
};

class Clut {
  
public:
  
  Clut( int aId );
  ~Clut();

  int Id();

  void Decode(unsigned char* Data, int Size);

  const cSubtitlesPalette *GetPalette(int bpp) const;
private:
  
  // attributes
  int      iId;
  cSubtitlesPalette palette2;
  cSubtitlesPalette palette4;
  cSubtitlesPalette palette8;

};

#endif //__DVB_SUBTITLES_CLUT_H
