libcamera: geometry: Rename Rectangle fields
The Rectangle class members that represents the rectangle horizontal and vertical sizes are named 'w' and 'h', in contrast with the Size and SizeRange classes which use 'width' and 'height', resulting in having to look at class definition every time to know which names to use. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
66a1928a0a
commit
96653be728
5 changed files with 16 additions and 16 deletions
|
@ -15,8 +15,8 @@ namespace libcamera {
|
||||||
struct Rectangle {
|
struct Rectangle {
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
unsigned int w;
|
unsigned int width;
|
||||||
unsigned int h;
|
unsigned int height;
|
||||||
|
|
||||||
const std::string toString() const;
|
const std::string toString() const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -40,12 +40,12 @@ namespace libcamera {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var Rectangle::w
|
* \var Rectangle::width
|
||||||
* \brief The distance between the left and right sides
|
* \brief The distance between the left and right sides
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \var Rectangle::h
|
* \var Rectangle::height
|
||||||
* \brief The distance between the top and bottom sides
|
* \brief The distance between the top and bottom sides
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ const std::string Rectangle::toString() const
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
ss << "(" << x << "x" << y << ")/" << w << "x" << h;
|
ss << "(" << x << "x" << y << ")/" << width << "x" << height;
|
||||||
|
|
||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ const std::string Rectangle::toString() const
|
||||||
bool operator==(const Rectangle &lhs, const Rectangle &rhs)
|
bool operator==(const Rectangle &lhs, const Rectangle &rhs)
|
||||||
{
|
{
|
||||||
return lhs.x == rhs.x && lhs.y == rhs.y &&
|
return lhs.x == rhs.x && lhs.y == rhs.y &&
|
||||||
lhs.w == rhs.w && lhs.h == rhs.h;
|
lhs.width == rhs.width && lhs.height == rhs.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1132,8 +1132,8 @@ int ImgUDevice::configureInput(const Size &size,
|
||||||
Rectangle rect = {
|
Rectangle rect = {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.w = inputFormat->size.width,
|
.width = inputFormat->size.width,
|
||||||
.h = inputFormat->size.height,
|
.height = inputFormat->size.height,
|
||||||
};
|
};
|
||||||
ret = imgu_->setCrop(PAD_INPUT, &rect);
|
ret = imgu_->setCrop(PAD_INPUT, &rect);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
|
@ -355,8 +355,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,
|
||||||
|
|
||||||
sel.r.left = rect->x;
|
sel.r.left = rect->x;
|
||||||
sel.r.top = rect->y;
|
sel.r.top = rect->y;
|
||||||
sel.r.width = rect->w;
|
sel.r.width = rect->width;
|
||||||
sel.r.height = rect->h;
|
sel.r.height = rect->height;
|
||||||
|
|
||||||
int ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);
|
int ret = ioctl(VIDIOC_SUBDEV_S_SELECTION, &sel);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -368,8 +368,8 @@ int V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,
|
||||||
|
|
||||||
rect->x = sel.r.left;
|
rect->x = sel.r.left;
|
||||||
rect->y = sel.r.top;
|
rect->y = sel.r.top;
|
||||||
rect->w = sel.r.width;
|
rect->width = sel.r.width;
|
||||||
rect->h = sel.r.height;
|
rect->height = sel.r.height;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1127,8 +1127,8 @@ int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect)
|
||||||
|
|
||||||
sel.r.left = rect->x;
|
sel.r.left = rect->x;
|
||||||
sel.r.top = rect->y;
|
sel.r.top = rect->y;
|
||||||
sel.r.width = rect->w;
|
sel.r.width = rect->width;
|
||||||
sel.r.height = rect->h;
|
sel.r.height = rect->height;
|
||||||
|
|
||||||
int ret = ioctl(VIDIOC_S_SELECTION, &sel);
|
int ret = ioctl(VIDIOC_S_SELECTION, &sel);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -1139,8 +1139,8 @@ int V4L2VideoDevice::setSelection(unsigned int target, Rectangle *rect)
|
||||||
|
|
||||||
rect->x = sel.r.left;
|
rect->x = sel.r.left;
|
||||||
rect->y = sel.r.top;
|
rect->y = sel.r.top;
|
||||||
rect->w = sel.r.width;
|
rect->width = sel.r.width;
|
||||||
rect->h = sel.r.height;
|
rect->height = sel.r.height;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue