<div dir="ltr"><div dir="ltr">Hi Barnabás and Jacopo,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 16, 2024 at 1:27 AM Barnabás Pőcze <<a href="mailto:pobrn@protonmail.com">pobrn@protonmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi<br>
<br>
<br>
2024. szeptember 5., csütörtök 10:35 keltezéssel, Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com" target="_blank">jacopo.mondi@ideasonboard.com</a>> írta:<br>
<br>
> Hi Barnabás<br>
> <br>
> On Wed, Sep 04, 2024 at 11:26:37AM GMT, Barnabás Pőcze wrote:<br>
> > Hi<br>
> ><br>
> ><br>
> > 2024. szeptember 3., kedd 13:39 keltezéssel, Harvey Yang <<a href="mailto:chenghaoyang@chromium.org" target="_blank">chenghaoyang@chromium.org</a>> írta:<br>
> ><br>
> > > From: Yudhistira Erlandinata <<a href="mailto:yerlandinata@chromium.org" target="_blank">yerlandinata@chromium.org</a>><br>
> > ><br>
> > > Add a Rectangle constructor that accepts two points:<br>
> > > topLeft and bottomRight.<br>
> > ><br>
> > > Signed-off-by: Yudhistira Erlandinata <<a href="mailto:yerlandinata@chromium.org" target="_blank">yerlandinata@chromium.org</a>><br>
> > > Co-developed-by: Harvey Yang <<a href="mailto:chenghaoyang@chromium.org" target="_blank">chenghaoyang@chromium.org</a>><br>
> > > Reviewed-by: Jacopo Mondi <<a href="mailto:jacopo.mondi@ideasonboard.com" target="_blank">jacopo.mondi@ideasonboard.com</a>><br>
> > > ---<br>
> > > include/libcamera/geometry.h | 2 ++<br>
> > > src/libcamera/geometry.cpp | 14 ++++++++++++++<br>
> > > 2 files changed, 16 insertions(+)<br>
> > ><br>
> > > diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h<br>
> > > index 3e6f0f5d7..dc56f180f 100644<br>
> > > --- a/include/libcamera/geometry.h<br>
> > > +++ b/include/libcamera/geometry.h<br>
> > > @@ -262,6 +262,8 @@ public:<br>
> > > {<br>
> > > }<br>
> > ><br>
> > > + constexpr Rectangle(const Point &topLeft, const Point &bottomRight);<br>
> ><br>
> > Don't make this `constexpr` because it is not useful since the definition is not available.<br>
> <br>
> I found references online that constexpr constuctors are implcitly<br>
> inline, is this the reason of your comment ?<br>
<br>
Yes.<br>
<br>
<br>
> <br>
> However, I can't find it clearly specified in cppreference. Do you<br>
> have any pointer ?<br>
<br>
"A constexpr specifier used in a function or static data member(since C++17) declaration implies inline."<br>
-- <a href="https://en.cppreference.com/w/cpp/language/constexpr" rel="noreferrer" target="_blank">https://en.cppreference.com/w/cpp/language/constexpr</a><br>
<br>
> <br>
> Anyway, if inline is the reason, isn't it better to inline the<br>
> definition and maintain the constexpr specifier ?<br>
> [...]<br>
<br>
That is an option as well.<br></blockquote><div><br></div><div>IIUC, you're suggesting to put the definition of the new c'tor</div><div>back in the header file? As we use `ASSERT` in this c'tor</div><div>definition, there will be a compile error if we do that:</div><div><span style="background-color:rgb(255,255,255)"><font color="#000000">```<br>
</font></span><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">In file included from </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">../include/libcamera/base/log.h:12</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,</span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">../include/libcamera/geometry.h:16</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,</span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">../include/libcamera/controls.h:21</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,</span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">../include/libcamera/camera.h:22</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,</span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">../src/apps/common/dng_writer.h:13</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,</span></font></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>from </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">../src/apps/common/dng_writer.cpp:8</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">:</span></font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures">../include/libcamera/base/private.h:21:2:</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> </span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures">error: </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures">#error "Private headers must not be included in the libcamera API"</span></font></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-size-adjust:none;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;line-height:normal;font-family:Monaco"><span style="background-color:rgb(255,255,255)"><font color="#000000"><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>21 | #</span><span class="gmail-s4" style="font-variant-ligatures:no-common-ligatures">error</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> "Private headers must not be included in the libcamera API"</span></font></span></p><span style="background-color:rgb(255,255,255)"><font color="#000000">```</font></span></div><div><span style="background-color:rgb(255,255,255)"><font color="#000000"><br></font></span></div><div><span style="background-color:rgb(255,255,255)"><font color="#000000">BR,<br>Harvey</font></span></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
Regards,<br>
Barnabás Pőcze<br>
<br>
</blockquote></div></div>