mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
This involves also resizing the renderbuffer of the clone source. Upsampling is cubic (faster approximation) and Downsampling is bilinear.
48 lines
895 B
C++
48 lines
895 B
C++
#include "FrameBuffer.h"
|
|
#include "Resource.h"
|
|
#include "Visitor.h"
|
|
|
|
#include "FrameBufferFilter.h"
|
|
#include "FrameBufferFilter.h"
|
|
|
|
const char* FrameBufferFilter::type_label[FrameBufferFilter::FILTER_INVALID] = {
|
|
"None", "Delay", "Resample", "Blur", "Sharpen", "Edge", "Shader code"
|
|
};
|
|
|
|
FrameBufferFilter::FrameBufferFilter() : enabled_(true), input_(nullptr)
|
|
{
|
|
|
|
}
|
|
|
|
void FrameBufferFilter::draw (FrameBuffer *input)
|
|
{
|
|
input_ = input;
|
|
}
|
|
|
|
void FrameBufferFilter::accept(Visitor& v)
|
|
{
|
|
if (input_)
|
|
v.visit(*this);
|
|
}
|
|
|
|
PassthroughFilter::PassthroughFilter() : FrameBufferFilter()
|
|
{
|
|
|
|
}
|
|
|
|
uint PassthroughFilter::texture() const
|
|
{
|
|
if (input_)
|
|
return input_->texture();
|
|
else
|
|
return Resource::getTextureBlack();
|
|
}
|
|
|
|
glm::vec3 PassthroughFilter::resolution() const
|
|
{
|
|
if (input_)
|
|
return input_->resolution();
|
|
else
|
|
return glm::vec3(1,1,0);
|
|
}
|