From patchwork Fri Mar 6 15:59:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2983 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7962660424 for ; Fri, 6 Mar 2020 17:00:19 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 14AA4312 for ; Fri, 6 Mar 2020 17:00:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583510419; bh=FvMt2CDuxrLWByRMlcZXr0SNLQKHSQmpEe1tzjAjsGc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=acw2Iza1G5QhJ8Ddu0df89CRTxxJZC9+YtHyqg865WkumD7eEYVsQfyWvAIaI1iEn 1BJa/UxDBE91skSEBkk2fyeNDF6HRw2OTM74D+wQKXlNTuIDQG560XB2lC6lkf2ath k6RhJqT1dfbognXBlVnenB9eRfzd337/i5AHJCy8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Mar 2020 17:59:41 +0200 Message-Id: <20200306160002.30549-12-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306160002.30549-1-laurent.pinchart@ideasonboard.com> References: <20200306160002.30549-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 11/32] libcamera: controls: Add templates to convert a type T to a ControlType 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, 06 Mar 2020 16:00:19 -0000 These will be used to implement ControlValue::get() and set() as template functions. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- Documentation/Doxyfile.in | 2 +- include/libcamera/controls.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/Doxyfile.in b/Documentation/Doxyfile.in index d5ba5c4e3b80..3dffbf823398 100644 --- a/Documentation/Doxyfile.in +++ b/Documentation/Doxyfile.in @@ -881,7 +881,7 @@ EXCLUDE_SYMBOLS = libcamera::BoundMethodArgs \ libcamera::BoundMethodStatic \ libcamera::SignalBase \ libcamera::*::Private \ - libcamera::*::details::* \ + *::details::* \ std::* # The EXAMPLE_PATH tag can be used to specify one or more files or directories diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 3b6b231c7c64..429f01b0fd24 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -22,6 +22,34 @@ enum ControlType { ControlTypeInteger64, }; +namespace details { + +template +struct control_type { +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeNone; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeBool; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger32; +}; + +template<> +struct control_type { + static constexpr ControlType value = ControlTypeInteger64; +}; + +} /* namespace details */ + class ControlValue { public: