mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-18 13:49:57 +01:00
Cleanup source tree
Move all C++ source files in the src subfolder. Adapted the cmake process accordingly and cleanup.
This commit is contained in:
48
src/FrameBufferFilter.cpp
Normal file
48
src/FrameBufferFilter.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user