From patchwork Mon Mar 9 12:33:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3059 Return-Path: Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6001562923 for ; Mon, 9 Mar 2020 13:35:31 +0100 (CET) Received: by mail-wr1-x441.google.com with SMTP id v11so10850122wrm.9 for ; Mon, 09 Mar 2020 05:35: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=fuXO2iK3dTw0vD630Rg4SRSmZfkfCAiE+45ME/pLDOA=; b=GOTEtg+KGSBoDOGmIfWM0xAInpOfXPO62MhBFevnUEnJsNjpmi/pvBsf9VioooFRqI fyYs7GechsS71s20y6dPUtuy0oYy3aDKeluWdNavygkTJAr8vkV+mWsT28R+Lnj1wzl8 9X8g7UZTihrCwHFpbPE6fJU+rde4y9RcLcTWAv1DlYF1mx3oLHl/ch7hxvfKc1HQrFnE UJ7PmlcUUo4Nd7s3JkkflF7nuPStsbJiXS7IpCuhKP4/ISI96Um7keZOuO1xKZNe8bGc onvcUzkRLoFf06WkNono1tZMNJ64HaA+tUgUAl+zrbkyWUMfchn1q1PBBCP6Wh2iLCno Ndrw== 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=fuXO2iK3dTw0vD630Rg4SRSmZfkfCAiE+45ME/pLDOA=; b=cDaFcIW16WOJSB7/S9nBjG0dW86bSEGknea7CqRFQfp1r/BWW3CJWbzcIQmOXp2CmN Pb//QrZWCUKqSJCUfYj/w37fqCJwviRhSKYHDIiwXVeHkiadcfVDDMAy+l+ut1yhIBqh vF3Np0iF/07dEaNDATIC01U0SIs9SpnEvf9Zug0yLAAy/I6iNuMMINgehLFXxmIhR6dB bHXQ5ls9bem27vpz8XmxsiwVuJyGLXshHFpgIF+uq8iRiBVLy4juBzW7bKC7wjRUUrUC 0NTQKnFTes1tk4vf2KPiWRteHI4+LoIbd1Gc6B59vicAyObhVe3aiXN4UoQ5y6/tfrCZ tiFg== X-Gm-Message-State: ANhLgQ3LMBlvkpNfA0711oD5ch3aIfyIhx0IWPpYwi+5+Z4+v/wsHGsc 1qeDN7uFSVvJcL9+k08GfPVePxaNI0Axkw== X-Google-Smtp-Source: ADFU+vsgA0Z38VwufkEU3Bc+x3Tuvmaq/izGmjFl/lbtw8rMzv+uV6zRnX8B4ZtUXbt8gAPNhedUbw== X-Received: by 2002:adf:fe41:: with SMTP id m1mr5890515wrs.355.1583757330988; Mon, 09 Mar 2020 05:35:30 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id z135sm25693827wmc.20.2020.03.09.05.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 05:35:30 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 12:33:14 +0000 Message-Id: <20200309123319.630-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309123319.630-1-naush@raspberrypi.com> References: <20200309123319.630-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v2 1/6] libcamera: controls: Specify manual gain units and change exposure units 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: Mon, 09 Mar 2020 12:35:31 -0000 Use micro-seconds for ManualExposure. This is changed from milli- seconds. The latter would not allow very low exposure times. ManualGain switch to use a float to allow fractional gain adjustments. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham --- src/libcamera/control_ids.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 4befec74..5bbe65ae 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -44,10 +44,17 @@ controls: - ManualExposure: type: int32_t - description: Specify a fixed exposure time in milli-seconds + description: | + Specify a fixed exposure time in micro-seconds to be applied in the + sensor device. + + \sa ManualGain - ManualGain: - type: int32_t - description: Specify a fixed gain parameter + type: float + description: | + Specify a fixed gain value to be applied in the pipeline. This gain is + applied to all colour channels. + \sa ManualExposure ... From patchwork Mon Mar 9 12:33:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3060 Return-Path: Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7592762923 for ; Mon, 9 Mar 2020 13:35:34 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id z15so10901969wrl.1 for ; Mon, 09 Mar 2020 05:35:34 -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=u1yajr8e8eccRLaXgFLXKas9XBf/N6Equw89ky49Kg8=; b=OKj2/idrQBZH1DiyjOm880IUsNkGy9IGYlpH8gbzcCtEXhhMSmjEamZScuvMLlonVR zICIEJHZrWGsPopJpiW3y0+Q0iZdIa0tAL39FMlUW5IMhbIQ4zZ+1iQbYu5W0ZOh6laK RQbWAm0pGf32VRNJalDYK2ZuF1fdls3vIFZpThU3NBv5/uDR+VhsYWNfHM0W0XmuTslL /5OHYFDJLpZeUotN+sXUbxoxOaHgjOfNYLIgIdIxdXR+IzSgWWO7bSheQk8N005FvHr4 3MrB44KZ8Uel6AbSKJ8hc/80xW6GEC9KSaN1J9+tfY/Efne0ef3QcToVheaM7VxeZP93 A8Bw== 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=u1yajr8e8eccRLaXgFLXKas9XBf/N6Equw89ky49Kg8=; b=Q/bdAYs+GMGuUOYoycXKIUbB4nbGACtM4Db3ZABzklKotsd2cB6caZEO42FdKIMKbG SWJVJn4Xhok6Y+uk8p/BRWppr3AD1kBI3HZm9ncEdM5ndH9crWUOeG1gwRaEbY3LaS/5 CvnZnMfU6AopOJhNicQIkuy6x2NpnVYxrq9VUF+o9d66z4phIWro/MO/ho+tWlbrijf7 ZVYIrVCtwB3gNRPjmIuxaJEK/7khZPNgZeBh8EsSRMBWJ9z/+enE0vMqLfeMjMsCque2 aXEgZ25C5JPTfGvzg72BjGnH5EBzFpyF1xIFj+VwRJn+FwAjhAz10XCCsE+DhBASRFbi ssFg== X-Gm-Message-State: ANhLgQ03YLuivakGaH0/Vkdm8sWrFBIXQ6GaMQhjaofoN5J+ptKjvnE4 Q0hRdA53h0FX3yKQ+dJRQnv01JcnFSOBUQ== X-Google-Smtp-Source: ADFU+vsWzkZAlBsoTkxADBdpOkoR1xj+p0yzgRMF6FsnwbXKshmjfPhL9RkYG/+cfvCagERg5o00PQ== X-Received: by 2002:a5d:62c9:: with SMTP id o9mr21611183wrv.2.1583757334027; Mon, 09 Mar 2020 05:35:34 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id z135sm25693827wmc.20.2020.03.09.05.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 05:35:33 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 12:33:15 +0000 Message-Id: <20200309123319.630-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309123319.630-1-naush@raspberrypi.com> References: <20200309123319.630-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v2 2/6] libcamera: uvcvideo: Update exposure/gain ctrls set with new units 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: Mon, 09 Mar 2020 12:35:34 -0000 The ManualExposure control now uses units of 1 micro-second, and UVC uses units of 100 micro-seconds. Correctly map the values before setting V4L2_CID_EXPOSURE_ABSOLUTE on the V4L2 device. The ManualGain control now uses floats to allow fractional gain values. Since UVC has no explicit gain units, map the default gain value to 1.0 and linearly map to the requested value. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/uvcvideo.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo.cpp index 29afb121..aff86803 100644 --- a/src/libcamera/pipeline/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo.cpp @@ -245,9 +245,22 @@ int PipelineHandlerUVC::processControls(UVCCameraData *data, Request *request) controls.set(V4L2_CID_SATURATION, value); } else if (id == controls::ManualExposure) { controls.set(V4L2_CID_EXPOSURE_AUTO, static_cast(1)); - controls.set(V4L2_CID_EXPOSURE_ABSOLUTE, value); + /* + * controls::ManualExposure is in units of 1 us, and UVC + * expects V4L2_CID_EXPOSURE_ABSOLUTE in units of 100 us. + * So divide by 100 when setting the control. + */ + controls.set(V4L2_CID_EXPOSURE_ABSOLUTE, value.get() / 100); } else if (id == controls::ManualGain) { - controls.set(V4L2_CID_GAIN, value); + /* + * controls::ManualGain is specified as an absolute float value. + * Map this in a linear way such that 1.0 -> default gain + * of the V4L2_CID_GAIN control. + */ + ControlRange gainInfo = controls.infoMap()->at(V4L2_CID_GAIN); + float requestGain = value.get(); + int32_t gain = requestGain * gainInfo.def().get(); + controls.set(V4L2_CID_GAIN, gain); } } From patchwork Mon Mar 9 12:33:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3061 Return-Path: Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6664C62923 for ; Mon, 9 Mar 2020 13:35:35 +0100 (CET) Received: by mail-wr1-x442.google.com with SMTP id v11so10850392wrm.9 for ; Mon, 09 Mar 2020 05:35:35 -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=vIBOmEPiN9DPLPXp5Nwe4wgfwUUdjRgobQ695qMK1iM=; b=CNIYZ+APaojZX8+6HhzuNp4KFNE3sexp8ueSLdCD97IsviESraOu+WlsVmjAIqCBXQ GONJ196Dirh29f43wP5HDYWmdDqjEHOxnV1FAun/zUZum/HEg6pEQg6zhq+46u4Nauu0 CLAq3jFPL9MwLNbJbJVdUnK1pkps6BolevQ3VwGAPxoynG2/ZBJX0S9vjBc/Qc50ygLq G/MtVYjBO2lwls4MHzxJWQEMRxzHooivZD5p+vrL6vOggqBoWxqBKOvrl6IktcpO31U+ /d/HvmH1NodMuBA6x4tDS8QxPBgShb3kxJaxAievBtHl/brzrdTUqa7qm+6Lt2WDlqDD zxdg== 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=vIBOmEPiN9DPLPXp5Nwe4wgfwUUdjRgobQ695qMK1iM=; b=V070UnYxdvYf6EqMWcmICXwmYYN2MgaecnyutKi+XyFlauueuz5CY/s8ZFG6nhEVJm 08FFC9d2rk7NO6Gcq3pHRVQ7l7OXK8JWsudiozfJWm3Mhi5WfsEIynME8cuEqA0XamZw Qn3G3ocygT/S3agsZMdBdcnendZ1LLijrVIQDR+/67Ri0b/BCWAez8m2aI6bmMbrbPG3 WBVtgOIbcNCTtZRFnsTiS5re9zStxyzEZE5hSIiqEV3EoUPCpZZ+RGk6mWlDaV8VQ/m/ GrPZklOIvL2NanCw2xuvxGSZnZlEbxO0Enbegb5hbvugzJN8EJC58OqViMbgh6lCSJFw ih9w== X-Gm-Message-State: ANhLgQ2EqrkOLn73stXrA/Cxlx0V6/sB2fljFgbq6Ef2AvMY7Bvaknqu 8Hj/6W3br/8VaQgUsNIaio9aQlzl9vcVUg== X-Google-Smtp-Source: ADFU+vuBjOY59vU+XCpb9sKvPtyKwS9tAz0uUZJ0lywwz0cCBoZppJbPQjng3VRm82vJj/ILj3vIEg== X-Received: by 2002:adf:82ee:: with SMTP id 101mr20626058wrc.7.1583757334843; Mon, 09 Mar 2020 05:35:34 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id z135sm25693827wmc.20.2020.03.09.05.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 05:35:34 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 12:33:16 +0000 Message-Id: <20200309123319.630-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309123319.630-1-naush@raspberrypi.com> References: <20200309123319.630-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v2 3/6] 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: Mon, 09 Mar 2020 12:35:35 -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 double type control used to set the log2 exposure adjustment for the AE algorithm. Signed-off-by: Naushir Patuck --- src/libcamera/control_ids.yaml | 121 +++++++++++++++++++++++++++++---- 1 file changed, 109 insertions(+), 12 deletions(-) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 5bbe65ae..da1a7b43 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -23,24 +23,104 @@ controls: \sa AeEnable - - AwbEnable: - type: bool + - AeMeteringMode: + type: int32_t description: | - Enable or disable the AWB. - - \sa ManualGain + 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: MeteringCustom1 + value: 3 + description: Custom metering mode 1. + - name: MeteringCustom2 + value: 4 + description: Custom metering mode 2. + - name: MeteringCustom3 + value: 5 + description: Custom metering mode 3. + - name: MeteringModeMax + value: 5 + description: Maximum allowed value (place any new values above here). - - Brightness: + - AeConstraintMode: type: int32_t - description: Specify a fixed brightness parameter + 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 constaint modes may be supported. + enum: + - name: ConstraintNormal + value: 0 + description: Default constraint mode. + - name: ConstraintHighlight + value: 1 + description: Highlight constraint mode. + - name: ConstraintCustom1 + value: 2 + description: Custom constraint mode 1. + - name: ConstraintCustom2 + value: 3 + description: Custom constraint mode 2. + - name: ConstraintCustom3 + value: 4 + description: Custom constraint mode 3. + - name: ConstraintModeMax + value: 4 + description: Maximum allowed value (place any new values above here). - - Contrast: + - AeExposureMode: type: int32_t - description: Specify a fixed contrast parameter + 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 + spcific, and not all exposure modes may be supported. + enum: + - name: ExposureNormal + value: 0 + description: Default metering mode. + - name: ExposureSport + value: 1 + description: Sport metering mode (favouring short shutter times). + - name: ExposureLong + value: 2 + description: Exposure mode allowing long exposure times. + - name: ExposureCustom1 + value: 3 + description: Custom exposure mode 1. + - name: ExposureCustom2 + value: 4 + description: Custom exposure mode 2. + - name: ExposureCustom3 + value: 5 + description: Custom exposure mode 3. + - name: ExposureModeMax + value: 5 + description: Maximum allowed value (place any new values above here). - - Saturation: - type: int32_t - description: Specify a fixed saturation parameter + - ExposureValue: + type: float + description: | + Specify an Exposure Value (EV) parameter. The EV parameter will only be + applied if the AE alogrithm 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 - ManualExposure: type: int32_t @@ -57,4 +137,21 @@ controls: applied to all colour channels. \sa ManualExposure + + - AwbEnable: + type: bool + description: | + Enable or disable the AWB. + + - Brightness: + type: int32_t + description: Specify a fixed brightness parameter + + - Contrast: + type: int32_t + description: Specify a fixed contrast parameter + + - Saturation: + type: int32_t + description: Specify a fixed saturation parameter ... From patchwork Mon Mar 9 12:33:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3062 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B97362923 for ; Mon, 9 Mar 2020 13:35:36 +0100 (CET) Received: by mail-wm1-x343.google.com with SMTP id a5so9703091wmb.0 for ; Mon, 09 Mar 2020 05:35:36 -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=mRpp1XKALbtajmA5nsLyTfSQsfB55/0bG7VkANELT8I=; b=WIqTTDVjM6eg4mj2LlTbvNPS9BjPoE2gVxD3V56veyG7ELSzR2zbeKkQ9oPkXtKg8U VOAsGHfP+8BOEyChtfrZUFEJKLgIBJSnYD1ljsIVJGKaf3wF7WtGX/bD2ZNk96XnGeg/ 841yMpAdhBY9KdRzDDXyvbvuuYOS9cb2M5xfcJezbBr+XVYhoeSREMKakjGLJfzg7B4a zEb2iRTFEGOFwzdzuWVl84+SSJpT1jw4xu3r9L9n3FqbzRZmhJJbIKjU61AGTt3KV2rp 8zw60K+fuP2S1IKlFe0D3Z/0Rx/2WaAl3qgAVXXRZhqktPZNNxJ4OCPQi9ELFX/bjv6P wg1A== 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=mRpp1XKALbtajmA5nsLyTfSQsfB55/0bG7VkANELT8I=; b=lxqrf+47CJI9fUcf+5ZUdiBPTPBoue0IkwHKsodmLaNYzLNSaoQLTslcPzke2x0XX2 mIBloQmX/l82AKqsNvR30Zz1JyXTiwBVp/fhJiuIg8pNqBxt+OlA1CjaDQNfKBP/BUe/ TRvoqidq6/+3bL2BjPekU9Im90VjOICvbh9nWF+bCdGUVzJlUoIEFgiyhTffjG4lDSJt IoMVafx5N8IY3GXelEaetxNHVO0VLMqUqVsdiPDkrMZ9q0ibHWT89rQsmY39YJqpKSfl TBSHG0d4SWjKpNcKeUdhEaJIb4CrOwgp68nLMupNXFfHXzzgX28TfQajto8RuClQ1c+W 0OCQ== X-Gm-Message-State: ANhLgQ04Ymcrk6/Ffh+UIcl56ERS0UqcIKRxIy7IRGcpVS+1maaBaUIW zn3PnrIgOAlVbMGjRh0V7dlo39GyBbVDQQ== X-Google-Smtp-Source: ADFU+vuKMYbk33HT1T1XlGqOiCJIeEjhyjdx7qjJixJGCcojxarMaZsJyQ55V9v5bjtGWVN2tLfrJA== X-Received: by 2002:a1c:4c13:: with SMTP id z19mr19564496wmf.75.1583757335755; Mon, 09 Mar 2020 05:35:35 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id z135sm25693827wmc.20.2020.03.09.05.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 05:35:35 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 12:33:17 +0000 Message-Id: <20200309123319.630-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309123319.630-1-naush@raspberrypi.com> References: <20200309123319.630-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v2 4/6] libcamera: controls: Add AWB 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: Mon, 09 Mar 2020 12:35:36 -0000 AwbMode is a new enum type to specify operating mode of the AWB algorithm. All modes may not be supported by all platforms. ManualWbGains is a new float arary type used to specify manual red and blue (in that order) colour channel gains when AWB is disabled. Signed-off-by: Naushir Patuck --- src/libcamera/control_ids.yaml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index da1a7b43..9a33094a 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -143,6 +143,53 @@ controls: description: | Enable or disable the AWB. + - AwbMode: + type: int32_t + description: | + Specify the range of illumants to use for the AWB algorihtm. The modes + supported are platform specific, and not all modes may be supported. + enum: + - name: AwbAuto + value: 0 + description: Search over the whole CT range. + - name: AwbIncandescent + value: 1 + description: Incandescent AWB lamp mode. + - name: AwbTungsten + value: 2 + description: Tungsten AWB lamp mode. + - name: AwbFluorescent + value: 3 + description: Fluorescent AWB lamp mode. + - name: AwbIndoor + value: 4 + description: Indoor AWB lighting mode. + - name: AwbDaylight + value: 5 + description: Daylight AWB lighting mode. + - name: AwbCloudy + value: 6 + description: Cloudy AWB lighting mode. + - name: AwbCustom1 + value: 7 + description: Custom AWB mode 1. + - name: AwbCustom2 + value: 8 + description: Custom AWB mode 2. + - name: AwbCustom3 + value: 9 + description: Custom AWB mode 3. + - name: AwbModeMax + value: 9 + description: Maximum allowed value (place any new values above here). + + - ManualWbGains: + type: float + description: | + Specify a fixed gain parameter for the Red and Blue colour channels, + in that order. + size: [2] + - Brightness: type: int32_t description: Specify a fixed brightness parameter From patchwork Mon Mar 9 12:33:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3063 Return-Path: Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1826C62923 for ; Mon, 9 Mar 2020 13:35:37 +0100 (CET) Received: by mail-wm1-x343.google.com with SMTP id g62so4869863wme.1 for ; Mon, 09 Mar 2020 05:35:37 -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=32VL+kiTOWZatujbjBIETFjGTk9tbL9R8OZx5PH9JVg=; b=kcIFajR3TF8HXoaEm3DNqcOHPzE/R1wfjT1Zlmys/KOyAIBi/fM7BeePWf7H5NuVzO tiKFFNAlHv7LqlaB/kgz9COQgbXp7Z2h7Mlo+OP9UdMiyHywrdnj2/LRC8wT/UyP337T IciVav7o9ylU04P3AmgK3FYHgwob+opwg3Aeqrq5Vdv4MiZxbJmOdlxV1FRgH10m7UH3 48DFo7a8lJqCG+Tw4bsHw3FrPbXKSFj8cELIY9FrqOCRe+WfGoIJrzUboZUFoMxt07iB qWcGHJrXHmxabDwsu92+B6DKh+z/ehvOgy3kf/Rlc4X6ZrugHtIr1wbBrpZ2l6HZIpTL 1J8g== 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=32VL+kiTOWZatujbjBIETFjGTk9tbL9R8OZx5PH9JVg=; b=Yz3fZ/t0brKXffWtQO2osWAiz0QWQc+2bPt+RWTon6sKNVHIpvQVjEMkmZ5H+W6j/b DTGN/XTC0M5T47JjmIijmFw9sZWJrPG7WClYbJgrZMSqQ1/hpOq/zSzXHs6fGYKYLWvp Y6JLhf8Xdy+fGGThaxsJrGUm+ArhuTXOSUQKbH3Hr1+IHAWDpKI6iiMBPVZHD9+nNfmA l47z3i3gqOSKMx2Q8HgdzO/d4HwHgOWs9f2v9Y+GOgEW2n5lJloV5qILSa44SucHSdDc ygyhxDvRrvXqZaPVJcc8psQDKvxPdJIPcdzQwyFdIMvX87BT+orrnxykxNzMPbf98xS9 GoDA== X-Gm-Message-State: ANhLgQ215KDjl4zJ04eu7G+tCvkVbB+c9WSbVWmMNPih4fN/RcFy4Yx0 2jdJwH2BNMTU9+iIs9xBHU1oE4UQ7v6w2w== X-Google-Smtp-Source: ADFU+vtcnoafL16a3fOLFX1NcBlJpLc19UckgXXvsjI2tsYUKhzf77NlOfkl8hVOSkYOmkrOoR8EsA== X-Received: by 2002:a7b:c189:: with SMTP id y9mr7486233wmi.47.1583757336658; Mon, 09 Mar 2020 05:35:36 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id z135sm25693827wmc.20.2020.03.09.05.35.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 05:35:36 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 12:33:18 +0000 Message-Id: <20200309123319.630-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309123319.630-1-naush@raspberrypi.com> References: <20200309123319.630-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v2 5/6] libcamera: controls: Update usage and description for existing 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: Mon, 09 Mar 2020 12:35:37 -0000 Switch to using floats for constrast and saturation control to be more in-line with end-user expectations. Expand on the descrption for the brightness, contrast and saturation controls. Signed-off-by: Naushir Patuck --- src/libcamera/control_ids.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 9a33094a..3d1b058f 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -192,13 +192,20 @@ controls: - Brightness: type: int32_t - description: Specify a fixed brightness parameter + description: | + Specify a fixed brightness parameter. Positive values (up to 65535) + produce brighter images; negative values (up to -65536) produce darker + images and 0 leaves pixels unchanged. - Contrast: - type: int32_t - description: Specify a fixed contrast parameter + type: float + description: | + Specify a fixed contrast parameter. Normal contrast is given by the + value 1.0; larger values produce images with more contrast. - Saturation: - type: int32_t - description: Specify a fixed saturation parameter + type: float + description: | + Specify a fixed saturation parameter. Normal saturation is given by + the value 1.0; larger values produce more saturated colours. ... From patchwork Mon Mar 9 12:33:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 3064 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 F18C162972 for ; Mon, 9 Mar 2020 13:35:37 +0100 (CET) Received: by mail-wm1-x341.google.com with SMTP id a5so9703188wmb.0 for ; Mon, 09 Mar 2020 05:35:37 -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=yvDxK6RXexs/MMyq7bDDxHmdebvgZ3DHs6A8GssZCWY=; b=NcfxY2yKCAYaJvfx/YpdLXxuS/BCAYPSzfOxlvmLDUJwtyc+kfv8KgljN2cdgDIjrq YE04Ac83s/0RomM3t9e8p4oRTCU/nWIygCpS1rOquMk7wQJb4h9PyUhUz/3hfXaEYFDS g2n2ctsH6g3hBIg5AYp6mBIlJicYt4tw1uOrjWEZuXIYPvlCnSB2OLTeOCvlMPm8Fim9 QrGdoR9UFGjYv9HQh0SHDILFjDX9LlSUDS8i1+R4DSsedvJ08vPs5qLyxvl5db2aQub5 cES6Upc92pzzie7zs+qoMn2IRo+gVSHc5uoPhnKG/sJAKIOBd05uT41WSsqHAfLT9PDH pf2w== 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=yvDxK6RXexs/MMyq7bDDxHmdebvgZ3DHs6A8GssZCWY=; b=nlTKwOHc3BnwkotskgvXCf8wfDw8uRIvk/QKwxLzOlv/JwAg1mXApk/RJq8QKUycHz 0F4plXkKTERomtNgivqtGTXzePmkTUmz9xLceR/H/R2Ht8WkY65o/YbjlUkBTyHDrjez vQC7QDWpbMhlTST/KHtzl6jn+3A57KpZZAk6wPhUv05go5gR8dnXKsJEWHio5mMUGdaK 4QTdDO6FVI9Q3TOL2iX0J5HWz0EZmLRpmP71aBWWH1KNHzACA1qJchBssu20FLAZt5Gf B1XqHgYQcDr7n4jhmhWNTeCKNLN9Ao+glxjSTqF8RVA4/8p8UGbGQyKVi+x2+z8Hzw5Y DYdQ== X-Gm-Message-State: ANhLgQ3z2SzvPuGbFZhC2XpXO1tDIlbB8ZXDiZIwu6rkS2Emv4x4C/G0 gnwHdTDjb9F4a50IEE2uuxrNy8jcaUGHQg== X-Google-Smtp-Source: ADFU+vv16D9uyiOt12VYfYZ7ksBsUDmwzPOiXQYAEfrIF37UqHZHo0p0InuqHLT2+2V9dFUvw4tXXQ== X-Received: by 2002:a1c:59c6:: with SMTP id n189mr19732043wmb.178.1583757337461; Mon, 09 Mar 2020 05:35:37 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org (cust51-dsl50.idnet.net. [212.69.50.51]) by smtp.gmail.com with ESMTPSA id z135sm25693827wmc.20.2020.03.09.05.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 05:35:36 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 12:33:19 +0000 Message-Id: <20200309123319.630-7-naush@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309123319.630-1-naush@raspberrypi.com> References: <20200309123319.630-1-naush@raspberrypi.com> Subject: [libcamera-devel] [PATCH v2 6/6] libcamera: controls: Add controls to report back frame metadata 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: Mon, 09 Mar 2020 12:35:38 -0000 Add controls to report the current frame's exposure and gain, and an estimate of the current lux level from the AE algorithm. Add controls to report the red and blue colour gains, and an estimate of the colour temperature from the AWB algorithm. Signed-off-by: Naushir Patuck --- src/libcamera/control_ids.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 3d1b058f..ee93975e 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -138,6 +138,22 @@ controls: \sa ManualExposure + - CurrentExposure: + type: int32_t + description: Report the exposure time in micro-seconds of this frame. + + \sa CurrentAnalogueGain + + - CurrentAnalogueGain: + type: float + description: Report the analogue gain parameter for the current frame. + + \sa CurrentExposure + + - CurrentLux: + type: float + description: Report an estimate of the current lux level. + - AwbEnable: type: bool description: | @@ -190,6 +206,18 @@ controls: in that order. size: [2] + - CurrentWbGains: + type: float + description: | + Report the current gain AWB gain values for the Red and Blue colour + channels, in that order. + size: [2] + + - CurrentTemperature: + type: float + description: | + Report the current estimate of the colour temperature for this frame. + - Brightness: type: int32_t description: |