summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-10-25 18:09:51 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-28 13:07:50 +0200
commit656d8757347f1f9f5df93da863f66fa589cee063 (patch)
tree92e1acd4b3fd4fe5176c787ae7a285b7872f1306 /src
parent9db0ed5e206545c5db389df298601fe2d06e58f4 (diff)
libcamera: Define a PixelFormat type for application-facing formats
Define a PixelFormat type as a simple typedef to an uint32_t. The usage of a dedicated type creates a cleaner and more self-described API. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/meson.build1
-rw-r--r--src/libcamera/pixelformats.cpp26
2 files changed, 27 insertions, 0 deletions
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index d329820b..f201f408 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -25,6 +25,7 @@ libcamera_sources = files([
'message.cpp',
'object.cpp',
'pipeline_handler.cpp',
+ 'pixelformats.cpp',
'process.cpp',
'request.cpp',
'signal.cpp',
diff --git a/src/libcamera/pixelformats.cpp b/src/libcamera/pixelformats.cpp
new file mode 100644
index 00000000..9377fb5e
--- /dev/null
+++ b/src/libcamera/pixelformats.cpp
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2019, Google Inc.
+ *
+ * pixelformats.cpp - libcamera pixel formats
+ */
+
+#include <libcamera/pixelformats.h>
+
+/**
+ * \file pixelformats.h
+ * \brief libcamera pixel formats
+ */
+
+namespace libcamera {
+
+/**
+ * \typedef PixelFormat
+ * \brief libcamera image pixel format
+ *
+ * The PixelFormat type describes the format of images in the public libcamera
+ * API. It stores a FourCC value in a 32-bit unsigned integer. The values are
+ * defined in the Linux kernel V4L2 API (see linux/videodev2.h).
+ */
+
+} /* namespace libcamera */