From da496d8162999c75f41c0d2902e3e5289008e264 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 9 Jun 2015 15:34:17 +1000 Subject: [PATCH] image: add extent query --- image.hpp | 2 ++ image.ipp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/image.hpp b/image.hpp index 6e8e3eb6..713ea646 100644 --- a/image.hpp +++ b/image.hpp @@ -50,6 +50,8 @@ namespace util { namespace image { //--------------------------------------------------------------------- constexpr size_t area (void) const; + constexpr extent2u extent (void) const; + constexpr bool is_packed (void) const; size_t w; diff --git a/image.ipp b/image.ipp index 64cbb961..d8e6d60b 100644 --- a/image.ipp +++ b/image.ipp @@ -28,6 +28,16 @@ namespace util { namespace image { return w * h; } + + //------------------------------------------------------------------------- + template + constexpr extent2u + buffer::extent (void) const + { + return { w, h }; + } + + //------------------------------------------------------------------------- template constexpr bool