summaryrefslogtreecommitdiff
path: root/src/qcam/format_converter.h
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2019-05-04 16:22:55 -0400
committerPaul Elder <paul.elder@ideasonboard.com>2019-05-07 09:27:03 -0400
commitb09b13dbf6921a5474b847ba940f0c38e3e37c71 (patch)
treebdac04679cb0dea5b4c481fa7d3cc35880e34581 /src/qcam/format_converter.h
parent28382ff2b181441334f2ccbb3ce82ae491dcc771 (diff)
qcam: format_converter: Add formatFamily enum
It is not sustainable to add a new flag for every new video format family (eg. YUYV, RGB, NV, MJPEG, etc), so add a formatFamily enum to indicate these in the FormatConverter. Note that formats are grouped into families based on if they are able to share a set of parameters for conversion. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/qcam/format_converter.h')
-rw-r--r--src/qcam/format_converter.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qcam/format_converter.h b/src/qcam/format_converter.h
index 76cd9f1c..bca44aa3 100644
--- a/src/qcam/format_converter.h
+++ b/src/qcam/format_converter.h
@@ -20,6 +20,12 @@ public:
void convert(const unsigned char *src, size_t size, QImage *dst);
private:
+ enum FormatFamily {
+ MJPEG,
+ RGB,
+ YUV,
+ };
+
void convertRGB(const unsigned char *src, unsigned char *dst);
void convertYUV(const unsigned char *src, unsigned char *dst);
@@ -27,12 +33,15 @@ private:
unsigned int width_;
unsigned int height_;
+ enum FormatFamily formatFamily_;
+
+ /* RGB parameters */
unsigned int bpp_;
unsigned int r_pos_;
unsigned int g_pos_;
unsigned int b_pos_;
- bool yuv_;
+ /* YUV parameters */
unsigned int y_pos_;
unsigned int cb_pos_;
};