{"id":3356,"url":"https://patchwork.libcamera.org/api/patches/3356/?format=json","web_url":"https://patchwork.libcamera.org/patch/3356/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20200327113152.348570-2-jacopo@jmondi.org>","date":"2020-03-27T11:31:51","name":"[libcamera-devel,RFCv2,1/2] libcamera: camera_sensor: Define CameraSensorInfo","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"31601130b9fc70742567de48430fb2e16bb1c47f","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3356/mbox/","series":[{"id":787,"url":"https://patchwork.libcamera.org/api/series/787/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=787","date":"2020-03-27T11:31:50","name":"Define CameraSensorInfo","version":1,"mbox":"https://patchwork.libcamera.org/series/787/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3356/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3356/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 383B76040E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Mar 2020 12:29:00 +0100 (CET)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id E9DD9E0008\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Mar 2020 11:28:59 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Mar 2020 12:31:51 +0100","Message-Id":"<20200327113152.348570-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20200327113152.348570-1-jacopo@jmondi.org>","References":"<20200327113152.348570-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFCv2 1/2] 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, 27 Mar 2020 11:29:00 -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       | 106 ++++++++++++++++++++++++++\n src/libcamera/include/camera_sensor.h |  19 +++++\n 2 files changed, 125 insertions(+)","diff":"diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 09771fc40bbb..df1d82d29f74 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -30,6 +30,112 @@ 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+ *\n+ * \\todo Reference the corresponding property\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 from\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 ISP before any analog\n+ * processing takes 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 ISP pipeline processing stages, applied\n+ * on the pixel array matrix analog crop rectangle. Each ISP processing stage\n+ * that applies pixel sub-sampling techniques, such as pixel binning or\n+ * skipping, or perform additional digital cropping concur in the definition\n+ * of the final output image size.\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::horizontalBinning\n+ * \\brief The binning factor, in the horizontal direction, of the image sensor\n+ * configuration\n+ *\n+ * \\todo Remove this field and compute the binning factor in the IPA\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::verticalBinning\n+ * \\brief The binning factor, in the vertical direction, of the image sensor\n+ * configuration\n+ *\n+ * \\todo Remove this field and compute the binning factor in the IPA\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::horizontalScaling\n+ * \\brief The horizontal scaling factor, calculated as the ratio between\n+ * the active pixel array horizontal size and the horizontal size of the\n+ * output image\n+ *\n+ * \\todo Remove this field and compute the scaling factor in the IPA\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::verticalScaling\n+ * \\brief The vertical scaling factor, calculated as the ratio between\n+ * the active pixel array vertical size and the vertical size of the\n+ * output image\n+ *\n+ * \\todo Remove this field and compute the scaling factor in the IPA\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::noiseFactor\n+ * \\brief Scaling of the noise compared to the native sensor mode\n+ *\n+ * \\todo Improve this description\n+ */\n+\n+/**\n+ * \\var CameraSensorInfo::lineDuration\n+ * \\brief Line scan-out duration in nanoseconds\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 6e4d2b0118bc..acc6022cf0e8 100644\n--- a/src/libcamera/include/camera_sensor.h\n+++ b/src/libcamera/include/camera_sensor.h\n@@ -24,6 +24,25 @@ 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+\tuint8_t horizontalBinning;\n+\tuint8_t verticalBinning;\n+\tdouble horizontalScaling;\n+\tdouble verticalScaling;\n+\n+\tdouble noiseFactor;\n+\n+\tdouble lineDuration;\n+};\n+\n class CameraSensor : protected Loggable\n {\n public:\n","prefixes":["libcamera-devel","RFCv2","1/2"]}