change: change code style to Linux style except indent.
This commit is contained in:
+95
-94
@@ -26,7 +26,8 @@
|
||||
|
||||
#include "render/videoparams.h"
|
||||
|
||||
namespace olive {
|
||||
namespace olive
|
||||
{
|
||||
|
||||
class AcceleratedJob;
|
||||
class Renderer;
|
||||
@@ -34,130 +35,130 @@ class Renderer;
|
||||
class Texture;
|
||||
using TexturePtr = std::shared_ptr<Texture>;
|
||||
|
||||
class Texture
|
||||
{
|
||||
class Texture {
|
||||
public:
|
||||
enum Interpolation {
|
||||
kNearest,
|
||||
kLinear,
|
||||
kMipmappedLinear
|
||||
};
|
||||
enum Interpolation { kNearest, kLinear, kMipmappedLinear };
|
||||
|
||||
static const Interpolation kDefaultInterpolation;
|
||||
static const Interpolation kDefaultInterpolation;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Construct a dummy texture with no renderer backend
|
||||
*/
|
||||
Texture(const VideoParams& param) :
|
||||
renderer_(nullptr),
|
||||
params_(param),
|
||||
job_(nullptr)
|
||||
{
|
||||
}
|
||||
Texture(const VideoParams ¶m)
|
||||
: renderer_(nullptr)
|
||||
, params_(param)
|
||||
, job_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
Texture(const VideoParams &p, const T &j) :
|
||||
Texture(p)
|
||||
{
|
||||
job_ = new T(j);
|
||||
}
|
||||
template <typename T>
|
||||
Texture(const VideoParams &p, const T &j)
|
||||
: Texture(p)
|
||||
{
|
||||
job_ = new T(j);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Construct a real texture linked to a renderer backend
|
||||
*/
|
||||
Texture(Renderer* renderer, const QVariant& native, const VideoParams& param) :
|
||||
renderer_(renderer),
|
||||
params_(param),
|
||||
id_(native),
|
||||
job_(nullptr)
|
||||
{
|
||||
}
|
||||
Texture(Renderer *renderer, const QVariant &native,
|
||||
const VideoParams ¶m)
|
||||
: renderer_(renderer)
|
||||
, params_(param)
|
||||
, id_(native)
|
||||
, job_(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
~Texture();
|
||||
~Texture();
|
||||
|
||||
QVariant id() const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
QVariant id() const
|
||||
{
|
||||
return id_;
|
||||
}
|
||||
|
||||
const VideoParams& params() const
|
||||
{
|
||||
return params_;
|
||||
}
|
||||
const VideoParams ¶ms() const
|
||||
{
|
||||
return params_;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static TexturePtr Job(const VideoParams &p, const T &j)
|
||||
{
|
||||
return std::make_shared<Texture>(p, j);
|
||||
}
|
||||
template <typename T>
|
||||
static TexturePtr Job(const VideoParams &p, const T &j)
|
||||
{
|
||||
return std::make_shared<Texture>(p, j);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
TexturePtr toJob(const T &job)
|
||||
{
|
||||
return Texture::Job(params_, job);
|
||||
}
|
||||
template <typename T> TexturePtr toJob(const T &job)
|
||||
{
|
||||
return Texture::Job(params_, job);
|
||||
}
|
||||
|
||||
void Upload(void* data, int linesize);
|
||||
void Upload(void *data, int linesize);
|
||||
|
||||
void Download(void* data, int linesize);
|
||||
void Download(void *data, int linesize);
|
||||
|
||||
bool IsDummy() const
|
||||
{
|
||||
return !renderer_;
|
||||
}
|
||||
bool IsDummy() const
|
||||
{
|
||||
return !renderer_;
|
||||
}
|
||||
|
||||
int width() const
|
||||
{
|
||||
return params_.effective_width();
|
||||
}
|
||||
int width() const
|
||||
{
|
||||
return params_.effective_width();
|
||||
}
|
||||
|
||||
int height() const
|
||||
{
|
||||
return params_.effective_height();
|
||||
}
|
||||
int height() const
|
||||
{
|
||||
return params_.effective_height();
|
||||
}
|
||||
|
||||
QVector2D virtual_resolution() const
|
||||
{
|
||||
return QVector2D(params_.square_pixel_width(), params_.height());
|
||||
}
|
||||
QVector2D virtual_resolution() const
|
||||
{
|
||||
return QVector2D(params_.square_pixel_width(), params_.height());
|
||||
}
|
||||
|
||||
PixelFormat format() const
|
||||
{
|
||||
return params_.format();
|
||||
}
|
||||
PixelFormat format() const
|
||||
{
|
||||
return params_.format();
|
||||
}
|
||||
|
||||
int channel_count() const
|
||||
{
|
||||
return params_.channel_count();
|
||||
}
|
||||
int channel_count() const
|
||||
{
|
||||
return params_.channel_count();
|
||||
}
|
||||
|
||||
int divider() const
|
||||
{
|
||||
return params_.divider();
|
||||
}
|
||||
int divider() const
|
||||
{
|
||||
return params_.divider();
|
||||
}
|
||||
|
||||
const rational& pixel_aspect_ratio() const
|
||||
{
|
||||
return params_.pixel_aspect_ratio();
|
||||
}
|
||||
const rational &pixel_aspect_ratio() const
|
||||
{
|
||||
return params_.pixel_aspect_ratio();
|
||||
}
|
||||
|
||||
Renderer* renderer() const
|
||||
{
|
||||
return renderer_;
|
||||
}
|
||||
Renderer *renderer() const
|
||||
{
|
||||
return renderer_;
|
||||
}
|
||||
|
||||
bool IsJob() const { return job_; }
|
||||
AcceleratedJob *job() const { return job_; }
|
||||
bool IsJob() const
|
||||
{
|
||||
return job_;
|
||||
}
|
||||
AcceleratedJob *job() const
|
||||
{
|
||||
return job_;
|
||||
}
|
||||
|
||||
private:
|
||||
Renderer* renderer_;
|
||||
Renderer *renderer_;
|
||||
|
||||
VideoParams params_;
|
||||
VideoParams params_;
|
||||
|
||||
QVariant id_;
|
||||
|
||||
AcceleratedJob *job_;
|
||||
QVariant id_;
|
||||
|
||||
AcceleratedJob *job_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user