From patchwork Thu Oct 26 11:11:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 19185 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 30507C327D for ; Thu, 26 Oct 2023 11:11:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B299F62994; Thu, 26 Oct 2023 13:11:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1698318698; bh=CVWFBjMLgDkXXVbU8ybiTaHlgWfcIHV0SuNTDhnAp6I=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=WL8DsOAlEHasM7Sqk8xtqNggDu6zoeN3hXW8cOxdkRy0bJNGnzMfZGhrU0NMaJJZN 6pQq2TUuhbBCaNlfPIuMz/5hqTrG0+dFHSJyx0BtAZJnmT2Fh7dwGGUBnKXbNvNPE0 9jH0NVwdYNWHYwBePqUoBVBcjwXmAmqQbkJpaFDOHnty+WSZnLdUzuRV+t5YDBNDYf AJnbgA9e5OAL6706SyKIgOts41nNghZfzV4KCR0BXzSkmMOubM3fs6lRZZTpmVrCiT ejJtQQyjk8beco1YspMftrqQ1qvdrIWNuauhCM9qKfhhdSNcRNqYK75NDvmVqcg1f+ LpnzBDqahWYQg== Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2BC7861DCC for ; Thu, 26 Oct 2023 13:11:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Lipy3ToL"; dkim-atps=neutral Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507d1cc0538so996065e87.2 for ; Thu, 26 Oct 2023 04:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1698318696; x=1698923496; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gxOskV8UzvecY8xY1yQW50AQO4/lzeWW1qDI24zjCvM=; b=Lipy3ToL8FECMbgyQ27vwzPshBE6sBVmJBlSO76d4sw7K8OE9dGIt1quKsoOB38t/J r8YCnTUvP2XPTsXcjt66HMLclxMRRFmY0rMQaQxxQuY8Kpl7XAWzHKd+EEHZo6GOhJIS vHxRCfHouqhIfV8fmoVueTnHiv0Rn+b2Mn+2jH/4aZ9pR9R8BxzLZ1733tM2EPWbY8J5 YdNDMqICyCLyDUSzh1JXCnYRHmgkKreKW6vAin34v+4WkYs0gETBBpZWjScDsz96gjKC F28M0HTw4kPnnse8hd6ol0a+TtQV2oIdxWxbhhTKhieZToRIKTsFLvlm6A4LGbA1jmbO m5Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698318696; x=1698923496; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gxOskV8UzvecY8xY1yQW50AQO4/lzeWW1qDI24zjCvM=; b=E8hI9jnFn/NBmR0FgzTyb9MwJdUiLWj31QOIISGXGX16lTiSJX55zJ6gB+JRhd6CvN gC71zCEWECqpeBTL82hx4Dz6SvLfYDPXwPMR2TZuTXSJZqoi8btrSaJMi8hJ5SFlaKLP bPW/rbVxqtPP/x9Y2Oj0rl34M7ruiJ4Vg947ssvhntXc1pKgWIfzUsx70Mca/Gnolh13 Ci7o78eKjTfuxuYEcZDM2zWcQi3Qk4Y07rSjbPv8jfoGlCE0YjIEaSywgvKcQ6l3Cvbt f9c5lMDpKrGF2HNnpVR7ILb/Belgum2R1kCtcd6slwbkTJbtsoIn3ovkSLoycUflfyHr Q7Pg== X-Gm-Message-State: AOJu0Yxop6hW2xiMsYOKdBQeHIovxFXJyBTCLTW+pXnK9NKY/6QT0BTs /RyjueIODdzcJjV+DSU3uQKiLqfIftMRPfwI2ZY= X-Google-Smtp-Source: AGHT+IFxf7HVGf472czesENOij+iChnsSJt825RFXbwvFZwHsJ/YUOxTstys+TjPRhK7J3dYcze7tg== X-Received: by 2002:a05:6512:314e:b0:507:9702:c11d with SMTP id s14-20020a056512314e00b005079702c11dmr11361433lfi.64.1698318695980; Thu, 26 Oct 2023 04:11:35 -0700 (PDT) Received: from pi5-davidp.pitowers.org ([2a00:1098:3142:14:183e:6cc8:a436:a27c]) by smtp.gmail.com with ESMTPSA id d17-20020a5d6451000000b0032da022855fsm13960075wrw.111.2023.10.26.04.11.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 04:11:35 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Oct 2023 12:11:31 +0100 Message-Id: <20231026111131.93825-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231026111131.93825-1-david.plowman@raspberrypi.com> References: <20231026111131.93825-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 1/1] 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 Reviewed-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index f2e542f4..06a9128c 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -774,6 +774,93 @@ 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. Metadata for this frame will not include the + HdrChannel control. + - 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 it is. The + tag should be the same as in the HdrModeMultiExposure case. + + The expectation is that an application using this mode would merge + the frames to create HDR images for itself if it requires them. + - 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. + + Systems that use two channels for HDR will return images tagged + alternately as the short and long channel. Systems that use three + channels for HDR will cycle through the short, medium and long + channel before repeating. + - 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. It + is up to the implementation exactly which HDR channels it uses, and + the images will all be tagged accordingly with the correct HDR + channel information. + + - 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. + + This metadata is only available when an HDR mode has been enabled. + + \sa HdrMode + + 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