|
libCZI
Reading CZI documents made easy
|
#include <libCZI_Pixels.h>
Public Member Functions | |
| ScopedBitmapLocker (tBitmap bmData) | |
| ScopedBitmapLocker (const ScopedBitmapLocker< tBitmap > &other) | |
| ScopedBitmapLocker (ScopedBitmapLocker< tBitmap > &&other) noexcept | |
| move constructor | |
| ScopedBitmapLocker< tBitmap > & | operator= (ScopedBitmapLocker< tBitmap > &&other) noexcept |
| move assignment | |
Additional Inherited Members | |
Public Attributes inherited from libCZI::BitmapLockInfo | |
| void * | ptrData |
| Not currently used, to be ignored. | |
| void * | ptrDataRoi |
| The pointer to the first (top-left) pixel of the bitmap. | |
| std::uint32_t | stride |
The stride of the bitmap data (pointed to by ptrDataRoi). | |
| std::uint64_t | size |
The size of the bitmap data (pointed to by ptrDataRoi) in bytes. | |
A helper class used to scope the lock state of a bitmap.
It is intended to be used like this:
For convenience two typedef are provided: ScopedBitmapLockerP and ScopedBitmapLockerSP for use with the types IBitmapData* and std::shared_ptr<IBitmapData>.
So in above sample we could have used
This utility is intended to help adhering to the RAII-pattern, since it makes writing exception-safe code easier - in case of an exception (within the scope of the ScopedBitmapLocker object) the bitmap's Unlock method will be called (which is cumbersome to achieve otherwise).
|
inlineexplicit |
Constructor taking the object for which we provide the scope-guard.
| bmData | The object for which we are to provide the scope-guard. |
|
inline |
Copy-Constructor .
| other | The other object. |