hyperion.ng/include/grabber/PixelFormat.h
poljvd dd1adc4e90 Merge pull request #73 from lobocobra/patch-1
Fix error in start script


Former-commit-id: 6a02b865c86befa29e970a7465b256cde5335e95
2014-04-11 19:52:33 +02:00

37 lines
678 B
C++

#pragma once
#include <string>
#include <algorithm>
/**
* Enumeration of the possible pixel formats the grabber can be set to
*/
enum PixelFormat {
PIXELFORMAT_YUYV,
PIXELFORMAT_UYVY,
PIXELFORMAT_RGB32,
PIXELFORMAT_NO_CHANGE
};
inline PixelFormat parsePixelFormat(std::string pixelFormat)
{
// convert to lower case
std::transform(pixelFormat.begin(), pixelFormat.end(), pixelFormat.begin(), ::tolower);
if (pixelFormat == "yuyv")
{
return PIXELFORMAT_YUYV;
}
else if (pixelFormat == "uyvy")
{
return PIXELFORMAT_UYVY;
}
else if (pixelFormat == "rgb32")
{
return PIXELFORMAT_RGB32;
}
// return the default NO_CHANGE
return PIXELFORMAT_NO_CHANGE;
}