Rect
Function
Rectangular structure for image cropping and pasting. It stores the coordinates of the upper left corner and lower right corner of a rectangle (an image).
Structure Definition
struct Rect {
Rect()
: x0(0), y0(0), x1(0), y1(0) {};
Rect(const uint32_t leftTopX, const uint32_t leftTopY,
const uint32_t rightBottomX, const uint32_t rightBottomY)
: x0(leftTopX), y0(leftTopY), x1(rightBottomX), y1(rightBottomY) {};
Rect(const Point leftTop, const Point rightBottom)
: x0(leftTop.x), y0(leftTop.y), x1(rightBottom.x), y1(rightBottom.y) {};
uint32_t x0 = 0;
uint32_t y0 = 0;
uint32_t x1 = 0;
uint32_t y1 = 0;
};
Parameter Description
Parameter |
Description |
|---|---|
x0, leftTopX |
Horizontal coordinate of the upper left corner of the rectangle. (The upper left corner of the image is taken as the origin of coordinates.) |
y0, leftTopY |
Vertical coordinate of the upper left corner of the rectangle. (The upper left corner of the image is taken as the origin of coordinates.) |
x1, rightBottomX |
Horizontal coordinate of the lower right corner of the rectangle. (The upper left corner of the image is taken as the origin of coordinates.) |
y1, rightBottomY |
Vertical coordinate of the lower right corner of the rectangle. (The upper left corner of the image is taken as the origin of coordinates.) |
leftTop |
Coordinates of the upper left corner of the rectangle in point structure. |
rightBottom |
Coordinates of the lower right corner of the rectangle in point structure. |