|
Katana Plug-in APIs 0.1
|
The DataMessage class encapsulates the message sent to the Katana Catalog Server (KCS) which actually contains image data for a given channel. More...
#include <DataMessage.h>
Public Member Functions | |
| DataMessage (const NewChannelMessage &channel, uint32_t xMin=0, uint32_t width=0, uint32_t yMin=0, uint32_t height=0, uint32_t byteSkip=0) | |
| Create a new instance of a DataMessage message using an existing NewChannel object to obtain the unique frame ID and channel ID. | |
| DataMessage (const uint8_t *frameID, uint16_t channelID=0, uint32_t xMin=0, uint32_t width=0, uint32_t yMin=0, uint32_t height=0, uint32_t byteSkip=0) | |
| Create a new instance of a DataMessage message using a pointer to a 16 byte array containing a unique frame ID. | |
| virtual | ~DataMessage () |
| Destroy the DataMessage instance and free any resources it holds. | |
| void | setData (const void *data, uint32_t size, FnPixelDataDeleter pixelDataDeleter=NULL) |
| Set the data payload for this DataMessage. | |
| const uint8_t * | frameUUID () const |
| Get the unique 128 bit identifier that is assigned to the frame this data message is a member of. | |
| const void * | dataBuffer () const |
Returns the data buffer that will be sent when KatanaPipe::send() is called. | |
The DataMessage class encapsulates the message sent to the Katana Catalog Server (KCS) which actually contains image data for a given channel.
The DataMessage message should be sent down the KatanaPipe after a NewFrame & NewChannel messages have been sent.
A DataMessage represents a region of pixel data within a particular channel. The region may be as small as 1 pixel or as large as the whole channel. i.e. you can send the entire channel's data in on DataMessage.
Any chunks of data passed to the DataMessage will be copied by the instance and sent asynchronously on an I/O thread.
| Foundry::Katana::DataMessage::DataMessage | ( | const NewChannelMessage & | channel, |
| uint32_t | xMin = 0, |
||
| uint32_t | width = 0, |
||
| uint32_t | yMin = 0, |
||
| uint32_t | height = 0, |
||
| uint32_t | byteSkip = 0 |
||
| ) |
Create a new instance of a DataMessage message using an existing NewChannel object to obtain the unique frame ID and channel ID.
The default constructor will create a DataMessage belonging to the specified channel with all values set to 0 and an empty data buffer.
| [in] | channel | an existing NewChannel object |
| [in] | xMin | the starting x coordinate in the channel relative to the channel's origin |
| [in] | width | the number of pixels wide this data extends for. |
| [in] | yMin | the starting y coordinate in the channel relative to the channel's origin. |
| [in] | height | the number of pixels high this data extends for. |
| [in] | byteSkip | number of bytes to skip over to get to next pixel data (this is also stored in the channel data but, added here if the data packets differ for any reason). |
| Foundry::Katana::DataMessage::DataMessage | ( | const uint8_t * | frameID, |
| uint16_t | channelID = 0, |
||
| uint32_t | xMin = 0, |
||
| uint32_t | width = 0, |
||
| uint32_t | yMin = 0, |
||
| uint32_t | height = 0, |
||
| uint32_t | byteSkip = 0 |
||
| ) |
Create a new instance of a DataMessage message using a pointer to a 16 byte array containing a unique frame ID.
The default constructor will create a DataMessage belonging to the specified channel with all values set to 0 and an empty data buffer.
| [in] | frameID | a pointer to a 16 byte array containing a unique frameID |
| [in] | channelID | the channel ID for the channel this data belongs to. |
| [in] | xMin | the starting x coordinate in the channel relative to the channel's origin |
| [in] | width | the number of pixels wide this data extends for. |
| [in] | yMin | the starting y coordinate in the channel relative to the channel's origin. |
| [in] | height | the number of pixels high this data extends for. |
| [in] | byteSkip | number of bytes to skip over to get to next pixel data (this is also stored in the channel data but, added here if the data packets differ for any reason). |
| const void* Foundry::Katana::DataMessage::dataBuffer | ( | ) | const |
Returns the data buffer that will be sent when KatanaPipe::send() is called.
setData() was called with an FnPixelDataDeleter function this method will return NULL after a call to KatanaPipe::send(). | const uint8_t* Foundry::Katana::DataMessage::frameUUID | ( | ) | const |
Get the unique 128 bit identifier that is assigned to the frame this data message is a member of.
| void Foundry::Katana::DataMessage::setData | ( | const void * | data, |
| uint32_t | size, | ||
| FnPixelDataDeleter | pixelDataDeleter = NULL |
||
| ) |
Set the data payload for this DataMessage.
Sets the data payload for this message to the buffer pointed to by data by copying it into an internal buffer.
Data pointed to by data will remain under the control of the caller unless the user provides an FnPixelDataDeleter. In which case, the DataMessage will take ownership of the buffer and call the free function when the buffer is no longer required. If using an FnPixelDataDeleter it is not safe to access the data buffer once KatanaPipe::send() has been called.
Note: 4-channel color data is expected to be encoded as ARGB unless modified by the NewChannelMessage.
| [in] | data | - pointer to the array data |
| [in] | size | - size of the data to be sent. |
| [in] | pixelDataDeleter | - function that if specified . |
1.7.3