summaryrefslogtreecommitdiff
path: root/src/android/jpeg/encoder.h
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-06-24 14:15:15 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-08-06 15:46:02 +0100
commit998f4de65ebccf638b19a90172db74b2dc469c78 (patch)
treee4fc1bb0369963e31674c7ce708f078b9e62e93a /src/android/jpeg/encoder.h
parentc09aee4ccb7043484047d060f7f8bc1e0192ea23 (diff)
android: Introduce JPEG encoding
Provide an encoder interface and implement a JPEG encoder using libjpeg. Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/android/jpeg/encoder.h')
-rw-r--r--src/android/jpeg/encoder.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/android/jpeg/encoder.h b/src/android/jpeg/encoder.h
new file mode 100644
index 00000000..f9eb88e6
--- /dev/null
+++ b/src/android/jpeg/encoder.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * encoder.h - Image encoding interface
+ */
+#ifndef __ANDROID_JPEG_ENCODER_H__
+#define __ANDROID_JPEG_ENCODER_H__
+
+#include <libcamera/buffer.h>
+#include <libcamera/span.h>
+#include <libcamera/stream.h>
+
+class Encoder
+{
+public:
+ virtual ~Encoder() {};
+
+ virtual int configure(const libcamera::StreamConfiguration &cfg) = 0;
+ virtual int encode(const libcamera::FrameBuffer *source,
+ const libcamera::Span<uint8_t> &destination) = 0;
+};
+
+#endif /* __ANDROID_JPEG_ENCODER_H__ */