/* LICENSE:
  =========================================================================
    CMPack'04 Source Code Release for OPEN-R SDK 1.1.5-r2 for ERS7
    Copyright (C) 2004 Multirobot Lab [Project Head: Manuela Veloso]
    School of Computer Science, Carnegie Mellon University
    All rights reserved.
  ========================================================================= */

#ifndef INCLUDED_VisionRLEPacketDecoder_h
#define INCLUDED_VisionRLEPacketDecoder_h

#include "../../../agent/Vision/VisionInterface.h"

class RobotDataPacket;

#include "PacketDecoder.h"

using namespace VisionInterface;

/*------------------------------------------------------------------
CLASS
  VisionRLEPacketDecoder

DESCRIPTION
  Decodes vision RLE data into an image.
------------------------------------------------------------------*/
class VisionRLEPacketDecoder : public PacketDecoder {
public:
  VisionRLEPacketDecoder(uchar bad_color) :
    badColor(bad_color)
  {}

  bool decode(double *angles,RobotDataPacket *packet);
  bool decode(int image_x_size,int image_y_size,uchar *img,RobotDataPacket *packet);
  bool decode(int &image_x_size,int &image_y_size, uchar *img,
	      int max_image_x_size,int max_image_y_size,RobotDataPacket *packet);
 private:
  uchar badColor;
};

#endif
