27 bool IsValid()
const {
return this->w >= 0 && this->h >= 0; }
30 bool IsNonEmpty()
const {
return this->w > 0 && this->h > 0; }
38 if (is.
w <= 0 || is.
h <= 0)
64 const int x1 = (std::max)(a.
x, b.
x);
65 const int x2 = (std::min)(a.
x + a.
w, b.
x + b.
w);
66 const int y1 = (std::max)(a.
y, b.
y);
67 const int y2 = (std::min)(a.
y + a.
h, b.
y + b.
h);
68 if (x2 >= x1 && y2 >= y1)
70 return IntRect{ x1, y1, x2 - x1, y2 - y1 };
283 template <
typename tBitmap>
295 auto lockInfo = bmData->Lock();
296 this->
ptrData = lockInfo.ptrData;
298 this->
stride = lockInfo.stride;
299 this->
size = lockInfo.size;
306 auto lockInfo = other.bmData->Lock();
307 this->
ptrData = lockInfo.ptrData;
309 this->
stride = lockInfo.stride;
310 this->
size = lockInfo.size;
316 *
this = std::move(other);
326 this->bmData->Unlock();
329 this->bmData = std::move(other.bmData);
332 this->
stride = other.stride;
333 this->
size = other.size;
334 other.ptrData = other.ptrDataRoi =
nullptr;
335 other.bmData = tBitmap();
345 this->bmData->Unlock();
364 os <<
"(" << rect.
x <<
"," << rect.
y <<
"," << rect.
w <<
"," << rect.
h <<
")";
374 os <<
"(" << size.
w <<
"," << size.
h <<
")";
Definition libCZI_Pixels.h:197
std::uint32_t GetHeight() const
Definition libCZI_Pixels.h:236
virtual PixelType GetPixelType() const =0
std::uint32_t GetWidth() const
Definition libCZI_Pixels.h:231
virtual IntSize GetSize() const =0
virtual BitmapLockInfo Lock()=0
Definition libCZI_Pixels.h:285
ScopedBitmapLocker< tBitmap > & operator=(ScopedBitmapLocker< tBitmap > &&other) noexcept
move assignment
Definition libCZI_Pixels.h:320
ScopedBitmapLocker(const ScopedBitmapLocker< tBitmap > &other)
Definition libCZI_Pixels.h:304
ScopedBitmapLocker(tBitmap bmData)
Definition libCZI_Pixels.h:293
ScopedBitmapLocker(ScopedBitmapLocker< tBitmap > &&other) noexcept
move constructor
Definition libCZI_Pixels.h:314
External interfaces, classes, functions and structs are found in the namespace "libCZI".
Definition libCZI.h:31
std::ostream & operator<<(std::ostream &os, const IntRect &rect)
Definition libCZI_Pixels.h:362
ScopedBitmapLocker< std::shared_ptr< IBitmapData > > ScopedBitmapLockerSP
Defines an alias representing the scoped bitmap locker for use with a shared_ptr of type libCZI::IBit...
Definition libCZI_Pixels.h:354
@ None
No camera processing was used.
CompressionMode
An enum specifying the compression method.
Definition libCZI_Pixels.h:161
@ JpgXr
The data is JPG-XR-compressed.
@ Jpg
The data is JPG-compressed.
@ Zstd1
The data contains a header, followed by a zstd-compressed block.
@ Zstd0
The data is compressed with zstd.
@ UnCompressed
The data is uncompressed.
SubBlockPyramidType
Definition libCZI_Pixels.h:174
@ MultiSubBlock
The subblock is a pyramid subblock, and it covers multiple subblocks of the lower layer.
@ SingleSubBlock
The subblock is a pyramid subblock, and it covers a single subblock of the lower layer (or: it is a m...
@ Default
An enum constant representing the default option (which is JXRLib)
CZIFrameOfReference
Values that represent different frame of reference.
Definition libCZI_Pixels.h:86
@ Invalid
Invalid frame of reference.
@ PixelCoordinateSystem
The pixel coordinate system.
@ RawSubBlockCoordinateSystem
The raw sub-block coordinate system.
ScopedBitmapLocker< IBitmapData * > ScopedBitmapLockerP
Defines an alias representing the scoped bitmap locker for use with libCZI::IBitmapData.
Definition libCZI_Pixels.h:351
PixelType
An enum representing a pixel-type.
Definition libCZI_Pixels.h:144
@ Gray64ComplexFloat
Currently not supported in libCZI.
@ Gray16
Grayscale 16-bit unsigned.
@ Bgra32
Currently not supported in libCZI.
@ Gray64Float
Currently not supported in libCZI.
@ Gray32Float
Grayscale 4 byte float.
@ Bgr48
BGR-color 16-bytes triples (memory order B, G, R).
@ Gray32
Currently not supported in libCZI.
@ Bgr192ComplexFloat
Currently not supported in libCZI.
@ Bgr24
BGR-color 8-bytes triples (memory order B, G, R).
@ Gray8
Grayscale 8-bit unsigned.
@ Bgr96Float
BGR-color 4 byte float triples (memory order B, G, R).
Information about a locked bitmap - allowing direct access to the image data in memory.
Definition libCZI_Pixels.h:183
std::uint64_t size
The size of the bitmap data (pointed to by ptrDataRoi) in bytes.
Definition libCZI_Pixels.h:187
void * ptrData
Not currently used, to be ignored.
Definition libCZI_Pixels.h:184
std::uint32_t stride
The stride of the bitmap data (pointed to by ptrDataRoi).
Definition libCZI_Pixels.h:186
void * ptrDataRoi
The pointer to the first (top-left) pixel of the bitmap.
Definition libCZI_Pixels.h:185
A rectangle (with double coordinates).
Definition libCZI_Pixels.h:109
double h
The height of the rectangle.
Definition libCZI_Pixels.h:113
double w
The width of the rectangle.
Definition libCZI_Pixels.h:112
double y
The y-coordinate of the upper-left point of the rectangle.
Definition libCZI_Pixels.h:111
void Invalidate()
Invalidates this object.
Definition libCZI_Pixels.h:116
double x
The x-coordinate of the upper-left point of the rectangle.
Definition libCZI_Pixels.h:110
This structure combines a point with a specification of the frame of reference.
Definition libCZI_Pixels.h:102
libCZI::CZIFrameOfReference frame_of_reference
The frame of reference.
Definition libCZI_Pixels.h:103
IntPoint point
The point.
Definition libCZI_Pixels.h:104
A point (with integer coordinates).
Definition libCZI_Pixels.h:79
This structure combines a rectangle with a specification of the frame of reference.
Definition libCZI_Pixels.h:95
libCZI::CZIFrameOfReference frame_of_reference
The frame of reference.
Definition libCZI_Pixels.h:96
libCZI::IntRect rectangle
The rectangle.
Definition libCZI_Pixels.h:97
A rectangle (with integer coordinates).
Definition libCZI_Pixels.h:17
int h
The height of the rectangle.
Definition libCZI_Pixels.h:21
bool IsNonEmpty() const
Returns a boolean indicating whether this rectangle is valid and non-empty.
Definition libCZI_Pixels.h:30
int y
The y-coordinate of the upper-left point of the rectangle.
Definition libCZI_Pixels.h:19
IntRect Intersect(const IntRect &r) const
Definition libCZI_Pixels.h:51
int x
The x-coordinate of the upper-left point of the rectangle.
Definition libCZI_Pixels.h:18
bool IntersectsWith(const IntRect &r) const
Definition libCZI_Pixels.h:35
static IntRect Intersect(const IntRect &a, const IntRect &b)
Definition libCZI_Pixels.h:62
int w
The width of the rectangle.
Definition libCZI_Pixels.h:20
bool IsValid() const
Returns a boolean indicating whether this rectangle contains valid information.
Definition libCZI_Pixels.h:27
void Invalidate()
Invalidates this object.
Definition libCZI_Pixels.h:24
A structure representing a size (width and height) in integers.
Definition libCZI_Pixels.h:121
std::uint32_t h
The height.
Definition libCZI_Pixels.h:123
std::uint32_t w
The width.
Definition libCZI_Pixels.h:122
A structure representing an R-G-B-color triple (as bytes).
Definition libCZI_Pixels.h:128
std::uint8_t b
The blue component.
Definition libCZI_Pixels.h:131
std::uint8_t g
The green component.
Definition libCZI_Pixels.h:130
std::uint8_t r
The red component.
Definition libCZI_Pixels.h:129
A structure representing an R-G-B-color triple (as floats).
Definition libCZI_Pixels.h:136
float r
The red component.
Definition libCZI_Pixels.h:137
float b
The blue component.
Definition libCZI_Pixels.h:139
float g
The green component.
Definition libCZI_Pixels.h:138