mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Class to interface with an ImageStreamIO image in shared memory.
Use with Eigen::Map (aliased as mx::improc::eigenMap)
Once you have changed something via the Eigen::Map you want to notify others connected to the stream via
Definition at line 146 of file milkImage.hpp.
#include <improc/milkImage.hpp>
Public Types | |
typedef _dataT | dataT |
The data type. More... | |
Public Member Functions | |
milkImage () | |
Default c'tor. More... | |
milkImage (const std::string &imname) | |
Constructor which opens the specified image. More... | |
void | open (const std::string &imname) |
Open and connect to an image, allocating the eigenMap. More... | |
void | create (const std::string &imname, uint32_t sz0, uint32_t sz1) |
Create and connect to an image, allocating the eigenMap. More... | |
bool | valid () |
Checks if the image is connected and is still the same format as when connected. More... | |
void | reopen () |
Reopens the image. More... | |
operator eigenMap< dataT > () | |
Conversion operator returns an eigenMap. More... | |
void | post () |
Update the metadata and post all semaphores. More... | |
Protected Attributes | |
std::string | m_name |
The image name, from name.im.shm (the .im.shm should not be given). More... | |
IMAGE * | m_image {nullptr} |
Pointer to the ImageStreamIO IMAGE structure. More... | |
uint64_t | m_size_0 {0} |
The size[0] of the image when last opened. More... | |
uint64_t | m_size_1 {0} |
The size[1] of the image when last opened. More... | |
typedef _dataT mx::improc::milkImage< _dataT >::dataT |
The data type.
Definition at line 150 of file milkImage.hpp.
mx::improc::milkImage< dataT >::milkImage |
Default c'tor.
Definition at line 234 of file milkImage.hpp.
mx::improc::milkImage< dataT >::milkImage | ( | const std::string & | imname | ) |
Constructor which opens the specified image.
[in] | imname | The image name, from name.im.shm (the .im.shm should not be given). |
Definition at line 239 of file milkImage.hpp.
void mx::improc::milkImage< dataT >::create | ( | const std::string & | imname, |
uint32_t | sz0, | ||
uint32_t | sz1 | ||
) |
Create and connect to an image, allocating the eigenMap.
std::invalid_argument | if the image type_code does not match dataT. |
[in] | imname | The image name, for name.im.shm (the .im.shm should not be given). |
[in] | sz0 | the x size of the image |
[in] | sz1 | the y size of the image |
Definition at line 279 of file milkImage.hpp.
void mx::improc::milkImage< dataT >::open | ( | const std::string & | imname | ) |
Open and connect to an image, allocating the eigenMap.
std::invalid_argument | if the image type_code does not match dataT. |
[in] | imname | The image name, from name.im.shm (the .im.shm should not be given). |
Definition at line 245 of file milkImage.hpp.
mx::improc::milkImage< dataT >::operator eigenMap< dataT > |
Conversion operator returns an eigenMap.
Use this like
but with caution:
Note: we assume this does a move
mx::err::mxException | if the image is not opened |
Definition at line 323 of file milkImage.hpp.
void mx::improc::milkImage< dataT >::post |
Update the metadata and post all semaphores.
mx::err::mxException | if the image is not opened |
Definition at line 380 of file milkImage.hpp.
void mx::improc::milkImage< dataT >::reopen |
Reopens the image.
Same as
Definition at line 339 of file milkImage.hpp.
bool mx::improc::milkImage< dataT >::valid |
Checks if the image is connected and is still the same format as when connected.
Checks on pointer value, size[], and data_type.
Definition at line 361 of file milkImage.hpp.
|
protected |
Pointer to the ImageStreamIO IMAGE structure.
Definition at line 156 of file milkImage.hpp.
|
protected |
The image name, from name.im.shm (the .im.shm should not be given).
Definition at line 154 of file milkImage.hpp.
|
protected |
The size[0] of the image when last opened.
Definition at line 160 of file milkImage.hpp.
|
protected |
The size[1] of the image when last opened.
Definition at line 162 of file milkImage.hpp.