media now plays in node graph
This commit is contained in:
@@ -19,66 +19,3 @@
|
||||
***/
|
||||
|
||||
#include "pixelformat.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
const int kRGBAChannels = 4;
|
||||
|
||||
PixelService::PixelService()
|
||||
{
|
||||
}
|
||||
|
||||
PixelFormatInfo PixelService::GetPixelFormatInfo(const olive::PixelFormat &format)
|
||||
{
|
||||
PixelFormatInfo info;
|
||||
|
||||
switch (format) {
|
||||
case olive::PIX_FMT_RGBA8:
|
||||
info.name = tr("8-bit");
|
||||
info.internal_format = GL_RGBA8;
|
||||
info.pixel_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case olive::PIX_FMT_RGBA16:
|
||||
info.name = tr("16-bit Integer");
|
||||
info.internal_format = GL_RGBA16;
|
||||
info.pixel_type = GL_UNSIGNED_SHORT;
|
||||
break;
|
||||
case olive::PIX_FMT_RGBA16F:
|
||||
info.name = tr("Half-Float (16-bit)");
|
||||
info.internal_format = GL_RGBA16F;
|
||||
info.pixel_type = GL_HALF_FLOAT;
|
||||
break;
|
||||
case olive::PIX_FMT_RGBA32F:
|
||||
info.name = tr("Full-Float (32-bit)");
|
||||
info.internal_format = GL_RGBA32F;
|
||||
info.pixel_type = GL_FLOAT;
|
||||
break;
|
||||
default:
|
||||
qFatal("Invalid pixel format requested");
|
||||
}
|
||||
|
||||
info.pixel_format = GL_RGBA;
|
||||
info.bytes_per_pixel = BytesPerPixel(format);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
int PixelService::GetBufferSize(const olive::PixelFormat &format, const int &width, const int &height)
|
||||
{
|
||||
return BytesPerPixel(format) * width * height;
|
||||
}
|
||||
|
||||
int PixelService::BytesPerPixel(const olive::PixelFormat &format)
|
||||
{
|
||||
switch (format) {
|
||||
case olive::PIX_FMT_RGBA8:
|
||||
return 1 * kRGBAChannels;
|
||||
case olive::PIX_FMT_RGBA16:
|
||||
case olive::PIX_FMT_RGBA16F:
|
||||
return 2 * kRGBAChannels;
|
||||
case olive::PIX_FMT_RGBA32F:
|
||||
return 4 * kRGBAChannels;
|
||||
default:
|
||||
qFatal("Invalid pixel format requested");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user