From patchwork Sat Jul 4 09:59:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 8619 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 3FEC8BD794 for ; Sat, 4 Jul 2020 09:59:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B1CF860DFA; Sat, 4 Jul 2020 11:59:27 +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="Mpsb9vD6"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 66FDE609C7 for ; Sat, 4 Jul 2020 11:59:26 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id a6so23767383wmm.0 for ; Sat, 04 Jul 2020 02:59:26 -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=GFh3wkDdONKwREfYhfL0pB5YOH4zlaqiZUR/aVLv/zk=; b=Mpsb9vD6lJqDCYsb0/oBdy8+Pk9DR+hGeYjQ82OlMl/xCknvJ9j+6LKQ3KqxBcuP3N pJIHXGn3CzqQYSQMXNTNTNU3Z9cA2vVFsXxp5aciK+mZTVgpbMGUk9LIKY+hF6nHoi6O 8d7h6Bqdcou7msu2xs6FVVhHJTbZnmapzKpZ/nzIr7DsIcEXz5wBngt8RPaCHdXrLeyH uYyRogPjpOe/QyHe1WY+QgQbIxGtIQC+S8GKjQCQ4tev58a4Llnu/ONmOAqLznKGcSH7 2XgQ/HIqsKuUfu5oBHhAqo7rczE55j+7rQukNFZl3P7Mj6soBW/zysHDswSu14bxtejv tA9g== 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=GFh3wkDdONKwREfYhfL0pB5YOH4zlaqiZUR/aVLv/zk=; b=BtGRHyMiBUp9bN5jjwN88Mf5mUglttAllGiq7xFMZXeGir3kyI6ARBcqmqS5guW7hi sbaIiCta0tbCpzK9I9ApuYMTFD6ANNhw+uXAfJl6ciEgh5pr/8lpC81q/HPZZ4ljTb5N v34549PpwcapSlMRz8OPXtnxYeEMYasJDCRjrNT1q1CYMCYXLCX7SYaIsGdGgSZ2m29P TRx+iSEejwkZvB8Pzu8TElMaTNils8kgd3F/H31OT267LbTQyfV6rbqHJ30NoiqkSKlR u7IbGuA9OjHnhrXr/xww7O5n7KxRXGB4ZyRh9qSRY0tg7jpPYJRmdIFumAo/PVeYUFkV xBKg== X-Gm-Message-State: AOAM5337Hs7xB0unXWn42c4+YrRSFr2fISx0tQOFD7ONdFYUHVcjEPpV eUJgw1vPW6bc7T437hqBXj3+LWgmyew= X-Google-Smtp-Source: ABdhPJzkhS7h8202DUxGPksfJCthQ1ZZFl1X86ROwef/JK0BAlV6crSw7uj2FPXVWlN3iUblpsevag== X-Received: by 2002:a1c:f714:: with SMTP id v20mr39337667wmh.81.1593856765577; Sat, 04 Jul 2020 02:59:25 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id z10sm11477681wrm.21.2020.07.04.02.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 02:59:25 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jul 2020 10:59:13 +0100 Message-Id: <20200704095914.17344-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200704095914.17344-1-david.plowman@raspberrypi.com> References: <20200704095914.17344-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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 | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index a18ce9a..2682319 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -52,6 +52,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 bc89ab5..592bb04 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -404,6 +404,15 @@ void IPARPi::reportMetadata() static_cast(blackLevelStatus->black_level_g), static_cast(blackLevelStatus->black_level_g), static_cast(blackLevelStatus->black_level_b) }); + + CcmStatus *ccmStatus = rpiMetadata_.GetLocked("ccm.status"); + if (ccmStatus) { + float m[9]; + int i; + for (i = 0; i < 9; i++) + m[i] = ccmStatus->matrix[i]; + libcameraMetadata_.set(controls::ColourCorrectionMatrix, m); + } } /*