summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/pixel_format.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/include/libcamera/pixel_format.h b/include/libcamera/pixel_format.h
index e3b371ef..8dfeb892 100644
--- a/include/libcamera/pixel_format.h
+++ b/include/libcamera/pixel_format.h
@@ -18,18 +18,25 @@ namespace libcamera {
class PixelFormat
{
public:
- PixelFormat();
- explicit PixelFormat(uint32_t fourcc, uint64_t modifier = 0);
+ constexpr PixelFormat()
+ : fourcc_(0), modifier_(0)
+ {
+ }
+
+ explicit constexpr PixelFormat(uint32_t fourcc, uint64_t modifier = 0)
+ : fourcc_(fourcc), modifier_(modifier)
+ {
+ }
bool operator==(const PixelFormat &other) const;
bool operator!=(const PixelFormat &other) const { return !(*this == other); }
bool operator<(const PixelFormat &other) const;
- bool isValid() const { return fourcc_ != 0; }
+ constexpr bool isValid() const { return fourcc_ != 0; }
- operator uint32_t() const { return fourcc_; }
- uint32_t fourcc() const { return fourcc_; }
- uint64_t modifier() const { return modifier_; }
+ constexpr operator uint32_t() const { return fourcc_; }
+ constexpr uint32_t fourcc() const { return fourcc_; }
+ constexpr uint64_t modifier() const { return modifier_; }
std::string toString() const;