[libcamera-devel,v6,21/12] libcamera: transform: Make the transformFromOrientation() function static
diff mbox series

Message ID 20231022224159.30298-9-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Replace CameraConfiguration::transform
Related show

Commit Message

Laurent Pinchart Oct. 22, 2023, 10:41 p.m. UTC
Now that the transformFromOrientation() function isn't used outside of
transform.cpp, make it static to remove it from the public API.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/transform.h | 1 -
 src/libcamera/transform.cpp   | 4 ++++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Jacopo Mondi Oct. 23, 2023, 8:57 a.m. UTC | #1
Hi Laurent

On Mon, Oct 23, 2023 at 01:41:59AM +0300, Laurent Pinchart via libcamera-devel wrote:
> Now that the transformFromOrientation() function isn't used outside of
> transform.cpp, make it static to remove it from the public API.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  include/libcamera/transform.h | 1 -
>  src/libcamera/transform.cpp   | 4 ++++
>  2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h
> index 4998a6c04cb7..44cb4c6fc974 100644
> --- a/include/libcamera/transform.h
> +++ b/include/libcamera/transform.h
> @@ -71,7 +71,6 @@ constexpr Transform operator~(Transform t)
>  }
>
>  Transform transformFromRotation(int angle, bool *success = nullptr);

am I wrong or you can now remove this one as well ?

> -Transform transformFromOrientation(const Orientation &orientation);
>
>  Transform operator/(const Orientation &o1, const Orientation &o2);
>  Orientation operator*(const Orientation &o, const Transform &t);
> diff --git a/src/libcamera/transform.cpp b/src/libcamera/transform.cpp
> index cd2717c28c3a..fb2d55ac1931 100644
> --- a/src/libcamera/transform.cpp
> +++ b/src/libcamera/transform.cpp
> @@ -301,6 +301,8 @@ Transform transformFromRotation(int angle, bool *success)
>  	return Transform::Identity;
>  }
>
> +namespace {
> +
>  /**
>   * \brief Return the transform representing \a orientation
>   * \param[in] orientation The orientation to convert
> @@ -330,6 +332,8 @@ Transform transformFromOrientation(const Orientation &orientation)
>  	return Transform::Identity;
>  }
>
> +} /* namespace */
> +
>  /**
>   * \brief Return the Transform that applied to \a o2 gives \a o1
>   * \param o1 The Orientation to obtain
> --
> Regards,
>
> Laurent Pinchart
>
Laurent Pinchart Oct. 23, 2023, 10:21 a.m. UTC | #2
On Mon, Oct 23, 2023 at 10:57:08AM +0200, Jacopo Mondi wrote:
> On Mon, Oct 23, 2023 at 01:41:59AM +0300, Laurent Pinchart via libcamera-devel wrote:
> > Now that the transformFromOrientation() function isn't used outside of
> > transform.cpp, make it static to remove it from the public API.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  include/libcamera/transform.h | 1 -
> >  src/libcamera/transform.cpp   | 4 ++++
> >  2 files changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h
> > index 4998a6c04cb7..44cb4c6fc974 100644
> > --- a/include/libcamera/transform.h
> > +++ b/include/libcamera/transform.h
> > @@ -71,7 +71,6 @@ constexpr Transform operator~(Transform t)
> >  }
> >
> >  Transform transformFromRotation(int angle, bool *success = nullptr);
> 
> am I wrong or you can now remove this one as well ?

As noted in the cover letter, it's used by the Python bindings. I would
like to drop it, and rewrite the Python Transform class in pure Python.

> > -Transform transformFromOrientation(const Orientation &orientation);
> >
> >  Transform operator/(const Orientation &o1, const Orientation &o2);
> >  Orientation operator*(const Orientation &o, const Transform &t);
> > diff --git a/src/libcamera/transform.cpp b/src/libcamera/transform.cpp
> > index cd2717c28c3a..fb2d55ac1931 100644
> > --- a/src/libcamera/transform.cpp
> > +++ b/src/libcamera/transform.cpp
> > @@ -301,6 +301,8 @@ Transform transformFromRotation(int angle, bool *success)
> >  	return Transform::Identity;
> >  }
> >
> > +namespace {
> > +
> >  /**
> >   * \brief Return the transform representing \a orientation
> >   * \param[in] orientation The orientation to convert
> > @@ -330,6 +332,8 @@ Transform transformFromOrientation(const Orientation &orientation)
> >  	return Transform::Identity;
> >  }
> >
> > +} /* namespace */
> > +
> >  /**
> >   * \brief Return the Transform that applied to \a o2 gives \a o1
> >   * \param o1 The Orientation to obtain

Patch
diff mbox series

diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h
index 4998a6c04cb7..44cb4c6fc974 100644
--- a/include/libcamera/transform.h
+++ b/include/libcamera/transform.h
@@ -71,7 +71,6 @@  constexpr Transform operator~(Transform t)
 }
 
 Transform transformFromRotation(int angle, bool *success = nullptr);
-Transform transformFromOrientation(const Orientation &orientation);
 
 Transform operator/(const Orientation &o1, const Orientation &o2);
 Orientation operator*(const Orientation &o, const Transform &t);
diff --git a/src/libcamera/transform.cpp b/src/libcamera/transform.cpp
index cd2717c28c3a..fb2d55ac1931 100644
--- a/src/libcamera/transform.cpp
+++ b/src/libcamera/transform.cpp
@@ -301,6 +301,8 @@  Transform transformFromRotation(int angle, bool *success)
 	return Transform::Identity;
 }
 
+namespace {
+
 /**
  * \brief Return the transform representing \a orientation
  * \param[in] orientation The orientation to convert
@@ -330,6 +332,8 @@  Transform transformFromOrientation(const Orientation &orientation)
 	return Transform::Identity;
 }
 
+} /* namespace */
+
 /**
  * \brief Return the Transform that applied to \a o2 gives \a o1
  * \param o1 The Orientation to obtain