#ifndef __DVB_SUBTITLES_OBJECT_H
#define __DVB_SUBTITLES_OBJECT_H


class Renderer;
class Region;

class Object {
 
public:

  Object( int aId );
  ~Object();
  void Decode(unsigned char* PixelData, int Size, int TopLength, int BottomLength);
  // Add this object to region aRegion to position x,y
  void AddToRegion( Region* aRegion, int x, int y );
  int Id();

private:

  void SubBlock( unsigned char* Buffer, int& Index, int Size, int &x, int& y );
  void Draw( int aX, int aY, int aPixelCode, int rl = 1 );
  bool decode4BppCodeString(unsigned char* Buffer, int& Index, bool& Low, int &x, int& y);
  // attributes
  int          iId;
  Renderer*    iRenderer;

};

#endif //__DVB_SUBTITLES_OBJECT_H
