summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2015-10-20 16:49:40 +0300
committerJyri Sarha <jsarha@ti.com>2015-10-20 19:18:32 +0300
commit17a0cd1a122b0a17a362bb44da559a936731d70c (patch)
tree23538722321169fd67cecc78bc38d90e9bceb5e2 /libkms++
parentbc8c11d046acb8f036b25ce23b854555d53b4feb (diff)
libkms++/pixelformats.h: Add static inline std::string PixelFormatToFourCC(PixelFormat f)
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/pixelformats.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libkms++/pixelformats.h b/libkms++/pixelformats.h
index 4432cac..75e325c 100644
--- a/libkms++/pixelformats.h
+++ b/libkms++/pixelformats.h
@@ -27,4 +27,14 @@ static inline PixelFormat FourCCToPixelFormat(const std::string& fourcc)
return (PixelFormat)MakeFourCC(fourcc.c_str());
}
+static inline std::string PixelFormatToFourCC(PixelFormat f)
+{
+ char buf[5] = { (char)(((int)f >> 0) & 0xff),
+ (char)(((int)f >> 8) & 0xff),
+ (char)(((int)f >> 16) & 0xff),
+ (char)(((int)f >> 24) & 0xff),
+ 0 };
+ return std::string(buf);
+}
+
}