From patchwork Thu Oct 5 10:41:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 19101 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 8E8C5BD808 for ; Thu, 5 Oct 2023 10:41:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F1FB562963; Thu, 5 Oct 2023 12:41:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1696502500; bh=W6MC9vIXn2F2vrhxOo+f6BLDrOcP/J1tJrxVOdCIKIo=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=U2xL5m89cWqE5hyBzQkxSvaFEpEI5S4q4XIcyVBBT5SOKEtFA5AVBNcmKXE5ZXLGC ynmKlag2miSvF0ddRCWK0vKpJ5nY7L4vGQQcvhg4nDuPaqDTGi4n7x785dkppR7+K9 /GDxZtALEkGEx3FVBpSwyQwWezFwGVjLqgpF1T2tE+IIgSHST4am9hd7hePMvGcz/w KgtLMgerYy237Si7hF6pLaV/2yIdwd236YMN1ApRl7Xv+iw1/goCd+p4izEXeYa/T7 CG62PVXf5GzHokkSvIuECwWZhi1Hu6w+lOdnuS3GnfBn9nsnfmOKiVmYwPFzxYKs54 qxMpOAGXcEepQ== Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C62D661DE0 for ; Thu, 5 Oct 2023 12:41:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="DLehWdOd"; dkim-atps=neutral Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50585357903so1056295e87.2 for ; Thu, 05 Oct 2023 03:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1696502496; x=1697107296; 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=rk5xJd2HIOYVuQ6smkG7kxRdlVcbQcMTST8HSuuTyUA=; b=DLehWdOd5iROycVrTfXgwmb5NcvGqFGDw4csAafNiWb5/OK/h5C7B44uN2QYNNIxI+ YA9+o5XW+1jGp0odmPqaWfMXmEch2WWms/slDHOW0wBAIdqWLnP1una4NGKcjtrvFr9i Dyn8e37gytjR4jtvCJSMCJzwZ4IIRuSe60msV9Mbr3FeAOyQiPjL3ZQZv28k9AGF6jEu XwlSCtPj1/GXnhqOqInBRSxrye3UXMbJso4xFPEjiPNH+SeJ91fEFGQbzGxNR8MHsEqz Cwtgq1mIJB+z3kobc14NKAqXcxYz6vUxd8PSnoT6PSxm7DeRJLll/C2KpgtVaLRj3ZpB v+7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696502496; x=1697107296; 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=rk5xJd2HIOYVuQ6smkG7kxRdlVcbQcMTST8HSuuTyUA=; b=vvp8yL+g14pGFVMUo0DlD/9OlVhBUPzGHz9zsMr3B56aqT+UE5u4d5sD3sbNwaxpGU cEbqd8tb+EJD86qhEmZ5cfJ/jIMzt4ar6TPzVNor6052XtvmOkKjCt46yaMAEtQ5CRxh TBvKQF06XQ81BpkpTv+d8KxLtsL4IQToZGVZ1FUR2DSdPRGZoa22EDk6a9K/vDYYoV7P i/3rIi9inrFJpUucO/VLubxiAwQ7Nfne7tYAL9JhcagEJ2wfN1+xIOD+7z2xM2EOYKIC QuZrYMsu+CKO4JdFQno6xHUKW521XVmBJ1fln70IdNNSW9XQiM7RI9FbqMsHpGgjpk/W BpJA== X-Gm-Message-State: AOJu0YwjDsF6ueHresC+xVSdZ8/14CukErR5RgegBWIFcQ3LmoMuKZYL 1mTRQPRz0+dkTLIfMb7vAfsnphTYjdm9KaSKOts= X-Google-Smtp-Source: AGHT+IGRrbm2ag7ljdQPYKO6EWYkxEDiS0QhV36BTIW2KmjTUvRGG89uYjIsQa57CZ7qhu35bS3M9Q== X-Received: by 2002:ac2:5b1b:0:b0:503:2924:f8dd with SMTP id v27-20020ac25b1b000000b005032924f8ddmr4453470lfn.47.1696502496420; Thu, 05 Oct 2023 03:41:36 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:2bce:64d6:1a5c:49a2]) by smtp.gmail.com with ESMTPSA id z23-20020a1c4c17000000b00405935b417asm3502780wmf.2.2023.10.05.03.41.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 03:41:35 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 5 Oct 2023 11:41:33 +0100 Message-Id: <20231005104133.51901-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.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 otherwise) 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 | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index f2e542f4..e3699e74 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -774,6 +774,69 @@ 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. + + enum: + - name: HdrModeOff + value: 0 + description: | + HDR is not enabled. + - 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. 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. + - name: HdrModeSingleExposure + value: 3 + description: | + Multiple frames all at a single exposure will be used to create HDR + images. + - name: HdrModeNight + value: 4 + description: | + Multiple frames will be combined to produce "night mode" images. + + - 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). + + 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. + - name: HdrChannelNight + value: 4 + description: | + This frame has been used to produce a "night mode" image. + # ---------------------------------------------------------------------------- # Draft controls section