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>
This commit is contained in:
@@ -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__ */
|
||||
|
||||
Reference in New Issue
Block a user