diff options
| -rw-r--r-- | src/lib/image.cc | 9 | ||||
| -rw-r--r-- | src/lib/image.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc index 80ef92d06..1d06ef418 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -1728,3 +1728,12 @@ Image::crop(Crop crop) const return out; } + +bool +Image::has_alpha() const +{ + auto const d = av_pix_fmt_desc_get(_pixel_format); + DCPOMATIC_ASSERT(d); + return d->flags & AV_PIX_FMT_FLAG_ALPHA; +} + diff --git a/src/lib/image.h b/src/lib/image.h index 548ebf717..9eedaece7 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -99,6 +99,8 @@ public: return _pixel_format; } + bool has_alpha() const; + size_t memory_used () const; static std::shared_ptr<const Image> ensure_alignment (std::shared_ptr<const Image> image, Alignment alignment); |
