various: pixel optimizations

Several things are accomplished in this commit, including:

- Use OIIO instead of our own functions for pixel format conversions
  (cleaner code/less for us to maintain)

- Fold all PixelService functions into the PixelFormat class
  (cleaner code)

- Moved OpenGL pixel definitions to OpenGL classes and out of the
  global classes.

- Add support for RGB buffers as well as RGBA (optimization)
This commit is contained in:
itsmattkc
2020-02-27 13:54:38 +11:00
parent 0624184b18
commit 02ce48d0c6
27 changed files with 491 additions and 564 deletions
+1 -3
View File
@@ -23,8 +23,6 @@
#include <QDebug>
#include <QtGlobal>
#include "render/pixelservice.h"
Frame::Frame() :
width_(0),
height_(0),
@@ -139,7 +137,7 @@ void Frame::allocate()
{
// Assume this frame is intended to be a video frame
if (width_ > 0 && height_ > 0) {
data_.resize(PixelService::GetBufferSize(static_cast<PixelFormat::Format>(format_), width_, height_));
data_.resize(PixelFormat::GetBufferSize(static_cast<PixelFormat::Format>(format_), width_, height_));
} else if (sample_count_ > 0) {
data_.resize(audio_params_.samples_to_bytes(sample_count_));
}