From patchwork Mon Jun 22 13:55:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 4112 Return-Path: Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F761603BD for ; Mon, 22 Jun 2020 15:56:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="fs9O5tZj"; dkim-atps=neutral Received: by mail-wm1-x341.google.com with SMTP id g10so14966804wmh.4 for ; Mon, 22 Jun 2020 06:56:09 -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=szZXl6QaV/4cRk25Zk5zyFZjAjLl0G9Vvu2sYyyNpS8=; b=fs9O5tZjswV2KulfyIakCXvAtpkbdAe6zWCvrVTrC8kPT84YTsychzxU/4k7+z9KjH 8rI0vkmU/dNKUlBE4iRrymP8CbxMAFyo00FFl62RQllrV8ucxQ4rRAoM6aMTlsjgKmPA Wq1oeXHHsytiRp0DxlTlf4vhHw9bgDQ1310PX9iYF6QSIDn3SyZvi1TfA5EUJBXgjQOu JBY8XEVYTU0c6M8wwvqKAhqaFSAiDRDxTbpQZJYQruf6luofNbY8WEh2oVE/SVsV7hdL tsZ0a/yiamNcpXxIbSznn+fid8o+yciAEvUu7q+ScTWyyW5WLrwF3J684wyBg9CwA4AM 0PNA== 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=szZXl6QaV/4cRk25Zk5zyFZjAjLl0G9Vvu2sYyyNpS8=; b=tehJF6X2/bEVHpmsmyjYvrW2eKTgDyd120kzhxHFe3camGuA8VK2TncNytviriKMid uA2cmBMOvRZ8dkl7hdryCTCGwznybssKIJnjMe/pjq0kwWw949e2chIigr7fx4Utl3Q5 n8HxtsLnsl1xr+TJ5vyasAw36pXvQ2RLMvtdbcjxugcHiKMMiF/tfi1Cb7QR2fv0BIgt wr3qKBD5Em177KE8v2RfP+Q4yqI6ZIbPYdyIWEx8vDVAf7i38fPPusxshF7kJ84ga9WK cOr4KaisnoOD09gm/AytkmUrxfkOppjJOHIkyrLW9Cguhv6L7VGEnhtaa5JEhdXAFsfT GImw== X-Gm-Message-State: AOAM530nmwBBGOM368uCaybYTWA0tLwyqi4pxTtNcdRtGyunCxMyBTL3 hjFJN60WaE02rkCSGdzkG3Ii/OcRrCI= X-Google-Smtp-Source: ABdhPJwtiuzpeKl1qCe3J2ISQR5vI8wMxYiSEgv7vMAjqqwz2OEMgSBHnkpmCaZsSfTJiI24rs/JZA== X-Received: by 2002:a1c:4343:: with SMTP id q64mr7104104wma.20.1592834165686; Mon, 22 Jun 2020 06:56:05 -0700 (PDT) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id c201sm12742903wmd.4.2020.06.22.06.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 06:56:05 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 22 Jun 2020 14:55:50 +0100 Message-Id: <20200622135550.10788-5-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200622135550.10788-1-david.plowman@raspberrypi.com> References: <20200622135550.10788-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/4] libcamera: ipa: 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: Mon, 22 Jun 2020 13:56:09 -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 42c84b1..bc89ab5 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 { @@ -633,6 +634,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()