<div dir="auto"><div>Hi Jacopo,<div dir="auto"><br></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 26, 2024, 4:38 PM Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com" rel="noreferrer noreferrer noreferrer" target="_blank">jacopo.mondi@ideasonboard.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Harvey<br>
<br>
On Thu, Sep 26, 2024 at 04:29:50PM GMT, Cheng-Hao Yang wrote:<br>
> Hi Jacopo,<br>
><br>
> On Thu, Sep 26, 2024, 4:03 PM Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">jacopo.mondi@ideasonboard.com</a>><br>
> wrote:<br>
><br>
> > Hi Harvey<br>
> ><br>
> > On Wed, Sep 25, 2024 at 03:09:38PM GMT, Cheng-Hao Yang wrote:<br>
> > > Hi Jacopo,<br>
> > ><br>
> > > Thank you for the patch.<br>
> > ><br>
> > > On Wed, Sep 25, 2024 at 2:36 PM Umang Jain <<a href="mailto:umang.jain@ideasonboard.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">umang.jain@ideasonboard.com</a>><br>
> > wrote:<br>
> > > ><br>
> > > > Hi Jacopo<br>
> > > ><br>
> > > > Thank you for the patch<br>
> > > ><br>
> > > > On 24/09/24 6:15 pm, Jacopo Mondi wrote:<br>
> > > > > The libcamera::Rectangle class should allow defining rectangles<br>
> > > > > regardless of the reference system where an instance is used in.<br>
> > > > ><br>
> > > > > However the class documentation assumes the reference system origin<br>
> > > > > point to be in the visual top-left side and that rectangles are<br>
> > > > > constructed by specifying the top-left corner position and sizes.<br>
> > > > ><br>
> > > > > However this is ambiguous when using a different reference system as,<br>
> > > > > in example, constructing a rectangle (x, y, w, h) in the following<br>
> > > > > scenario, with the origin corner in the top-left position, would<br>
> > require<br>
> > > > > a negative decrement along the y-axis.<br>
> > > > ><br>
> > > > >Â Â Â Â Â Â ^<br>
> > > > >Â Â Â Â Â Â |<br>
> > > > >Â Â Â Â Â y|Â Â Â o------------------<br>
> > > > >Â Â Â Â Â Â |Â Â Â |Â Â Â Â Â Â Â Â Â | h<br>
> > > > >Â Â Â Â Â Â |Â Â Â |Â Â Â Â Â Â Â Â Â |<br>
> > > > >Â Â Â Â Â Â |Â Â Â -------------------<br>
> > > > >Â Â Â Â Â Â |Â Â Â Â Â Â Â Â w<br>
> > > > >Â Â Â Â Â Â -------------------------------><br>
> > > > >Â Â Â Â Â Â (0,0)Â x<br>
> > > > ><br>
> > > > > To remove ambiguities, drop references to the visual top-left corner<br>
> > and<br>
> > > > > define the rectangle's origin corner as the corner closer to the<br>
> > > > > reference system origin point, and specify the horizontal and<br>
> > vertical<br>
> > > > > dimensions always increment along their respective axis, as in the<br>
> > > > > following example.<br>
> > > > ><br>
> > > > >Â Â Â Â Â Â ^<br>
> > > > >Â Â Â Â Â Â |<br>
> > > > >Â Â Â Â Â Â |Â Â Â -------------------<br>
> > > > >Â Â Â Â Â Â |Â Â Â ^Â Â Â Â Â Â Â Â Â | h<br>
> > > > >Â Â Â Â Â Â |Â Â Â |Â Â Â Â Â Â Â Â Â |<br>
> > > > >Â Â Â Â Â y|Â Â Â o---->-------------<br>
> > > > >Â Â Â Â Â Â |Â Â Â Â Â Â Â Â w<br>
> > > > >Â Â Â Â Â Â -------------------------------><br>
> > > > >Â Â Â Â Â Â (0,0)Â x<br>
> > > > ><br>
> > > > >Â Â Â Â Â Â (0,0)Â x<br>
> > > > >Â Â Â Â Â Â Â ------------------------------><br>
> > > > >Â Â Â Â Â Â |Â Â Â Â Â Â Â w<br>
> > > > >Â Â Â Â Â Â y|Â Â Â o---->-------------<br>
> > > > >Â Â Â Â Â Â |Â Â Â |Â Â Â Â Â Â Â Â Â | h<br>
> > > > >      |   v         |<br>
> > > > >Â Â Â Â Â Â |Â Â Â -------------------<br>
> > > > >Â Â Â Â Â Â |<br>
> > > > >Â Â Â Â Â Â V<br>
> > > > ><br>
> > > > > Also rename for consistency the Rectangle::topLeft() function to<br>
> > > > > Rectangle::origin() and update its in-tree users.<br>
> > > > ><br>
> > > > > Signed-off-by: Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">jacopo.mondi@ideasonboard.com</a>><br>
> > > > > ---<br>
> > > > >  include/libcamera/geometry.h         | 2 +-<br>
> > > > >  src/ipa/ipu3/algorithms/af.cpp        | 2 +-<br>
> > > > >  src/libcamera/geometry.cpp          | 85<br>
> > ++++++++++++++-----<br>
> > > > >  .../pipeline/rpi/common/pipeline_base.cpp   | 4 +-<br>
> > > > >  src/py/libcamera/py_geometry.cpp       | 2 +-<br>
> > > > >  test/geometry.cpp               | 8 +-<br>
> > > > >Â Â 6 files changed, 75 insertions(+), 28 deletions(-)<br>
> > > > ><br>
> > > > > diff --git a/include/libcamera/geometry.h<br>
> > b/include/libcamera/geometry.h<br>
> > > > > index 3e6f0f5d7fab..07cb0a7866fe 100644<br>
> > > > > --- a/include/libcamera/geometry.h<br>
> > > > > +++ b/include/libcamera/geometry.h<br>
> > > > > @@ -277,7 +277,7 @@ public:<br>
> > > > >Â Â Â Â Â Â Â Â return { width, height };<br>
> > > > >Â Â Â Â }<br>
> > > > ><br>
> > > > > -Â Â Â Point topLeft() const<br>
> > > > > +Â Â Â Point origin() const<br>
> > > > >Â Â Â Â {<br>
> > > > >Â Â Â Â Â Â Â Â return { x, y };<br>
> > > > >Â Â Â Â }<br>
> > > > > diff --git a/src/ipa/ipu3/algorithms/af.cpp<br>
> > b/src/ipa/ipu3/algorithms/af.cpp<br>
> > > > > index cf68fb59c49b..1b707e9dd9ab 100644<br>
> > > > > --- a/src/ipa/ipu3/algorithms/af.cpp<br>
> > > > > +++ b/src/ipa/ipu3/algorithms/af.cpp<br>
> > > > > @@ -155,7 +155,7 @@ int Af::configure(IPAContext &context, const<br>
> > IPAConfigInfo &configInfo)<br>
> > > > >Â Â Â Â * - Return the AF ROI as metadata in the Request<br>
> > > > >Â Â Â Â */<br>
> > > > >Â Â Â Â Rectangle roi = gridSize.centeredTo(bds.center());<br>
> > > > > -Â Â Â Point start = roi.topLeft();<br>
> > > > > +Â Â Â Point start = roi.origin();<br>
> > > > ><br>
> > > > >Â Â Â Â /* x_start and y_start should be even */<br>
> > > > >Â Â Â Â grid.x_start = utils::alignDown(start.x, 2);<br>
> > > > > diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp<br>
> > > > > index 000151364c7f..45ba81a99920 100644<br>
> > > > > --- a/src/libcamera/geometry.cpp<br>
> > > > > +++ b/src/libcamera/geometry.cpp<br>
> > > > > @@ -593,11 +593,39 @@ std::ostream &operator<<(std::ostream &out,<br>
> > const SizeRange &sr)<br>
> > > > >Â Â * \brief Describe a rectangle's position and dimensions<br>
> > > > >Â Â *<br>
> > > > >Â Â * Rectangles are used to identify an area of an image. They are<br>
> > specified by<br>
> > > > > - * the coordinates of top-left corner and their horizontal and<br>
> > vertical size.<br>
> > > > > + * the coordinates of the corner closer to the reference system's<br>
> > origin point<br>
> > > > > + * and by horizontal and vertical increments from there.<br>
> > > > >Â Â *<br>
> > > > > - * The measure unit of the rectangle coordinates and size, as well<br>
> > as the<br>
> > > > > - * reference point from which the Rectangle::x and Rectangle::y<br>
> > displacements<br>
> > > > > - * refers to, are defined by the context were rectangle is used.<br>
> > > > > + * The corner closer to the reference system's origin point is the<br>
> > rectangle's<br>
> > > > > + * origin corner.<br>
> > > > > + *<br>
> > > > > + * \verbatim<br>
> > > > > +<br>
> > > > > +Â o = origin corner<br>
> > > > > +<br>
> > > > > +Â Â Â Â Â ^<br>
> > > > > +Â Â Â Â Â |<br>
> > > > > +Â Â Â Â Â |Â Â Â -------------------<br>
> > > > > +Â Â Â Â Â |Â Â Â ^Â Â Â Â Â Â Â Â Â |<br>
> > > > > +Â Â Â Â Â |Â Â Â |Â Â Â Â Â Â Â Â Â |<br>
> > > > > +Â Â Â Â Â |Â Â Â o---->-------------<br>
> > > > > +Â Â Â Â Â |<br>
> > > > > +Â Â Â Â Â -------------------------------><br>
> > > > > +Â Â Â Â Â (0,0)<br>
> > > > > +<br>
> > > > > +Â Â Â Â Â (0,0)<br>
> > > > > +Â Â Â Â Â Â -------------------------------><br>
> > > > > +Â Â Â Â Â |<br>
> > > > > +Â Â Â Â Â |Â Â Â o---->-------------<br>
> > > > > +Â Â Â Â Â |Â Â Â |Â Â Â Â Â Â Â Â Â |<br>
> > > > > +     |   v         |<br>
> > > > > +Â Â Â Â Â |Â Â Â -------------------<br>
> > > > > +Â Â Â Â Â |<br>
> > > > > +Â Â Â Â Â V<br>
> > > > > +Â Â \endverbatim<br>
> > > > > + *<br>
> > > > > + * The measure unit of the rectangle coordinates and size are<br>
> > defined by the<br>
> > > > > + * context were the rectangle is used.<br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > > @@ -608,35 +636,50 @@ std::ostream &operator<<(std::ostream &out,<br>
> > const SizeRange &sr)<br>
> > > > >Â Â /**<br>
> > > > >Â Â * \fn Rectangle::Rectangle(int x, int y, const Size &size)<br>
> > > > >Â Â * \brief Construct a Rectangle with the given position and size<br>
> > > > > - * \param[in] x The horizontal coordinate of the top-left corner<br>
> > > > > - * \param[in] y The vertical coordinate of the top-left corner<br>
> > > > > + * \param[in] x The horizontal coordinate of the origin corner<br>
> > > > > + * \param[in] y The vertical coordinate of the origin corner<br>
> > > > >Â Â * \param[in] size The size<br>
> > > > > + *<br>
> > > > > + * The rectangle's origin corner is the corner closer to the<br>
> > reference system<br>
> > > > > + * origin point (0, 0).<br>
> > ><br>
> > > I think we should stick to the previous description:<br>
> > > `"origin" point defined as the point with the lower x and<br>
> > > lower y of the rectangle`, as `x` and `y` are signed integers.<br>
> > ><br>
> > > If we only support coordinates that are positive or 0, which<br>
> > > I'm not sure if it's the case, how about making the type to be<br>
> > > `unsigned int`?<br>
> > ><br>
> ><br>
> > To be honest I would rather make width and heigh signed to allow<br>
> > constructing (x, y, -w, -h)<br>
> ><br>
> ><br>
> ><br>
> ><br>
> >Â Â Â Â Â Â Â Â -------------------<br>
> >Â Â Â Â Â Â Â Â |Â Â Â Â Â Â Â Â Â ^<br>
> >Â Â Â Â Â Â Â Â |Â Â Â Â Â Â -------------><br>
> >Â Â Â Â Â Â Â Â |Â Â Â Â Â Â |Â Â Â |<br>
> >Â Â Â Â Â Â Â Â ------<-----|-----o<br>
> >Â Â Â Â Â Â Â Â Â Â Â Â Â Â |<br>
> >Â Â Â Â Â Â Â Â Â Â Â Â Â Â |<br>
> >Â Â Â Â Â Â Â Â Â Â Â Â Â Â V<br>
> ><br>
> > Not sure if it's useful or not though<br>
> ><br>
><br>
> Hmm... I find it pretty weird. What if all four corners have all negative<br>
> coordinates?<br>
><br>
><br>
<br>
Don't know, maybe if the reference system where the rectangle is used<br>
into has 4 planes and so an all-negative rectangle makes sense.<br>
<br>
My point is that we should allow users of this class to express<br>
Rectangle in any context they plan to use them. Not sure if I'm going<br>
overboard here or it makes sense.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yeah I agree, while doesn't that mean the description doesn't fit all cases, like the corner closer to the reference system origin point of a rectangle that has all negative coordinates is actually the "bottom-right" corner, and currently libcamera::Size only allows non-negative width and height [1].</div><div dir="auto"><br></div><div dir="auto">[1]: <a href="https://git.libcamera.org/libcamera/libcamera.git/tree/include/libcamera/geometry.h#n65">https://git.libcamera.org/libcamera/libcamera.git/tree/include/libcamera/geometry.h#n65</a></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
><br>
><br>
> ><br>
> > > BR,<br>
> > > Harvey<br>
> > ><br>
> > ><br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > >Â Â * \fn Rectangle::Rectangle(int x, int y, unsigned int width,<br>
> > unsigned int height)<br>
> > > > >Â Â * \brief Construct a Rectangle with the given position and size<br>
> > > > > - * \param[in] x The horizontal coordinate of the top-left corner<br>
> > > > > - * \param[in] y The vertical coordinate of the top-left corner<br>
> > > > > + * \param[in] x The horizontal coordinate of the origin corner<br>
> > > > > + * \param[in] y The vertical coordinate of the origin corner<br>
> > > > >Â Â * \param[in] width The width<br>
> > > > >Â Â * \param[in] height The height<br>
> > > > > + *<br>
> > > > > + * The rectangle's origin corner is the corner closer to the<br>
> > reference system<br>
> > > > > + * origin point (0, 0).<br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > >Â Â * \fn Rectangle::Rectangle(const Size &size)<br>
> > > > > - * \brief Construct a Rectangle of \a size with its top left corner<br>
> > located<br>
> > > > > + * \brief Construct a Rectangle of \a size with its origin corner<br>
> > located<br>
> > > > >Â Â * at (0,0)<br>
> > > > >Â Â * \param[in] size The desired Rectangle size<br>
> > > > > + *<br>
> > > > > + * The rectangle's origin corner is the corner closer to the<br>
> > reference system<br>
> > > > > + * origin point (0, 0).<br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > >Â Â * \var Rectangle::x<br>
> > > > > - * \brief The horizontal coordinate of the rectangle's top-left<br>
> > corner<br>
> > > > > + * \brief The horizontal coordinate of the rectangle's origin corner<br>
> > > > > + *<br>
> > > > > + * The rectangle's origin corner is the corner closer to the<br>
> > reference system<br>
> > > > > + * origin point (0, 0).<br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > >Â Â * \var Rectangle::y<br>
> > > > > - * \brief The vertical coordinate of the rectangle's top-left corner<br>
> > > > > + * \brief The vertical coordinate of the rectangle's origin corner<br>
> > > > > + *<br>
> > > > > + * The rectangle's origin corner is the corner closer to the<br>
> > reference system<br>
> > > > > + * origin point (0, 0).<br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > > @@ -683,9 +726,13 @@ Point Rectangle::center() const<br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > > - * \fn Point Rectangle::topLeft() const<br>
> > > > > - * \brief Retrieve the coordinates of the top left corner of this<br>
> > Rectangle<br>
> > > > > - * \return The Rectangle's top left corner<br>
> > > > > + * \fn Point Rectangle::origin() const<br>
> > > > > + * \brief Retrieve the coordinates of the origin corner of this<br>
> > Rectangle<br>
> > > > > + *<br>
> > > > > + * The rectangle's origin corner is the corner closer to the<br>
> > reference system<br>
> > > > > + * origin point (0, 0).<br>
> > > > > + *<br>
> > > > > + * \return The Rectangle's origin corner<br>
> > > ><br>
> > > > I think you can drop "corner" from "origin corner"<br>
> > > ><br>
> > > > Probably throughout the patch:<br>
> > > >Â Â Â s/origin corner/origin/<br>
> > > ><br>
> > > > Otherwise, LGTM<br>
> > > ><br>
> > > > Reviewed-by: Umang Jain <<a href="mailto:umang.jain@ideasonboard.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">umang.jain@ideasonboard.com</a>><br>
> > > > >Â Â */<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > > @@ -740,15 +787,15 @@ Rectangle &Rectangle::translateBy(const Point<br>
> > &point)<br>
> > > > >Â Â */<br>
> > > > >Â Â Rectangle Rectangle::boundedTo(const Rectangle &bound) const<br>
> > > > >Â Â {<br>
> > > > > -Â Â Â int topLeftX = std::max(x, bound.x);<br>
> > > > > -Â Â Â int topLeftY = std::max(y, bound.y);<br>
> > > > > +Â Â Â int originX = std::max(x, bound.x);<br>
> > > > > +Â Â Â int originY = std::max(y, bound.y);<br>
> > > > >Â Â Â Â int bottomRightX = std::min<int>(x + width, bound.x +<br>
> > bound.width);<br>
> > > > >Â Â Â Â int bottomRightY = std::min<int>(y + height, bound.y +<br>
> > bound.height);<br>
> > > > ><br>
> > > > > -Â Â Â unsigned int newWidth = std::max(bottomRightX - topLeftX, 0);<br>
> > > > > -Â Â Â unsigned int newHeight = std::max(bottomRightY - topLeftY, 0);<br>
> > > > > +Â Â Â unsigned int newWidth = std::max(bottomRightX - originX, 0);<br>
> > > > > +Â Â Â unsigned int newHeight = std::max(bottomRightY - originY, 0);<br>
> > > > ><br>
> > > > > -Â Â Â return { topLeftX, topLeftY, newWidth, newHeight };<br>
> > > > > +Â Â Â return { originX, originY, newWidth, newHeight };<br>
> > > > >Â Â }<br>
> > > > ><br>
> > > > >Â Â /**<br>
> > > > > diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp<br>
> > b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp<br>
> > > > > index 3041fd1ed9fd..8d2440026689 100644<br>
> > > > > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp<br>
> > > > > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp<br>
> > > > > @@ -1289,7 +1289,7 @@ Rectangle CameraData::scaleIspCrop(const<br>
> > Rectangle &ispCrop) const<br>
> > > > >Â Â Â Â */<br>
> > > > >Â Â Â Â Rectangle nativeCrop =<br>
> > ispCrop.scaledBy(sensorInfo_.analogCrop.size(),<br>
> > > > ><br>
> >Â sensorInfo_.outputSize);<br>
> > > > > -Â Â Â nativeCrop.translateBy(sensorInfo_.analogCrop.topLeft());<br>
> > > > > +Â Â Â nativeCrop.translateBy(sensorInfo_.analogCrop.origin());<br>
> > > > >Â Â Â Â return nativeCrop;<br>
> > > > >Â Â }<br>
> > > > ><br>
> > > > > @@ -1303,7 +1303,7 @@ void CameraData::applyScalerCrop(const<br>
> > ControlList &controls)<br>
> > > > >Â Â Â Â Â Â Â Â Â Â Â Â nativeCrop = { 0, 0, 1, 1 };<br>
> > > > ><br>
> > > > >Â Â Â Â Â Â Â Â /* Create a version of the crop scaled to ISP (camera<br>
> > mode) pixels. */<br>
> > > > > -Â Â Â Â Â Â Â Rectangle ispCrop =<br>
> > nativeCrop.translatedBy(-sensorInfo_.analogCrop.topLeft());<br>
> > > > > +Â Â Â Â Â Â Â Rectangle ispCrop =<br>
> > nativeCrop.translatedBy(-sensorInfo_.analogCrop.origin());<br>
> > > > >Â Â Â Â Â Â Â Â ispCrop.scaleBy(sensorInfo_.outputSize,<br>
> > sensorInfo_.analogCrop.size());<br>
> > > > ><br>
> > > > >Â Â Â Â Â Â Â Â /*<br>
> > > > > diff --git a/src/py/libcamera/py_geometry.cpp<br>
> > b/src/py/libcamera/py_geometry.cpp<br>
> > > > > index c7e303609427..8dee365b25dd 100644<br>
> > > > > --- a/src/py/libcamera/py_geometry.cpp<br>
> > > > > +++ b/src/py/libcamera/py_geometry.cpp<br>
> > > > > @@ -105,7 +105,7 @@ void init_py_geometry(py::module &m)<br>
> > > > >Â Â Â Â Â Â Â Â .def_property_readonly("is_null", &Rectangle::isNull)<br>
> > > > >Â Â Â Â Â Â Â Â .def_property_readonly("center", &Rectangle::center)<br>
> > > > >Â Â Â Â Â Â Â Â .def_property_readonly("size", &Rectangle::size)<br>
> > > > > -Â Â Â Â Â Â Â .def_property_readonly("topLeft", &Rectangle::topLeft)<br>
> > > > > +Â Â Â Â Â Â Â .def_property_readonly("origin", &Rectangle::origin)<br>
> > > > >Â Â Â Â Â Â Â Â .def("scale_by", &Rectangle::scaleBy)<br>
> > > > >Â Â Â Â Â Â Â Â .def("translate_by", &Rectangle::translateBy)<br>
> > > > >Â Â Â Â Â Â Â Â .def("bounded_to", &Rectangle::boundedTo)<br>
> > > > > diff --git a/test/geometry.cpp b/test/geometry.cpp<br>
> > > > > index 64169206ad16..a4ee6f6e167a 100644<br>
> > > > > --- a/test/geometry.cpp<br>
> > > > > +++ b/test/geometry.cpp<br>
> > > > > @@ -363,16 +363,16 @@ protected:<br>
> > > > >Â Â Â Â Â Â Â Â Â Â Â Â return TestFail;<br>
> > > > >Â Â Â Â Â Â Â Â }<br>
> > > > ><br>
> > > > > -Â Â Â Â Â Â Â /* Rectangle::size(), Rectangle::topLeft() and<br>
> > Rectangle::center() tests */<br>
> > > > > +Â Â Â Â Â Â Â /* Rectangle::size(), Rectangle::origin() and<br>
> > Rectangle::center() tests */<br>
> > > > >Â Â Â Â Â Â Â Â if (Rectangle(-1, -2, 3, 4).size() != Size(3, 4) ||<br>
> > > > >Â Â Â Â Â Â Â Â Â Â Rectangle(0, 0, 100000, 200000).size() !=<br>
> > Size(100000, 200000)) {<br>
> > > > >Â Â Â Â Â Â Â Â Â Â Â Â cout << "Rectangle::size() test failed" <<<br>
> > endl;<br>
> > > > >Â Â Â Â Â Â Â Â Â Â Â Â return TestFail;<br>
> > > > >Â Â Â Â Â Â Â Â }<br>
> > > > ><br>
> > > > > -Â Â Â Â Â Â Â if (Rectangle(1, 2, 3, 4).topLeft() != Point(1, 2) ||<br>
> > > > > -Â Â Â Â Â Â Â Â Â Rectangle(-1, -2, 3, 4).topLeft() != Point(-1,<br>
> > -2)) {<br>
> > > > > -Â Â Â Â Â Â Â Â Â Â Â cout << "Rectangle::topLeft() test failed" <<<br>
> > endl;<br>
> > > > > +Â Â Â Â Â Â Â if (Rectangle(1, 2, 3, 4).origin() != Point(1, 2) ||<br>
> > > > > +Â Â Â Â Â Â Â Â Â Rectangle(-1, -2, 3, 4).origin() != Point(-1, -2))<br>
> > {<br>
> > > > > +Â Â Â Â Â Â Â Â Â Â Â cout << "Rectangle::origin() test failed" <<<br>
> > endl;<br>
> > > > >Â Â Â Â Â Â Â Â Â Â Â Â return TestFail;<br>
> > > > >Â Â Â Â Â Â Â Â }<br>
> > > > ><br>
> > > > > --<br>
> > > > > 2.46.1<br>
> > > > ><br>
> > > ><br>
> > ><br>
> > ><br>
> > > --<br>
> > > BR,<br>
> > > Harvey Yang<br>
> ><br>
</blockquote></div>
</div></div>