diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-05-24 23:44:47 +0200 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-06-19 02:42:56 +0200 |
commit | 1cf709b1d2bbaf95e8a4bd3eb8962340e372a76a (patch) | |
tree | 32205a43d00e52a0f29ccad787aea6d1314f8a0e /src/libcamera/include/formats.h | |
parent | 22e0005fdd4c1431ee412af7f80c2edfb323125e (diff) |
libcamera: formats: Add ImageFormats
Add a new class to hold format information for V4L2 devices and
subdevices. The object describes the relationship between either pixel
formats (V4L2 devices) or media bus codes (V4L2 subdevice) and a list of
image sizes which can be produced with that format.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include/formats.h')
-rw-r--r-- | src/libcamera/include/formats.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libcamera/include/formats.h b/src/libcamera/include/formats.h index a73772b1..6ec83125 100644 --- a/src/libcamera/include/formats.h +++ b/src/libcamera/include/formats.h @@ -17,6 +17,20 @@ namespace libcamera { typedef std::map<unsigned int, std::vector<SizeRange>> FormatEnum; +class ImageFormats +{ +public: + int addFormat(unsigned int format, const std::vector<SizeRange> &sizes); + + bool isEmpty() const; + std::vector<unsigned int> formats() const; + const std::vector<SizeRange> &sizes(unsigned int format) const; + const std::map<unsigned int, std::vector<SizeRange>> &data() const; + +private: + std::map<unsigned int, std::vector<SizeRange>> data_; +}; + } /* namespace libcamera */ #endif /* __LIBCAMERA_FORMATS_H__ */ |