[libcamera-devel,v3,2/2] libcamera: correct the string representation of Rectangle
diff mbox series

Message ID 20220419124220.1877877-2-hanlinchen@chromium.org
State Accepted
Headers show
Series
  • [libcamera-devel,v3,1/2] libcamera: Add operator<< for classes in geometry
Related show

Commit Message

Hanlin Chen April 19, 2022, 12:42 p.m. UTC
Change the string representation of class Rectangle from
"(top x left)/width x height" to "(top, left)/width x height".

Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
---
 src/libcamera/geometry.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart April 19, 2022, 1:10 p.m. UTC | #1
Hi Han-Lin,

On Tue, Apr 19, 2022 at 08:42:20PM +0800, Han-Lin Chen via libcamera-devel wrote:
> Change the string representation of class Rectangle from
> "(top x left)/width x height" to "(top, left)/width x height".

Good catch !

> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
> ---
>  src/libcamera/geometry.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
> index da08045e..e00333cf 100644
> --- a/src/libcamera/geometry.cpp
> +++ b/src/libcamera/geometry.cpp
> @@ -841,7 +841,7 @@ bool operator==(const Rectangle &lhs, const Rectangle &rhs)
>   */
>  std::ostream &operator<<(std::ostream &out, const Rectangle &r)
>  {
> -	out << "(" << r.x << "x" << r.y << ")/" << r.width << "x" << r.height;
> +	out << "(" << r.x << ", " << r.y << ")/" << r.width << "x" << r.height;

I'd remove the space after the comma. With that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I can fix when applying.

>  	return out;
>  }
>
Laurent Pinchart April 19, 2022, 1:12 p.m. UTC | #2
On Tue, Apr 19, 2022 at 04:10:49PM +0300, Laurent Pinchart via libcamera-devel wrote:
> Hi Han-Lin,
> 
> On Tue, Apr 19, 2022 at 08:42:20PM +0800, Han-Lin Chen via libcamera-devel wrote:
> > Change the string representation of class Rectangle from
> > "(top x left)/width x height" to "(top, left)/width x height".
> 
> Good catch !
> 
> > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
> > ---
> >  src/libcamera/geometry.cpp | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
> > index da08045e..e00333cf 100644
> > --- a/src/libcamera/geometry.cpp
> > +++ b/src/libcamera/geometry.cpp
> > @@ -841,7 +841,7 @@ bool operator==(const Rectangle &lhs, const Rectangle &rhs)
> >   */
> >  std::ostream &operator<<(std::ostream &out, const Rectangle &r)
> >  {
> > -	out << "(" << r.x << "x" << r.y << ")/" << r.width << "x" << r.height;
> > +	out << "(" << r.x << ", " << r.y << ")/" << r.width << "x" << r.height;
> 
> I'd remove the space after the comma. With that,

Actually the Point class has the same issue. Let's keep it as-is here
and fix both on top.

> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> I can fix when applying.
> 
> >  	return out;
> >  }
> >
Kieran Bingham April 19, 2022, 1:53 p.m. UTC | #3
Quoting Laurent Pinchart via libcamera-devel (2022-04-19 14:12:56)
> On Tue, Apr 19, 2022 at 04:10:49PM +0300, Laurent Pinchart via libcamera-devel wrote:
> > Hi Han-Lin,
> > 
> > On Tue, Apr 19, 2022 at 08:42:20PM +0800, Han-Lin Chen via libcamera-devel wrote:
> > > Change the string representation of class Rectangle from
> > > "(top x left)/width x height" to "(top, left)/width x height".
> > 
> > Good catch !
> > 
> > > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
> > > ---
> > >  src/libcamera/geometry.cpp | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
> > > index da08045e..e00333cf 100644
> > > --- a/src/libcamera/geometry.cpp
> > > +++ b/src/libcamera/geometry.cpp
> > > @@ -841,7 +841,7 @@ bool operator==(const Rectangle &lhs, const Rectangle &rhs)
> > >   */
> > >  std::ostream &operator<<(std::ostream &out, const Rectangle &r)
> > >  {
> > > -   out << "(" << r.x << "x" << r.y << ")/" << r.width << "x" << r.height;
> > > +   out << "(" << r.x << ", " << r.y << ")/" << r.width << "x" << r.height;
> > 
> > I'd remove the space after the comma. With that,
> 
> Actually the Point class has the same issue. Let's keep it as-is here
> and fix both on top.
> 
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> > 
> > I can fix when applying.
> > 
> > >     return out;
> > >  }
> > >  
> 
> -- 
> Regards,
> 
> Laurent Pinchart
Nicolas Dufresne via libcamera-devel April 20, 2022, 6:13 a.m. UTC | #4
Hi Han-Lin,

On Tue, Apr 19, 2022 at 08:42:20PM +0800, Han-Lin Chen via libcamera-devel wrote:
> Change the string representation of class Rectangle from
> "(top x left)/width x height" to "(top, left)/width x height".
> 
> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/libcamera/geometry.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
> index da08045e..e00333cf 100644
> --- a/src/libcamera/geometry.cpp
> +++ b/src/libcamera/geometry.cpp
> @@ -841,7 +841,7 @@ bool operator==(const Rectangle &lhs, const Rectangle &rhs)
>   */
>  std::ostream &operator<<(std::ostream &out, const Rectangle &r)
>  {
> -	out << "(" << r.x << "x" << r.y << ")/" << r.width << "x" << r.height;
> +	out << "(" << r.x << ", " << r.y << ")/" << r.width << "x" << r.height;
>  	return out;
>  }
>  
> -- 
> 2.36.0.rc0.470.gd361397f0d-goog
>

Patch
diff mbox series

diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp
index da08045e..e00333cf 100644
--- a/src/libcamera/geometry.cpp
+++ b/src/libcamera/geometry.cpp
@@ -841,7 +841,7 @@  bool operator==(const Rectangle &lhs, const Rectangle &rhs)
  */
 std::ostream &operator<<(std::ostream &out, const Rectangle &r)
 {
-	out << "(" << r.x << "x" << r.y << ")/" << r.width << "x" << r.height;
+	out << "(" << r.x << ", " << r.y << ")/" << r.width << "x" << r.height;
 	return out;
 }