Emu?
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
1.5 KiB

/* PlipVideo.cpp
*
* Provides a toolkit-agnostic video interface.
*/
#include "PlipVideo.h"
#include "PlipVideoException.h"
namespace Plip {
PlipVideoFormatInfo PlipVideo::GetFormatInfo(PlipVideoFormat format) {
switch(format) {
case PlipVideoFormat::RGB888:
return { .pixelWidth = 3, .plot = PlipVideo::PlotRgb888 };
case PlipVideoFormat::BGR888:
return { .pixelWidth = 3, .plot = PlipVideo::PlotBgr888 };
case PlipVideoFormat::XRGB8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotXrgb8888 };
case PlipVideoFormat::XBGR8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotXbgr8888 };
case PlipVideoFormat::ARGB8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotArgb8888 };
case PlipVideoFormat::ABGR8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotAbgr8888 };
case PlipVideoFormat::RGBX8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotRgbx8888 };
case PlipVideoFormat::BGRX8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotBgrx8888 };
case PlipVideoFormat::RGBA8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotRgba8888 };
case PlipVideoFormat::BGRA8888:
return { .pixelWidth = 4, .plot = PlipVideo::PlotBgra8888 };
default:
throw PlipVideoException("Unsupported pixel format.");
}
}
}