From patchwork Fri Jul 24 14:56:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 8977 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 167C9BD86F for ; Fri, 24 Jul 2020 14:56:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 551B26123A; Fri, 24 Jul 2020 16:56:40 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qm2TvKpw"; dkim-atps=neutral Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E0B5611B0 for ; Fri, 24 Jul 2020 16:56:38 +0200 (CEST) Received: by mail-wm1-x32a.google.com with SMTP id j18so8208366wmi.3 for ; Fri, 24 Jul 2020 07:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mMXsypKuztS3I5PSsSsWnIRpjlg2TPjWEKfPLJ/XywE=; b=qm2TvKpwR/PjlXPscNdAnkGKzHBgZh9p5gCpaxFPYvQow6V1+r3kncWeFiPBbVl/0X 9a8IztSM8ZQx1I8eJ5+YpjQ3+CCUVsrnNvQOrY6AwRDLfpAxQlvPCiHTAxYzvk11cO40 V1ctRqDpODHH3ULeS+klh8QV0Wc2Ifit/5jr2kVu4AxgZrBfyoiw6eBgoVOAEw9LaZZv CjW8hFclYIZPBK/CchU1FHhUOP0q420hllVWsKiwQV3/xe/ydPBamyFjRhJi9oQFXAsF YrQBfnNm/AkKSoenm8m0SoHDqC2Kic7HC0hU29D3266CZSLxrnNHQn3AENFkajzJ7s47 m5kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mMXsypKuztS3I5PSsSsWnIRpjlg2TPjWEKfPLJ/XywE=; b=sANFG8Gq4zRoRq7VifnNpwAvrr9h7WTjiVLlW/FkxNkJgolu8hZoYd4zMQjTc/RU4O RNL4965HiE2lKVDQGOp2/oeHupbjEdjAdsbbrEQFC/LIF/qXHM6tDpLJtXhBcLIbRVqO qAQ7GuIbHFPVb4sd4pFlFFX1uBoqRqp2U43VuKmZ4tohbiwQ8U6ZyvkO3NeHC0+ZZ/ck V9PxgxgRupqfAP9pQvzMNHCyAEag94iJtmaxAxms4p4ezan5nrn+yu/5ad/s4UBkH8fs x/ZesrJBnQThUaMQM5VQRNo9Ekla+D6J1LfnP+utMcydzcpkUCIvVEmPtiArKR/IKEhw h5fA== X-Gm-Message-State: AOAM532rArF7NhVmXJ55equmxmAS9YmDVsfro2yj4qq2rkoBhUEwKGDl 975xZmFrqusT8k25hxBhzyw8dv87wvdHfg== X-Google-Smtp-Source: ABdhPJyS/afo/5LRY/Ij5x3fMIAuPoFz+ya2XNwiLRUKecUV2nEquF6+/zjeh2VfOmlD32FKa8a9Ig== X-Received: by 2002:a1c:dcd5:: with SMTP id t204mr8859825wmg.17.1595602597929; Fri, 24 Jul 2020 07:56:37 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id h5sm2073156wrc.97.2020.07.24.07.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 07:56:37 -0700 (PDT) From: David Plowman 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 ColourCorrectionMatrix control X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Implements, for the Raspberry Pi platform, the returning of the CCM (Colour Correction Matrix) used by the pipeline in the libcamera metadata. Signed-off-by: David Plowman --- include/libcamera/ipa/raspberrypi.h | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index a493776..ca62990 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -56,6 +56,7 @@ static const ControlInfoMap RPiControls = { { &controls::Contrast, ControlInfo(0.0f, 32.0f) }, { &controls::Saturation, ControlInfo(0.0f, 32.0f) }, { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) }, + { &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) }, }; } /* namespace libcamera */ diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 7bd0488..3747208 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -438,6 +438,14 @@ void IPARPi::reportMetadata() int32_t focusFoM = (focusStatus->focus_measures[5] + focusStatus->focus_measures[6]) / 2; libcameraMetadata_.set(controls::FocusFoM, focusFoM); } + + CcmStatus *ccmStatus = rpiMetadata_.GetLocked("ccm.status"); + if (ccmStatus) { + float m[9]; + for (unsigned int i = 0; i < 9; i++) + m[i] = ccmStatus->matrix[i]; + libcameraMetadata_.set(controls::ColourCorrectionMatrix, m); + } } /*