[{"id":30472,"web_url":"https://patchwork.libcamera.org/comment/30472/","msgid":"<7l5jfg77jbkiex6veysrduonk5jimq2pelgsmw6rtvvvhf2wa7@uncnlfo5cijt>","date":"2024-07-24T13:52:20","subject":"Re: [RFC PATCH 4/6] libcamera: converter_v4l2_m2m: Add vertex\n\tmapping class","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Umang\n\nOn Fri, Jul 12, 2024 at 10:59:18AM GMT, Umang Jain wrote:\n> Add a vertex mapping protected class to V4L2M2M converter class.\n> Instances of this class will store a dewarp vertex mappings along\n> with their input/output configuration.\n>\n> Add a vector of Mapping class and applyMapping() helper as well,\n> to apply relevant mappings to V4L2Stream. ConverterDW100 will\n> use this helper to set vertex maps, in subsequent patch.\n>\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> ---\n>  .../internal/converter/converter_v4l2_m2m.h   | 20 +++++++++++++++++++\n>  1 file changed, 20 insertions(+)\n>\n> diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> index 2697eed9..f61beef8 100644\n> --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> @@ -61,6 +61,26 @@ public:\n>  \tint setCrop(const Stream *stream, Rectangle *rect);\n>  \tstd::pair<Rectangle, Rectangle> getCropBounds(const Stream *stream);\n>\n> +protected:\n> +\tclass Mapping\n> +\t{\n> +\tpublic:\n> +\t\tMapping(const Size &input, const Size &output, const std::vector<uint32_t> &map)\n> +\t\t\t: input_(input), output_(output), map_(map) {}\n> +\t\tSize inputSize() const { return input_; }\n> +\t\tSize outputSize() const { return output_; }\n> +\t\tstd::size_t size() const { return map_.size(); }\n\nIs the size of the array directly dependent on the input or output\nsizes or it doesn't have a correlation with them ?\n\n> +\t\tconst uint32_t *mapping() const { return map_.data(); }\n> +\n> +\tprivate:\n> +\t\tSize input_;\n> +\t\tSize output_;\n> +\t\tstd::vector<uint32_t> map_;\n\nMaybe documentation will help, but how is mapping expressed with an\narray of uint32_t points ?\n\n> +\t};\n> +\n> +\tint applyMapping(const Stream *stream, Mapping &mapping);\n\nDoes this work without providing an implementation ?\n\n> +\tstd::vector<Mapping> mappings_;\n> +\n>  private:\n>  \tclass V4L2M2MStream : protected Loggable\n>  \t{\n> --\n> 2.45.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5A6EBC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Jul 2024 13:52:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 29D1F6336F;\n\tWed, 24 Jul 2024 15:52:27 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC9F3619A0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Jul 2024 15:52:24 +0200 (CEST)","from ideasonboard.com (unknown [91.80.74.127])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 99EC411D1;\n\tWed, 24 Jul 2024 15:51:41 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Rpo+AkGp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1721829101;\n\tbh=zF2EW7cM1z2ubeSB5tJq2FiBVxCDrWEroOWKcVATRj8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Rpo+AkGpShs6bC/I044doGD+nEXB382T4e967KiD2SS6J5T2eFYmKhG7npj2vi4Ab\n\ttoeM3RMUDJ53NHTKwGTDVRk6QMyEr5E7QTDD98DdDMDuip0wIAFcorUzdR5RSzOIPK\n\tV6M6ENFxsGe+MJ694nmYuvR+ALTaPBc3qcx1DqDY=","Date":"Wed, 24 Jul 2024 15:52:20 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tXavier Roumegue <xavier.roumegue@oss.nxp.com>","Subject":"Re: [RFC PATCH 4/6] libcamera: converter_v4l2_m2m: Add vertex\n\tmapping class","Message-ID":"<7l5jfg77jbkiex6veysrduonk5jimq2pelgsmw6rtvvvhf2wa7@uncnlfo5cijt>","References":"<20240712052920.33396-1-umang.jain@ideasonboard.com>\n\t<20240712052920.33396-5-umang.jain@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240712052920.33396-5-umang.jain@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":30556,"web_url":"https://patchwork.libcamera.org/comment/30556/","msgid":"<20240802224418.GE3319@pendragon.ideasonboard.com>","date":"2024-08-02T22:44:18","subject":"Re: [RFC PATCH 4/6] libcamera: converter_v4l2_m2m: Add vertex\n\tmapping class","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jul 24, 2024 at 03:52:20PM +0200, Jacopo Mondi wrote:\n> On Fri, Jul 12, 2024 at 10:59:18AM GMT, Umang Jain wrote:\n> > Add a vertex mapping protected class to V4L2M2M converter class.\n\nGiven the rationale explained in the cover letter (no design of a\ngeneric API with a single implementation), should this be part of the\nDW100 converter class ?\n\n> > Instances of this class will store a dewarp vertex mappings along\n> > with their input/output configuration.\n> >\n> > Add a vector of Mapping class and applyMapping() helper as well,\n> > to apply relevant mappings to V4L2Stream. ConverterDW100 will\n> > use this helper to set vertex maps, in subsequent patch.\n> >\n> > Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> > ---\n> >  .../internal/converter/converter_v4l2_m2m.h   | 20 +++++++++++++++++++\n> >  1 file changed, 20 insertions(+)\n> >\n> > diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> > index 2697eed9..f61beef8 100644\n> > --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> > +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n> > @@ -61,6 +61,26 @@ public:\n> >  \tint setCrop(const Stream *stream, Rectangle *rect);\n> >  \tstd::pair<Rectangle, Rectangle> getCropBounds(const Stream *stream);\n> >\n> > +protected:\n> > +\tclass Mapping\n> > +\t{\n> > +\tpublic:\n> > +\t\tMapping(const Size &input, const Size &output, const std::vector<uint32_t> &map)\n> > +\t\t\t: input_(input), output_(output), map_(map) {}\n> > +\t\tSize inputSize() const { return input_; }\n> > +\t\tSize outputSize() const { return output_; }\n> > +\t\tstd::size_t size() const { return map_.size(); }\n> \n> Is the size of the array directly dependent on the input or output\n> sizes or it doesn't have a correlation with them ?\n> \n> > +\t\tconst uint32_t *mapping() const { return map_.data(); }\n> > +\n> > +\tprivate:\n> > +\t\tSize input_;\n> > +\t\tSize output_;\n> > +\t\tstd::vector<uint32_t> map_;\n> \n> Maybe documentation will help, but how is mapping expressed with an\n> array of uint32_t points ?\n> \n> > +\t};\n> > +\n> > +\tint applyMapping(const Stream *stream, Mapping &mapping);\n> \n> Does this work without providing an implementation ?\n\nIt would fail to link if the function was called.\n\n> > +\tstd::vector<Mapping> mappings_;\n> > +\n> >  private:\n> >  \tclass V4L2M2MStream : protected Loggable\n> >  \t{","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 7DBA8C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Aug 2024 22:44:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A4A2663381;\n\tSat,  3 Aug 2024 00:44:41 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CBA696195B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Aug 2024 00:44:39 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E21E33C7;\n\tSat,  3 Aug 2024 00:43:49 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gNaT3CO3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1722638630;\n\tbh=JQMekmAUbfo2G/gjz3DovbP457l0XsIiKat01CR2eeA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gNaT3CO34uNOvdavQ34Q6KLJygijjRViSJJdWWzo1FaPDHwS+fN5V2rJHEMNSjHIJ\n\tgiZfQ6YdPvXxKhJJhfL2rEwjSgQUxg0Prs0Pv4pHVNH2POsNtWAIRGYiGmCOd1OD/p\n\tqGxYuFq/htFycMC1z5CDgnzgggh56jKgtX7w76Ww=","Date":"Sat, 3 Aug 2024 01:44:18 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tXavier Roumegue <xavier.roumegue@oss.nxp.com>","Subject":"Re: [RFC PATCH 4/6] libcamera: converter_v4l2_m2m: Add vertex\n\tmapping class","Message-ID":"<20240802224418.GE3319@pendragon.ideasonboard.com>","References":"<20240712052920.33396-1-umang.jain@ideasonboard.com>\n\t<20240712052920.33396-5-umang.jain@ideasonboard.com>\n\t<7l5jfg77jbkiex6veysrduonk5jimq2pelgsmw6rtvvvhf2wa7@uncnlfo5cijt>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<7l5jfg77jbkiex6veysrduonk5jimq2pelgsmw6rtvvvhf2wa7@uncnlfo5cijt>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]