Skip to content
Snippets Groups Projects

feature/frame class

Merged Sebastian Hahta requested to merge feature/stereovideo-refactor into master
Files
6
@@ -56,6 +56,7 @@ public:
/* @brief Method to get reference to the channel content
* @param Channel type
* @param CUDA stream
* @returns Const reference to channel data
*
* Result is valid only if hasChannel() is true. Host/Gpu transfer is
@@ -63,17 +64,21 @@ public:
* changed by calling setChannel(). Return value valid only if
* hasChannel(channel) is true.
*/
template <typename T> const T& getChannel(const ftl::rgbd::channel_t& channel, cv::cuda::Stream& stream);
template <typename T> const T& getChannel(const ftl::rgbd::channel_t& channel);
/* @brief Method to set/modify channel content
* @param Channel type
* @returns Reference to channel data
*
* Returns non-const reference to channel data. Invalidates other copies of
* the data (host/gpu) for the specified channel, next time getChannel() is
* called a memory transfer may occur.
* Returns non-const reference to channel memory. Invalidates other copies
* of the data (host/gpu) for the specified channel, next time getChannel()
* is called a memory transfer may occur.
*
* NOTE: If user of setChannel<T>() wants to modify contents instead of
* replacing them, getChannel<T>() needs to be called first to
* ensure there is valid contents in the returned reference!
* (TODO: interface could be improved)
*/
template <typename T> T& setChannel(const ftl::rgbd::channel_t& channel);
@@ -108,9 +113,13 @@ private:
std::vector<uint> available_;
};
template<> const cv::Mat& Frame::getChannel(const ftl::rgbd::channel_t& channel, cv::cuda::Stream& stream);
template<> const cv::cuda::GpuMat& Frame::getChannel(const ftl::rgbd::channel_t& channel, cv::cuda::Stream& stream);
template<> const cv::Mat& Frame::getChannel(const ftl::rgbd::channel_t& channel);
template<> cv::Mat& Frame::setChannel(const ftl::rgbd::channel_t& channel);
template<> const cv::cuda::GpuMat& Frame::getChannel(const ftl::rgbd::channel_t& channel);
template<> cv::Mat& Frame::setChannel(const ftl::rgbd::channel_t& channel);
template<> cv::cuda::GpuMat& Frame::setChannel(const ftl::rgbd::channel_t& channel);
}
Loading