From patchwork Fri Jun 19 09:27:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 4101 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 03BCA609C5 for ; Fri, 19 Jun 2020 11:27:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="k8F9rQuJ"; dkim-atps=neutral Received: by mail-wm1-x343.google.com with SMTP id r9so7802070wmh.2 for ; Fri, 19 Jun 2020 02:27:55 -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=al417ZoyvhZTJN/nkNKL4b92jhJkUbp6nCYhmxuDiBU=; b=k8F9rQuJMrQzQCWDeOUrP8Izs1G8Nvi3UW9Nxrhyrf/5Ni/5X4oqvz+ixqLzZgjzLE lXd5IQiQaeguxDTvNo9VhJ+dAQfL/gwAlkiOcA68afTMm33qmXnzGlahuHjCBjWaswqN xeoB8QDcaqSDcL2VVKYFfscvSdV0Bdswds+Dk+AixQ+ios43PKDj51tnQ23Z8zgHEjdY l11nw8CEdvIEPD/30opATqoIPtQd5Xfx6pC+yn70ott6cRxUGJzMf+Xgv5eYROiJ48W8 gGZK6ArP/Qc3W3fhU6slgmmOwJlmnPA8ZANApPw3kT6LAqLHrj5MY8LS9fKH+kCXsUuJ HurQ== 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=al417ZoyvhZTJN/nkNKL4b92jhJkUbp6nCYhmxuDiBU=; b=N6l3FRzmplEQW+Z63WHBgZDavTZvzqWXMNRZUZ0CVkgOGUuuhx0VfB/9gPq7deJlSq ZOdXLdOifE5jCGw7GvFy3HIePU39PGh0H2YWXvARgpwTf6cepr2O5jOZGwCHRnyeFMDv tiNeqEH2djLo3TZq41W0pZlCARd7DPwwpvSZpFjq3+qYdqVO4rTdHwefdSN8RoX7MoM4 2TTIg//UpF3/GMgs2rTJIl9CgAVaWK91PEn9GveRbBIB3424zYH3lQ3hE8jGYm/cTEgI k4CECq3uZIRG0vWmlDpLovbVVJoASdeYeauEKBNzW6crb0FCjhDo5CYMhkwemuZPaq41 nFdA== X-Gm-Message-State: AOAM530NqypvYXnEhLKbB4ctB4fNm1A85z8j1kjHYKawRerYYhezw+3v 8o6B/HaLUfs3z8I8wz2hulT6kESldec= X-Google-Smtp-Source: ABdhPJyJUNGanz5IlgbPck55QxtYl6BY3qD0FWkwz5iX0RJW0iUeV7BQs7yJyUPYMgP8xADYsTMUzg== X-Received: by 2002:a1c:cc07:: with SMTP id h7mr2734941wmb.179.1592558874387; Fri, 19 Jun 2020 02:27:54 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id n65sm5156154wmf.47.2020.06.19.02.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 02:27:54 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Fri, 19 Jun 2020 10:27:25 +0100 Message-Id: <20200619092725.19109-4-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200619092725.19109-1-david.plowman@raspberrypi.com> References: <20200619092725.19109-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] libcamera: raspberrypi: plumb the libcamera sharpness control through to the Raspberry Pi implementation 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: , X-List-Received-Date: Fri, 19 Jun 2020 09:27:55 -0000 This simply wires up the libcamera sharpness control in the Raspberry Pi IPAs so that it controls the strength of the Raspberry Pi sharpness control algorithm. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/raspberrypi.h | 1 + src/ipa/raspberrypi/raspberrypi.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index c109469..a18ce9a 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -51,6 +51,7 @@ static const ControlInfoMap RPiControls = { { &controls::Brightness, ControlInfo(-1.0f, 1.0f) }, { &controls::Contrast, ControlInfo(0.0f, 32.0f) }, { &controls::Saturation, ControlInfo(0.0f, 32.0f) }, + { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) }, }; } /* namespace libcamera */ diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 9669f21..2f2550e 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -47,6 +47,7 @@ #include "metadata.hpp" #include "noise_status.h" #include "sdn_status.h" +#include "sharpen_algorithm.hpp" #include "sharpen_status.h" namespace libcamera { @@ -631,6 +632,17 @@ void IPARPi::queueRequest(const ControlList &controls) break; } + case controls::SHARPNESS: { + RPi::SharpenAlgorithm *sharpen = dynamic_cast( + controller_.GetAlgorithm("sharpen")); + ASSERT(sharpen); + + sharpen->SetStrength(ctrl.second.get()); + libcameraMetadata_.set(controls::Sharpness, + ctrl.second.get()); + break; + } + default: LOG(IPARPI, Warning) << "Ctrl " << controls::controls.at(ctrl.first)->name()