From patchwork Wed Sep 25 15:21:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21370 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 D1E50C3257 for ; Wed, 25 Sep 2024 15:21:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D04126350E; Wed, 25 Sep 2024 17:21:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="M9+EBCBU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0650C6350E for ; Wed, 25 Sep 2024 17:21:39 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 67985A30; Wed, 25 Sep 2024 17:20:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1727277612; bh=Xb4kFu3MC60bJ9HiWNsd5B0IjQzz8KbAsaoIoSWqSgY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9+EBCBU64juZg7u6HBk1DvtZ2RRpMr+VeHrEhFfnuuwbUhTLTVAYbxqqykuIgTuo p8dCLVl12vEo6lqhg21pbv5Q9e2dT5/BxZfDsVnb104/X6Hf5PvNqOsiJ18Q9uKFyX +uyoBAS4hepuHF32JHB8Hun0vn7CE8TFHaY/8lkE= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Cc: Arne Caspari Subject: [PATCH 1/2] apps: Replace HAVE_DNG with HAVE_TIFF Date: Wed, 25 Sep 2024 18:21:33 +0300 Message-ID: <20240925152134.20284-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240925152134.20284-1-laurent.pinchart@ideasonboard.com> References: <20240925152134.20284-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 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" Support for DNG capture is conditioned by the availability of libtiff, which is indicated by the HAVE_TIFF macro set by meson. The dng_writer.h header then defines HAVE_DNG, which is used is a couple of places to conditionally compile DNG-related code. Most of the other locations where conditional compilation is required use HAVE_TIFF. Using both HAVE_TIFF and HAVE_DNG is confusing. HAVE_DNG would be a better name, but as the macro is defined in dng_writer.h, it would require all files that need to test for DNG support to include that header. Failure to include it (directly or indirectly) would result in the code covered by the macro to be silently disabled. To avoid the confusion, standardize on using HAVE_TIFF everywhere and drop HAVE_DNG. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal Reviewed-by: Jacopo Mondi --- src/apps/common/dng_writer.h | 1 - src/apps/qcam/main_window.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/apps/common/dng_writer.h b/src/apps/common/dng_writer.h index 917713e61001..aaa8a852b307 100644 --- a/src/apps/common/dng_writer.h +++ b/src/apps/common/dng_writer.h @@ -8,7 +8,6 @@ #pragma once #ifdef HAVE_TIFF -#define HAVE_DNG #include #include diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp index dd2aa19618a1..5144c6b3eb30 100644 --- a/src/apps/qcam/main_window.cpp +++ b/src/apps/qcam/main_window.cpp @@ -211,7 +211,7 @@ int MainWindow::createToolbars() action->setShortcut(QKeySequence::SaveAs); connect(action, &QAction::triggered, this, &MainWindow::saveImageAs); -#ifdef HAVE_DNG +#ifdef HAVE_TIFF /* Save Raw action. */ action = toolbar_->addAction(QIcon::fromTheme("camera-photo", QIcon(":aperture.svg")), @@ -646,7 +646,7 @@ void MainWindow::captureRaw() void MainWindow::processRaw(FrameBuffer *buffer, [[maybe_unused]] const ControlList &metadata) { -#ifdef HAVE_DNG +#ifdef HAVE_TIFF QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); QString filename = QFileDialog::getSaveFileName(this, "Save DNG", defaultPath, "DNG Files (*.dng)");