Katana Plug-in APIs 0.1
Public Member Functions

Foundry::Katana::DataMessage Class Reference

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>

Inheritance diagram for Foundry::Katana::DataMessage:
Foundry::Katana::Message

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
[in]channelan existing NewChannel object
[in]xMinthe starting x coordinate in the channel relative to the channel's origin
[in]widththe number of pixels wide this data extends for.
[in]yMinthe starting y coordinate in the channel relative to the channel's origin.
[in]heightthe number of pixels high this data extends for.
[in]byteSkipnumber 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).
See also:
setData()
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.

Parameters:
[in]frameIDa pointer to a 16 byte array containing a unique frameID
[in]channelIDthe channel ID for the channel this data belongs to.
[in]xMinthe starting x coordinate in the channel relative to the channel's origin
[in]widththe number of pixels wide this data extends for.
[in]yMinthe starting y coordinate in the channel relative to the channel's origin.
[in]heightthe number of pixels high this data extends for.
[in]byteSkipnumber 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).
See also:
setData()

Member Function Documentation

const void* Foundry::Katana::DataMessage::dataBuffer ( ) const

Returns the data buffer that will be sent when KatanaPipe::send() is called.

Note:
If 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.

Returns:
a pointer to the start of the 16 byte array that contains the unique frame ID.
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.

Parameters:
[in]data- pointer to the array data
[in]size- size of the data to be sent.
[in]pixelDataDeleter- function that if specified .
See also:
NewChannelMessage and NewChannelMessage_v2

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator