From patchwork Fri Oct 20 09:38:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 19168 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 0C8B7BDCBD for ; Fri, 20 Oct 2023 09:38:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6402A61DCF; Fri, 20 Oct 2023 11:38:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697794726; bh=+lwZ1ZezLUG0swrxODCOFwHKhJ8x6NgLxETFcIYjCYk=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=iXK6QwDpi7yNDPbwkgBwaYcBT4yidTDpVvejeBhkxJWCTSvmXtXRQSzKKyvqnqLax Y8pIGG1DrIwdc32KIF7zcj05EMYxh2XpSnvYxM1ipwtmXKVb5wJig9x8Ht+ORxwSgS MX91KQ2SWKXeeGgzX04RdtlN8ZANQni7guXxq005oHuVe88pTLMPxMUj/BZnePHVHq AI86+y4hDFggKLWCLMoiESeJ6cwWzKgazlKlR0Aui/UblldL0rC6NPhmlcki9+VSlr s455Hf8OFFHGaH4dlclerJEnibYSl1GQ5MbLJ3PdUgPRGvZvN8Sq28UGSkwKTIPA35 aV7CspYZ6WIEw== Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E6E0061DCF for ; Fri, 20 Oct 2023 11:38:43 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="fgEEsNuJ"; dkim-atps=neutral Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507a0907896so816922e87.2 for ; Fri, 20 Oct 2023 02:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1697794723; x=1698399523; 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=uTIO5q/PF0URBiCan3Omw4PCqvDMsVK0e9KVOGQrCes=; b=fgEEsNuJiZA5nFzEZ5QAXCLjjrYV8K002IuR7T351nod1UUt4xeZAj9YX0/PV3L/L0 2/vrZKFhhDpXQR5h3A8krF1WL33X3Hr4hWg0XZVwgim9ZiNRoj3zFNYk9zzCPiFfqRVq Z8qc4uZ0Ovywi60HXRC6/ywfuoDI8Tp1npeeGYZnKa/pAGssv3SJfUok3NIQvPdKnFRE x4b9jAQuoVMkt0vCwzh8bjPoND73IDtdJKLia2XgoRk8hMqdJLkeQuv67L6LzHfnH+Rg NPzbU7vtP+uGFjNfLf44+PaoGqtU2TkMSLKMmOQPpe7ppR14cTDhbSRhgioDoLq+yePH uMNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697794723; x=1698399523; 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=uTIO5q/PF0URBiCan3Omw4PCqvDMsVK0e9KVOGQrCes=; b=e+V3p2Rp9C6VmLb4BFeYNc2+c9A8KRNXIF7m/0qMN4GQMBXTkumSvkfhXNsHs2v6Hu cSHFT2N8p2IFJH4fD4olbSVhQGIoPLIiaB03Tis8MR6OtGxd3a688Pvw1oRC6hP/KuJs M9XjobhqTj+xYrfy4Xtu79HPY1B0OdvGwa9j+qlgasIfERYseUQ+b6I2r7azVz9l7syR oxBV9obTtEOfrYyZPv0CX44XJhpb4MOT6nAJxrxaaSPtZ7wYEWqFze+mvFXUmwypriTc 71W3j9kKwpYF3jLVa+WyduptRVzhClTYIi2R5eyzLPzNkbcvfgLd9owrVj8hM+bnFQ8m yOSA== X-Gm-Message-State: AOJu0YwTW3cjFPPkWxkTlayBI6i7YvJYPRVWPzRn/KoEVvZpPKcUYMPJ 9ltGyhfB1QJb4LrU+zsm9MRSOeI50Z6niwlNQCw= X-Google-Smtp-Source: AGHT+IH7oGIN/jvnIEzrRI5E2Sj7gc6weHtWsX6PW2xM3K/AJW+ZnMmnWSHS/aW3yGkTuXTTnidbbg== X-Received: by 2002:a19:5051:0:b0:507:b084:d6bb with SMTP id z17-20020a195051000000b00507b084d6bbmr842250lfj.43.1697794722602; Fri, 20 Oct 2023 02:38:42 -0700 (PDT) Received: from pi5-davidp.pitowers.org ([2a00:1098:3142:14:183e:6cc8:a436:a27c]) by smtp.gmail.com with ESMTPSA id n18-20020a5d4852000000b0032db4e660d9sm1288260wrs.56.2023.10.20.02.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:38:41 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 20 Oct 2023 10:38:40 +0100 Message-Id: <20231020093840.114689-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4] 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 | 79 ++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index f2e542f4..863402ff 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -774,6 +774,85 @@ 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. It is + up to the implementation exactly which of the channels (long, short + and so on) it uses. + + 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. + - 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. + + 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