00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 #include "jaus/extras/video/queryimage.h" 00041 00042 using namespace JAUS; 00043 00044 00053 QueryImage::QueryImage(const Address& dest, 00054 const Address& src) : Message(QUERY_IMAGE, dest, src) 00055 { 00056 mCameraID = 0; 00057 mFormat = Image::RAW; 00058 } 00059 00060 00066 QueryImage::QueryImage(const QueryImage& message) : Message(QUERY_IMAGE) 00067 { 00068 *this = message; 00069 } 00070 00071 00077 QueryImage::~QueryImage() 00078 { 00079 00080 } 00081 00082 00094 int QueryImage::WriteMessageBody(Packet& packet) const 00095 { 00096 int total = 0; 00097 int expected = BYTE_SIZE*2; 00098 00099 total += packet.WriteByte(mCameraID); 00100 total += packet.WriteByte((Byte)mFormat); 00101 00102 return total == expected ? total : -1; 00103 } 00104 00105 00117 int QueryImage::ReadMessageBody(const Packet& packet) 00118 { 00119 int total = 0; 00120 int expected = BYTE_SIZE*2; 00121 00122 total += packet.Read(mCameraID); 00123 total += packet.Read((Byte &)mFormat); 00124 00125 return total == expected ? total : -1; 00126 } 00127 00128 00134 void QueryImage::ClearMessageBody() 00135 { 00136 mFormat = Image::RAW; 00137 mCameraID = 0; 00138 } 00139 00140 00146 QueryImage& QueryImage::operator =(const QueryImage& message) 00147 { 00148 if(this != &message) 00149 { 00150 CopyHeaderData(&message); 00151 mCameraID = message.mCameraID; 00152 mFormat = message.mFormat; 00153 } 00154 return *this; 00155 } 00156 00157 00158 /* End of File */