|
Katana Plug-in APIs 0.1
|
00001 // Copyright (c) 2012 The Foundry Visionmongers Ltd. All Rights Reserved. 00002 00003 #ifndef NEW_CHANNEL_MESSAGE_H 00004 #define NEW_CHANNEL_MESSAGE_H 00005 00006 #include <stdint.h> 00007 #include <string> 00008 00009 #include "Message.h" 00010 00011 namespace Foundry 00012 { 00013 namespace Katana 00014 { 00015 class NewFrameMessage; 00016 00037 class NewChannelMessage : public Message 00038 { 00039 public: 00069 NewChannelMessage(const NewFrameMessage& frame, 00070 uint16_t channelID = 0, 00071 uint32_t height = 0, 00072 uint32_t width = 0, 00073 int xorigin = 0, 00074 int yorigin = 0, 00075 float sampleRate1 = 0.0, 00076 float sampleRate2 = 0.0, 00077 uint32_t dataSize = 0); 00078 00106 NewChannelMessage(const uint8_t* frameID, 00107 uint16_t channelID = 0, 00108 uint32_t height = 0, 00109 uint32_t width = 0, 00110 int xorigin = 0, 00111 int yorigin = 0, 00112 float sampleRate1 = 0.0, 00113 float sampleRate2 = 0.0, 00114 uint32_t dataSize = 0); 00115 00118 virtual ~NewChannelMessage() {} 00119 00130 int setChannelName(const std::string& name); 00131 00137 void setChannelDimensions(uint32_t width, uint32_t height); 00138 00146 void setChannelOrigin(int ox, int oy); 00147 00157 void setDataSize(uint32_t dataSize); 00158 00166 void setChannelID(uint16_t channelID); 00167 00168 void setSampleRate(const float* sampleRate); 00169 00176 const uint8_t* frameUUID() const; 00177 00178 uint16_t channelID() const; 00179 uint32_t channelHeight() const; 00180 uint32_t channelWidth() const; 00181 int channelXOrigin() const; 00182 int channelYOrigin() const; 00183 uint32_t channelDataSize() const; 00184 const std::string& channelName() const; 00185 uint32_t channelNameLength() const; 00186 const float* sampleRate() const; 00187 bool isIdPass() const; 00188 00189 protected: 00190 explicit NewChannelMessage(FnMessageHandle handle) 00191 : Message(handle), _channelName() 00192 { 00193 } 00194 00195 private: 00196 NewChannelMessage(const NewChannelMessage& rhs); 00197 NewChannelMessage& operator=(const NewChannelMessage& rhs); 00198 00199 mutable std::string _channelName; 00200 }; 00201 00219 class NewChannelMessage_v2 : public NewChannelMessage 00220 { 00221 public: 00222 enum PixelLayout 00223 { 00224 ARGB = 0, 00225 RGBA = 1, 00226 UNDEFINED = 0xFF 00227 }; 00228 00254 NewChannelMessage_v2(const uint8_t* frameID, 00255 uint16_t channelID = 0, 00256 PixelLayout pixelLayout = ARGB, 00257 uint32_t height = 0, 00258 uint32_t width = 0, 00259 int xorigin = 0, 00260 int yorigin = 0, 00261 float sampleRate1 = 0.0, 00262 float sampleRate2 = 0.0, 00263 uint32_t dataSize = 0); 00264 00292 NewChannelMessage_v2(const NewFrameMessage& frame, 00293 uint16_t channelID = 0, 00294 PixelLayout pixelLayout = ARGB, 00295 uint32_t height = 0, 00296 uint32_t width = 0, 00297 int xorigin = 0, 00298 int yorigin = 0, 00299 float sampleRate1 = 0.0, 00300 float sampleRate2 = 0.0, 00301 uint32_t dataSize = 0); 00302 00305 virtual ~NewChannelMessage_v2() {} 00306 00313 void setPixelLayout(PixelLayout pixelLayout); 00314 PixelLayout pixelLayout() const; 00315 00316 private: 00317 NewChannelMessage_v2(const NewChannelMessage_v2& rhs); 00318 NewChannelMessage_v2& operator=(const NewChannelMessage_v2& rhs); 00319 }; 00320 00324 } // namespace Katana 00325 } // namespace Foundry 00326 00327 #endif
1.7.3