{"id":3525,"url":"https://patchwork.libcamera.org/api/1.1/patches/3525/?format=json","web_url":"https://patchwork.libcamera.org/patch/3525/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200424215304.558317-8-jacopo@jmondi.org>","date":"2020-04-24T21:52:58","name":"[libcamera-devel,v3,07/13] libcamera: camera_sensor: Define CameraSensorInfo","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"9e8be474da38a2df285a8008b983a752872d5a50","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3525/mbox/","series":[{"id":822,"url":"https://patchwork.libcamera.org/api/1.1/series/822/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=822","date":"2020-04-24T21:52:51","name":"libcamera: Add CameraSensorInfo","version":3,"mbox":"https://patchwork.libcamera.org/series/822/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3525/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3525/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[217.70.183.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2898E62E5D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Apr 2020 23:50:11 +0200 (CEST)","from uno.homenet.telecomitalia.it\n\t(host240-55-dynamic.3-87-r.retail.telecomitalia.it [87.3.55.240])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 73D8C60004;\n\tFri, 24 Apr 2020 21:50:10 +0000 (UTC)"],"X-Originating-IP":"87.3.55.240","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 Apr 2020 23:52:58 +0200","Message-Id":"<20200424215304.558317-8-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.26.1","In-Reply-To":"<20200424215304.558317-1-jacopo@jmondi.org>","References":"<20200424215304.558317-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 07/13] libcamera: camera_sensor: Define\n\tCameraSensorInfo","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>","X-List-Received-Date":"Fri, 24 Apr 2020 21:50:11 -0000"},"content":"Define the CameraSensorInfo structure that reports the current image sensor\nconfiguration.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/camera_sensor.cpp       | 99 +++++++++++++++++++++++++++\n src/libcamera/include/camera_sensor.h | 13 ++++\n 2 files changed, 112 insertions(+)","diff":"diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex a54751fecf5a..e39f277622ae 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -28,6 +28,105 @@ namespace libcamera {\n \n LOG_DEFINE_CATEGORY(CameraSensor);\n \n+/**\n+ * \\struct CameraSensorInfo\n+ * \\brief Report the image sensor characteristics\n+ *\n+ * The structure reports image sensor characteristics used by IPA modules to\n+ * tune their algorithms based on the image sensor model currently in use and\n+ * its configuration.\n+ *\n+ * The here reported information describe the sensor's intrinsics\n+ * characteristics, such as its pixel array size and the sensor model name,\n+ * as well as information relative to the currently configured mode, such as\n+ * the produced image size and the bit depth of the requested image format.\n+ *\n+ * Instances of this structure are meant to be assembled by the CameraSensor\n+ * class and its specialized subclasses by inspecting the sensor static\n+ * properties as well as the currently configured sensor mode.\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::name\n+ * \\brief The image sensor name\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::bitsPerPixel\n+ * \\brief The bits per-pixel of the image format produced by the image sensor\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::activeAreaSize\n+ * \\brief The size of the active pixel array area of the sensor\n+ * \\sa properties::PixelArray\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::analogCrop\n+ * \\brief The portion of the pixel array active area which is read-out and\n+ * processed\n+ *\n+ * The analog crop rectangle top-left corner is defined as the displacement\n+ * from the top-left corner of the pixel array active area. The rectangle\n+ * horizontal and vertical sizes define the portion of the pixel matrix which\n+ * is read-out and provided to the sensor's on-board processing pipeline, before\n+ * any pixel sub-sampling method, such as pixel binning, skipping and averaging\n+ * take place.\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::outputSize\n+ * \\brief The size of the images produced by the camera sensor\n+ *\n+ * The output image size defines the horizontal and vertical sizes of the images\n+ * produced by the image sensor. The final output image size is defined as the\n+ * end result of the sensor's on-board image processing pipeline stages, applied\n+ * on the pixel array portion defined by the analog crop rectangle. Each image\n+ * processing stage that performs pixel sub-sampling techniques, such as pixel\n+ * binning or skipping, or perform any additional digital scaling concur in\n+ * the definition of the final output image size.\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::lineLength\n+ * \\brief Total line length in pixels\n+ *\n+ * The total line length in pixels, including blanking and synchronism signal\n+ * active state duration.\n+ *\n+ * In example:\n+ *\n+ * \\verbatim\n+                _______     _______     ___\n+  HREF  ... ___|       |___|       |___|     ...\n+              _           _           _\n+  HSYNC ... _| |_________| |_________| |__   ...\n+\n+  Valid ... ....xxxxxxxx....xxxxxxxx....xxx  ...\n+  Data\n+\n+  Line\t  ... /-----------/-----------/---  ...\n+  Length\n+\n+  \\endverbatim\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::pixelClock\n+ * \\brief The pixel clock in Hz\n+ *\n+ * The pixel read out frequency in Hz. The property describes how many pixel\n+ * per second are produced by the camera sensor, including blankings and\n+ * synchronism signal active state duration.\n+ *\n+ * To obtain the read-out time in second of a full line:\n+ *\n+ * \\verbatim\n+\tLineDuration(s) = lineLength(pixel) / pixelClock(Hz)\n+   \\endverbatim\n+ */\n+\n /**\n  * \\class CameraSensor\n  * \\brief A camera sensor based on V4L2 subdevices\ndiff --git a/src/libcamera/include/camera_sensor.h b/src/libcamera/include/camera_sensor.h\nindex 8fa4d450f959..e19852d4cabe 100644\n--- a/src/libcamera/include/camera_sensor.h\n+++ b/src/libcamera/include/camera_sensor.h\n@@ -22,6 +22,19 @@ class V4L2Subdevice;\n \n struct V4L2SubdeviceFormat;\n \n+struct CameraSensorInfo {\n+\tstd::string name;\n+\n+\tuint32_t bitsPerPixel;\n+\n+\tSize activeAreaSize;\n+\tRectangle analogCrop;\n+\tSize outputSize;\n+\n+\tuint32_t pixelClock;\n+\tuint32_t lineLength;\n+};\n+\n class CameraSensor : protected Loggable\n {\n public:\n","prefixes":["libcamera-devel","v3","07/13"]}