{"id":8977,"url":"https://patchwork.libcamera.org/api/patches/8977/?format=json","web_url":"https://patchwork.libcamera.org/patch/8977/","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":"<20200724145618.26304-3-david.plowman@raspberrypi.com>","date":"2020-07-24T14:56:17","name":"[libcamera-devel,v2,2/3] libcamera: raspberrypi: Add ColourCorrectionMatrix control","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"57cdc8ece943d01fcdbcdfe25ba5338511d0f000","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8977/mbox/","series":[{"id":1138,"url":"https://patchwork.libcamera.org/api/series/1138/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1138","date":"2020-07-24T14:56:15","name":"ColourCorrectionMatrix control","version":2,"mbox":"https://patchwork.libcamera.org/series/1138/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8977/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8977/checks/","tags":{},"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 167C9BD86F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jul 2020 14:56:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 551B26123A;\n\tFri, 24 Jul 2020 16:56:40 +0200 (CEST)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E0B5611B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2020 16:56:38 +0200 (CEST)","by mail-wm1-x32a.google.com with SMTP id j18so8208366wmi.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jul 2020 07:56:38 -0700 (PDT)","from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\th5sm2073156wrc.97.2020.07.24.07.56.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 24 Jul 2020 07:56:37 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"qm2TvKpw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=mMXsypKuztS3I5PSsSsWnIRpjlg2TPjWEKfPLJ/XywE=;\n\tb=qm2TvKpwR/PjlXPscNdAnkGKzHBgZh9p5gCpaxFPYvQow6V1+r3kncWeFiPBbVl/0X\n\t9a8IztSM8ZQx1I8eJ5+YpjQ3+CCUVsrnNvQOrY6AwRDLfpAxQlvPCiHTAxYzvk11cO40\n\tV1ctRqDpODHH3ULeS+klh8QV0Wc2Ifit/5jr2kVu4AxgZrBfyoiw6eBgoVOAEw9LaZZv\n\tCjW8hFclYIZPBK/CchU1FHhUOP0q420hllVWsKiwQV3/xe/ydPBamyFjRhJi9oQFXAsF\n\tYrQBfnNm/AkKSoenm8m0SoHDqC2Kic7HC0hU29D3266CZSLxrnNHQn3AENFkajzJ7s47\n\tm5kA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=mMXsypKuztS3I5PSsSsWnIRpjlg2TPjWEKfPLJ/XywE=;\n\tb=sANFG8Gq4zRoRq7VifnNpwAvrr9h7WTjiVLlW/FkxNkJgolu8hZoYd4zMQjTc/RU4O\n\tRNL4965HiE2lKVDQGOp2/oeHupbjEdjAdsbbrEQFC/LIF/qXHM6tDpLJtXhBcLIbRVqO\n\tqAQ7GuIbHFPVb4sd4pFlFFX1uBoqRqp2U43VuKmZ4tohbiwQ8U6ZyvkO3NeHC0+ZZ/ck\n\tV9PxgxgRupqfAP9pQvzMNHCyAEag94iJtmaxAxms4p4ezan5nrn+yu/5ad/s4UBkH8fs\n\tx/ZesrJBnQThUaMQM5VQRNo9Ekla+D6J1LfnP+utMcydzcpkUCIvVEmPtiArKR/IKEhw\n\th5fA==","X-Gm-Message-State":"AOAM532rArF7NhVmXJ55equmxmAS9YmDVsfro2yj4qq2rkoBhUEwKGDl\n\t975xZmFrqusT8k25hxBhzyw8dv87wvdHfg==","X-Google-Smtp-Source":"ABdhPJyS/afo/5LRY/Ij5x3fMIAuPoFz+ya2XNwiLRUKecUV2nEquF6+/zjeh2VfOmlD32FKa8a9Ig==","X-Received":"by 2002:a1c:dcd5:: with SMTP id\n\tt204mr8859825wmg.17.1595602597929; \n\tFri, 24 Jul 2020 07:56:37 -0700 (PDT)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 Jul 2020 15:56:17 +0100","Message-Id":"<20200724145618.26304-3-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20200724145618.26304-1-david.plowman@raspberrypi.com>","References":"<20200724145618.26304-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 2/3] libcamera: raspberrypi: Add\n\tColourCorrectionMatrix control","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Implements, for the Raspberry Pi platform, the returning of the CCM\n(Colour Correction Matrix) used by the pipeline in the libcamera\nmetadata.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n include/libcamera/ipa/raspberrypi.h | 1 +\n src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++++++\n 2 files changed, 9 insertions(+)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex a493776..ca62990 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -56,6 +56,7 @@ static const ControlInfoMap RPiControls = {\n \t{ &controls::Contrast, ControlInfo(0.0f, 32.0f) },\n \t{ &controls::Saturation, ControlInfo(0.0f, 32.0f) },\n \t{ &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) },\n+\t{ &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) },\n };\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 7bd0488..3747208 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -438,6 +438,14 @@ void IPARPi::reportMetadata()\n \t\tint32_t focusFoM = (focusStatus->focus_measures[5] + focusStatus->focus_measures[6]) / 2;\n \t\tlibcameraMetadata_.set(controls::FocusFoM, focusFoM);\n \t}\n+\n+\tCcmStatus *ccmStatus = rpiMetadata_.GetLocked<CcmStatus>(\"ccm.status\");\n+\tif (ccmStatus) {\n+\t\tfloat m[9];\n+\t\tfor (unsigned int i = 0; i < 9; i++)\n+\t\t\tm[i] = ccmStatus->matrix[i];\n+\t\tlibcameraMetadata_.set(controls::ColourCorrectionMatrix, m);\n+\t}\n }\n \n /*\n","prefixes":["libcamera-devel","v2","2/3"]}