|
RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
|
Background thread to compress or uncompress images and generic matrices. More...
#include <Compression.h>


Public Member Functions | |
| CompressionThread (const cv::Mat &mat, const std::string &format="") | |
| Constructs a thread in compress mode. | |
| CompressionThread (const cv::Mat &bytes, bool isImage) | |
| Constructs a thread in uncompress mode. | |
| const cv::Mat & | getCompressedData () const |
| cv::Mat & | getUncompressedData () |
Public Member Functions inherited from UThread | |
| UThread (Priority priority=kPNormal) | |
| virtual | ~UThread () |
| void | start () |
| void | kill () |
| void | join (bool killFirst=false) |
| void | setPriority (Priority priority) |
| void | setAffinity (int cpu=0) |
| bool | isCreating () const |
| bool | isRunning () const |
| bool | isIdle () const |
| bool | isKilled () const |
| Handle | getThreadHandle () const |
| unsigned long | getThreadId () const |
Public Member Functions inherited from UThreadC< void > | |
| int | Create (Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| int | Create (unsigned long &ThreadId, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| int | Create (Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
| int | Create (unsigned long &ThreadId, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const |
Protected Member Functions | |
| virtual void | mainLoop () |
Additional Inherited Members | |
Public Types inherited from UThread | |
| enum | Priority { kPLow , kPBelowNormal , kPNormal , kPAboveNormal , kPRealTime } |
Public Types inherited from UThreadC< void > | |
| typedef THREAD_HANDLE | Handle |
| typedef void(* | Handler) () |
| typedef THREAD_HANDLE | Handle |
| typedef void(* | Handler) () |
Static Public Member Functions inherited from UThread | |
| static unsigned long | currentThreadId () |
Static Public Member Functions inherited from UThreadC< void > | |
| static int | Create (const Handler &Function, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) |
| static int | Join (Handle H) |
| static int | Kill (Handle H) |
| static int | Detach (Handle H) |
| static int | Create (const Handler &Function, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) |
| static int | Join (const Handle &H) |
| static int | Kill (const Handle &H) |
| static int | Detach (const Handle &H) |
Static Protected Member Functions inherited from UThreadC< void > | |
| static void | Exit () |
| static void | TestCancel () |
| static Handle | Self () |
| static void | Exit () |
| static void | TestCancel () |
| static int | Self () |
Background thread to compress or uncompress images and generic matrices.
In compress mode, pass a source matrix to the constructor with an optional image format (".png", ".jpg", ".rvl", or empty for zlib data). In uncompress mode, pass compressed bytes and set isImage accordingly. Call UThread::start() then UThread::join() to obtain the result from getCompressedData() or getUncompressedData().
Example compression:
Example uncompression:
Definition at line 67 of file Compression.h.
| rtabmap::CompressionThread::CompressionThread | ( | const cv::Mat & | mat, |
| const std::string & | format = "" |
||
| ) |
Constructs a thread in compress mode.
| mat | Source image or data matrix to compress. |
| format | Image format: ".png", ".jpg", ".rvl", or empty for zlib (compressData2). |
| rtabmap::CompressionThread::CompressionThread | ( | const cv::Mat & | bytes, |
| bool | isImage | ||
| ) |
Constructs a thread in uncompress mode.
| bytes | Compressed bytes (CV_8UC1). |
| isImage | If true, decode as image; otherwise decode as zlib data. |
|
inline |
CV_8UC1), valid after compress mode completes. Definition at line 83 of file Compression.h.
|
inline |
Definition at line 85 of file Compression.h.
|
protectedvirtual |
Pure virtual method mainLoop(). The inner loop of the thread. This method is called repetitively until the thread is killed. Note that if kill() is called in mainLoopBegin(), mainLoop() is not called, terminating immediately the thread.
Implements UThread.