Inheritance diagram for ImageSource:
This class is kept in the utils library to keep opencv out of the basic requirements.
Definition at line 17 of file ImageSource.H.
Public Member Functions | |
ImageSource (const std::string &streamname) | |
Default non-mcp constructor. | |
ImageSource (const ConnectionStrategy &strategy, const std::string &gblName) | |
Auto-wiring constructor. | |
ImageSource (const std::string &streamname, const std::string &gblName) | |
Like the standard constructor, but explicitly sets the global name. | |
WURDEImage | getImage () |
Copies the latest published image into a WURDEImage structure so it can be processed. | |
void | publishImage (WURDEImage &image) |
Copies the WURDEImage into the data structure, updating the info as necessary, so that it can be published. | |
void | setFormat (ImageFormat format) |
Sets the format we should use on this image. | |
void | setCompression (ImageCompression compression) |
Sets the compression we should use on this image. | |
Private Attributes | |
WURDEImage | m_localImage |
ImageFormat | m_format |
ImageCompression | m_compression |
ImageSource | ( | const std::string & | streamname | ) | [inline, explicit] |
Default non-mcp constructor.
Definition at line 23 of file ImageSource.H.
References ImageTransport::data, ImageTransportDataStruct::image, ImageTransportDataStruct::imagesize, ImageTransport::setAutoPing(), and Capability::setAutoTimestamp().
ImageSource | ( | const ConnectionStrategy & | strategy, | |
const std::string & | gblName | |||
) | [inline] |
Auto-wiring constructor.
Submits a request to MCP for a stream to connect to, based on global name. ConnectionStrategy should be auto for now.
Definition at line 36 of file ImageSource.H.
References ImageTransport::data, ImageTransportDataStruct::image, ImageTransportDataStruct::imagesize, ImageTransport::setAutoPing(), and Capability::setAutoTimestamp().
ImageSource | ( | const std::string & | streamname, | |
const std::string & | gblName | |||
) | [inline] |
Like the standard constructor, but explicitly sets the global name.
Use this when starting multiple instances of the same binary, so that each instance can be assigned a separate name.
Definition at line 49 of file ImageSource.H.
References ImageTransport::data, ImageTransportDataStruct::image, ImageTransportDataStruct::imagesize, ImageTransport::setAutoPing(), and Capability::setAutoTimestamp().
WURDEImage getImage | ( | ) |
Copies the latest published image into a WURDEImage structure so it can be processed.
Consumers only.
Definition at line 7 of file ImageSource.cpp.
References ImageTransportInfoStruct::compression, WURDE::COMPRESSION_NULL, WURDE::COMPRESSION_RLE_HIGHQUALITY, WURDE::COMPRESSION_RLE_LOWQUALITY, WURDE::COMPRESSION_UNCOMPRESSED, ImageTransport::data, ImageTransportInfoStruct::format, WURDE::FORMAT_CHAR_111_RGB, WURDE::FORMAT_CHAR_111_YUV24, WURDE::FORMAT_CHAR_11_YUV422, WURDE::FORMAT_CHAR_1_GRAY, WURDE::g_error(), WURDE::g_warn(), WURDE::GCM_rleDecodeGreyLow(), WURDE::GCM_rleDecodeGreyMed(), WURDE::GCM_rleDecodePixLow(), WURDE::GCM_rleDecodePixMed(), Writable::getValue(), ImageTransportInfoStruct::height, ImageTransportDataStruct::image, ImageTransportDataStruct::imagesize, ImageTransport::info, ImageSource::m_compression, ImageSource::m_format, ImageSource::m_localImage, Capability::m_supplier, ImageTransportDataStruct::timestamp, and ImageTransportInfoStruct::width.
Referenced by GuiControl::Tick().
void publishImage | ( | WURDEImage & | image | ) |
Copies the WURDEImage into the data structure, updating the info as necessary, so that it can be published.
Suppliers only.
Definition at line 107 of file ImageSource.cpp.
References ImageTransportInfoStruct::compression, WURDE::COMPRESSION_NULL, WURDE::COMPRESSION_RLE_HIGHQUALITY, WURDE::COMPRESSION_RLE_LOWQUALITY, WURDE::COMPRESSION_UNCOMPRESSED, ImageTransport::data, ImageTransportInfoStruct::format, WURDE::FORMAT_CHAR_111_RGB, WURDE::FORMAT_CHAR_111_YUV24, WURDE::FORMAT_CHAR_11_YUV422, WURDE::FORMAT_CHAR_1_GRAY, WURDE::g_error(), WURDE::g_logdebug, WURDE::GCM_rleEncodeGreyLow(), WURDE::GCM_rleEncodeGreyMed(), WURDE::GCM_rleEncodePixLow(), WURDE::GCM_rleEncodePixMed(), Writable::getValue(), ImageTransportInfoStruct::height, ImageTransportDataStruct::image, ImageTransportDataStruct::imagesize, ImageTransport::info, ImageSource::m_compression, ImageSource::m_format, Capability::m_supplier, Time::now(), ImageTransport::publishData(), ImageTransport::publishInfo(), Writable::setValue(), ImageTransportDataStruct::timestamp, ImageTransportInfoStruct::timestamp, and ImageTransportInfoStruct::width.
Referenced by ImagePublisher::runOperator().
void setFormat | ( | ImageFormat | format | ) | [inline] |
Sets the format we should use on this image.
Definition at line 72 of file ImageSource.H.
References ImageTransportInfoStruct::format, ImageTransport::info, and ImageSource::m_format.
Referenced by ImagePublisher::initOperator().
void setCompression | ( | ImageCompression | compression | ) | [inline] |
Sets the compression we should use on this image.
Definition at line 77 of file ImageSource.H.
References ImageTransportInfoStruct::compression, ImageTransport::info, and ImageSource::m_compression.
Referenced by ImagePublisher::initOperator().
WURDEImage m_localImage [private] |
ImageFormat m_format [private] |
Definition at line 81 of file ImageSource.H.
Referenced by ImageSource::getImage(), ImageSource::publishImage(), and ImageSource::setFormat().
ImageCompression m_compression [private] |
Definition at line 82 of file ImageSource.H.
Referenced by ImageSource::getImage(), ImageSource::publishImage(), and ImageSource::setCompression().