mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Fixed slider in player, show filtered image when disabled (outside mixing circle), correct timing for clone source (different for filters).
49 lines
981 B
C++
49 lines
981 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", "Smooth & Noise", "Edge", "Alpha", "Custom shader"
|
|
};
|
|
|
|
FrameBufferFilter::FrameBufferFilter() : enabled_(true), input_(nullptr)
|
|
{
|
|
|
|
}
|
|
|
|
void FrameBufferFilter::draw (FrameBuffer *input)
|
|
{
|
|
if (input && ( enabled_ || input_ == nullptr ) )
|
|
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);
|
|
}
|