From patchwork Fri Apr 3 14:53:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3374 Return-Path: Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C788562DAF for ; Fri, 3 Apr 2020 16:53:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="nC6cwVEY"; dkim-atps=neutral Received: by mail-wm1-x341.google.com with SMTP id e9so8033574wme.4 for ; Fri, 03 Apr 2020 07:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IzcmklKpVXrbMixcRIF+VW0BbWQaOeVX1BldC4PwxjE=; b=nC6cwVEYBxDkc8J2/vxmBkh/69ASCvGkd8AE1Jjg4A3AdH9NQNUW7gge1zfQGKLAkA o8Kz7LcwqnX6yWAkWo3pqidM0tMSwL1J0oWTNF6hDLgDQ10xTwo1Uz3VOJb/siatBMCT PwP/As3ho9YPWb00BatJiTRgi0gLqKEe4UqBBXTVwywp9xzGLeX+3PBbPoZ46zjGCxGW dnTyisN+lFMyaOvRF1ZAA/bE+/augfqpSTc4z3ZhWLvho3WfJmtCEXRD+rwbKi9CaUS8 mVWYHsqURzB5sd7WoDabRA4LbMmWmOKhFfs/LObHs8ppQ0kWBxqeahFWr6c7P2nrCyKd AheQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IzcmklKpVXrbMixcRIF+VW0BbWQaOeVX1BldC4PwxjE=; b=Cv1NnZJSM5Syvm/4pQmAp29SmwXE5fKdUqed2WrGtOG4ZuCbgU6Pb/BorsGQroSXma f8ipUBY7OSG9HRYfkrYQUONxmyZVIt/Oe2+TNnvRATHgqC+LWTsT+/GxBz1x6hM3hePU ailWjy6bseCWem0oMns1CRsIFKnqTQMOJ9yZ2Q/3qt8agx53VuNCpB2I6+U2ofD/iuF3 KKHtc23B7fqctPpl9bgsaXPIcV2fZa+cth0ZHLEcIgIyqan8IjhMD5zod/m+J3jBqnQr f4kL6NwiehJpSAHCh/wtbA2ixUjOGPsFX2LpAqeSlfpeKB0nL19pE6DlaXLuj/J0/SNT Aabg== X-Gm-Message-State: AGi0Pua9Cm4Udx/bvIWO9xcaPO1X0+rU/gytnS0WyLSbY+9x/ujOKEGw 8dL1tmqrXg+lqQmoeGuhq1nk6+JkNlpxyA== X-Google-Smtp-Source: APiQypLXjGQFP2j7w8YPmABGawmGtpokFdgDbI7Ucd3SHJ8C9px+cwH22t+JNzp5v+WC0MjcxiQVsA== X-Received: by 2002:a1c:a754:: with SMTP id q81mr9120530wme.124.1585925611135; Fri, 03 Apr 2020 07:53:31 -0700 (PDT) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id u5sm13559469wrp.81.2020.04.03.07.53.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 07:53:30 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Apr 2020 15:53:04 +0100 Message-Id: <20200403145305.10288-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200403145305.10288-1-naush@raspberrypi.com> References: <20200403145305.10288-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v3 4/5] libcamera: controls: Add AE related controls 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-List-Received-Date: Fri, 03 Apr 2020 14:53:32 -0000 AeMeteringMode, AeConstraintMode, and AeExposureMode are new enum type controls used to specify operating modes in the AE algorithm. All modes may not be supported by all platforms. ExposureValue is a new control used to set the log2 exposure adjustment for the AE algorithm. Lux is a new control that returns the current lux estimate. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 104 +++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 64e81520..50f9e07b 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -4,6 +4,8 @@ # %YAML 1.2 --- +# Unless otherwise stated, all controls are bi-directional, i.e. they can be +# set through a Request and returned out through Metadata. controls: - AeEnable: type: bool @@ -23,6 +25,103 @@ controls: \sa AeEnable + # AeMeteringMode needs further attention: + # - Auto-generate max enum value. + # - Better handling of custom types. + - AeMeteringMode: + type: int32_t + description: | + Specify a metering mode for the AE algorithm to use. The metering + modes determine which parts of the image are used to determine the + scene brightness. Metering modes may be platform specific and not + all metering modes may be supported. + enum: + - name: MeteringCentreWeighted + value: 0 + description: Centre-weighted metering mode. + - name: MeteringSpot + value: 1 + description: Spot metering mode. + - name: MeteringMatrix + value: 2 + description: Matrix metering mode. + - name: MeteringCustom + value: 3 + description: Custom metering mode. + - name: MeteringModeMax + value: 3 + description: Maximum allowed value (place any new values above here). + + # AeConstraintMode needs further attention: + # - Auto-generate max enum value. + # - Better handling of custom types. + - AeConstraintMode: + type: int32_t + description: | + Specify a constraint mode for the AE algorithm to use. These determine + how the measured scene brightness is adjusted to reach the desired + target exposure. Constraint modes may be platform specific, and not + all constraint modes may be supported. + enum: + - name: ConstraintNormal + value: 0 + description: Default constraint mode. + This mode aims to balance the exposure of different parts of the + image so as to reach a reasonable average level. However, highlights + in the image may appear over-exposed and lowlights may appear + under-exposed. + - name: ConstraintHighlight + value: 1 + description: Highlight constraint mode. + This mode adjusts the exposure levels in order to try and avoid + over-exposing the brightest parts (highlights) of an image. + Other non-highlight parts of the image may appear under-exposed. + - name: ConstraintCustom + value: 2 + description: Custom constraint mode. + - name: ConstraintModeMax + value: 2 + description: Maximum allowed value (place any new values above here). + + # AeExposureMode needs further attention: + # - Auto-generate max enum value. + # - Better handling of custom types. + - AeExposureMode: + type: int32_t + description: | + Specify an exposure mode for the AE algorithm to use. These specify + how the desired total exposure is divided between the shutter time + and the sensor's analogue gain. The exposure modes are platform + specific, and not all exposure modes may be supported. + enum: + - name: ExposureNormal + value: 0 + description: Default metering mode. + - name: ExposureShort + value: 1 + description: Exposure mode allowing only short exposure times. + - name: ExposureLong + value: 2 + description: Exposure mode allowing long exposure times. + - name: ExposureCustom + value: 3 + description: Custom exposure mode. + - name: ExposureModeMax + value: 3 + description: Maximum allowed value (place any new values above here). + + - ExposureValue: + type: float + description: | + Specify an Exposure Value (EV) parameter. The EV parameter will only be + applied if the AE algorithm is currently enabled. + + By convention EV adjusts the exposure as log2. For example + EV = [-2, -1, 0.5, 0, 0.5, 1, 2] results in an exposure adjustment + of [1/4x, 1/2x, 1/sqrt(2)x, 1x, sqrt(2)x, 2x, 4x]. + + \sa AeEnable + - ExposureTime: type: int32_t description: | @@ -53,6 +152,11 @@ controls: Specify a fixed contrast parameter. Normal contrast is given by the value 1.0; larger values produce images with more contrast. + # Lux can only be returned in Metadata + - Lux: + type: float + description: Report an estimate of the current lux level. + - AwbEnable: type: bool description: |