From patchwork Thu Oct 19 11:52:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 19147 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 4A294BDCBD for ; Thu, 19 Oct 2023 11:52:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A9BCB61DD2; Thu, 19 Oct 2023 13:52:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697716346; bh=r+WpUHdyhKOum5FUgcQGtMvWPAjhPTGCbKVC65+rC+4=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=VmwsGF7TBnt8MysJujsViKFYHQP1yS4Spl/cSLIO6lMMj+XPtJaD/dj1MwriN1Ier 30Q1YTILRSDMRcTtgblgCnAEEGY7dfNBtUdNTNoN74CGaydw7gu9LJn7fK2LZoXYiB U+VohdoAlIAEf6cDnygcx6qeEech0LalmZ/OM9D67UIxSJxYNv5kndZi6pchPT1Kvg bYClJrgNv+MIC9i5df+4k/3WuRvdFtgl6Zrs04c/YQeM9GvTEcX0HPpwE9ll0qSAYe V+o/rtOJvTNl+bMI+CvwJmCmJAhWgoKYCScPHK04IGuZko3YX3K2RXTln1pNZA10sv Q4C0GzNkXrx3A== Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 749816055B for ; Thu, 19 Oct 2023 13:52:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="b9Da24dl"; dkim-atps=neutral Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-405361bb94eso82310615e9.0 for ; Thu, 19 Oct 2023 04:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1697716344; x=1698321144; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qurrxL0MpuGh55LWDIGOT3M5T99WOrLm3HHCn2AnTCw=; b=b9Da24dl938ct2wRefP2fomDUfSK7QbdUxv+FDL/3NDJXYNVFaVq2UivE0AFsGFVMK DP78qAKdndgdnp1nbtdQijJKErbQ3XWmpOt9S8nGU1LwWVJCaJTevWZaunb5b2gE0J0X FgWeYQlD7qt8X8UT+dwx1GUog/sCTWjtLIojA66ay8oh0zGpo6EqFgn8ZYmJYZi+8mze dj7dp05R8fXG/ifpPMawmIzcZ8l9bGG83vepXu++KE3l+s3aw4A442bwt0+TGQyxNW0c +53tX1gzesGk7hY861BFKUdSy/wN5FJSO2+EasHWADAS/PUQqWqFIYPvWhFDrOjBsAee Wg/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697716344; x=1698321144; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qurrxL0MpuGh55LWDIGOT3M5T99WOrLm3HHCn2AnTCw=; b=kAxASBYYu5uv5YtuRy6YdJuL0BdiDj6Qngdvi0gcMxfWgaI7r/7XS3l2VYi4C+hMN8 A744U6KDkR62qtamVqDLbT5LeYd7FQ0PDwrLo6KylzUpQ9p6Okf+kC1FXbnS9FUkewAd z8e2snE5nFnuBzjTyaEsNdnoNTY39QWqnMXHxUA45jI84qane3BWlIYWUNWbAyXMRC8D q1OcgXhmIJu9qd3iDlaXFqI5qf5ae6YmE56FVqnJjTOx5v4RDV8+l5MuD4iAhgCkgVM2 0koyLwvd40tPMHcnn5IXYYMwmjVtjLWyhs3XP3RowvvN6bUpPZ605bKm4dbtTNxcBj5E I7Iw== X-Gm-Message-State: AOJu0Yzw1K7euQxz4nw5YiKWUMbQLSpwyUki2i0iX5xAa63eTL30zBCv gdQhyNnEu5qbMHBDQwKhybQtgPywkdLcRG/vIaI= X-Google-Smtp-Source: AGHT+IHcOm1E2j2goUAYnTJQPUfVap2fMMqPl5AHToHSVv2jLzRyg8O+5N/wtauSUyR8Qm5dZoZBEg== X-Received: by 2002:a05:600c:4f91:b0:407:4944:76dc with SMTP id n17-20020a05600c4f9100b00407494476dcmr1633357wmq.20.1697716344449; Thu, 19 Oct 2023 04:52:24 -0700 (PDT) Received: from pi5-davidp.pitowers.org ([2a00:1098:3142:14:183e:6cc8:a436:a27c]) by smtp.gmail.com with ESMTPSA id j20-20020a05600c1c1400b004065daba6casm4313789wms.46.2023.10.19.04.52.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:52:23 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 19 Oct 2023 12:52:20 +0100 Message-Id: <20231019115220.4473-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3] libcamera: controls: Add controls for HDR 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-Patchwork-Original-From: David Plowman via libcamera-devel From: David Plowman Reply-To: David Plowman Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" We add an HdrMode control (to enable and disable HDR processing) and an HdrChannel, which indicates what kind of HDR frame (short, long or medium) has just arrived. Currently the HdrMode supports the following values: * Off - no HDR processing at all. * MultiExposureUnmerged - frames at multiple different exposures are produced, but not merged together. They are returned "as is". * MultiExposure - frames at multiple different exposures are merged to create HDR images. * SingleExposure - multiple frames all at the same exposure are merged to create HDR images. * Night - multiple frames will be combined to create "night mode" images. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck --- src/libcamera/control_ids.yaml | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index f2e542f4..c3232abf 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -774,6 +774,81 @@ controls: Continuous AF is paused. No further state changes or lens movements will occur until the AfPauseResume control is sent. + - HdrMode: + type: int32_t + description: | + Control to set the mode to be used for High Dynamic Range (HDR) + imaging. HDR techniques typically include multiple exposure, image + fusion and tone mapping techniques to improve the dynamic range of the + resulting images. + + When using an HDR mode, images are tagged to indicate which HDR channel + (long, medium or short) they come from. + + \sa HdrChannel + + enum: + - name: HdrModeOff + value: 0 + description: | + HDR is disabled. The HDR channel, if present, will report + HdrChannelNone. + - name: HdrModeMultiExposureUnmerged + value: 1 + description: | + Multiple exposures will be generated in an alternating fashion. + However, they will not be merged together and will be returned to + the application as they are. Each image will be tagged with the + correct HDR channel, indicating what kind of exposure (long, medium + or short) it is. The expectation is that, if necessary, the + application can merge them to create HDR images for itself. + - name: HdrModeMultiExposure + value: 2 + description: | + Multiple exposures will be generated and merged to create HDR + images. Each image will be tagged with the HDR channel (long, medium + or short) that arrived and which caused this image to be output. + - name: HdrModeSingleExposure + value: 3 + description: | + Multiple frames all at a single exposure will be used to create HDR + images. These images should be reported as all corresponding to the + HDR short channel. + - name: HdrModeNight + value: 4 + description: | + Multiple frames will be combined to produce "night mode" + images. Images will be tagged as belonging either to the long, + medium or short HDR channel according to the implementation. + + - HdrChannel: + type: int32_t + description: | + This value is reported back to the application so that it can discover + whether this capture corresponds to the short or long exposure image (or + any other image used by the HDR procedure). An application can monitor + the HDR channel to discover when the differently exposed images have + arrived. + + enum: + - name: HdrChannelNone + value: 0 + description: | + This image does not correspond to any of the captures used to create + an HDR image. + - name: HdrChannelShort + value: 1 + description: | + This is a short exposure image. + - name: HdrChannelMedium + value: 2 + description: | + This is a medium exposure image. + - name: HdrChannelLong + value: 3 + description: | + This is a long exposure image. + # ---------------------------------------------------------------------------- # Draft controls section