Original implementation of Resampling Image filters

This involves also resizing the renderbuffer of the clone source. Upsampling is cubic (faster approximation) and Downsampling is bilinear.
This commit is contained in:
Bruno Herbelin
2022-06-05 23:43:23 +02:00
parent d2e3b854aa
commit fec2fb7ce6
18 changed files with 356 additions and 7 deletions

View File

@@ -102,6 +102,36 @@ protected:
};
class ResampleFilter : public ImageFilter
{
public:
ResampleFilter();
// Factors of resampling
typedef enum {
RESAMPLE_DOUBLE = 0,
RESAMPLE_HALF,
RESAMPLE_QUARTER,
RESAMPLE_INVALID
} ResampleFactor;
static const char* factor_label[RESAMPLE_INVALID];
ResampleFactor factor () const { return factor_; }
void setFactor(int factor);
// implementation of FrameBufferFilter
Type type() const override { return FrameBufferFilter::FILTER_RESAMPLE; }
void draw (FrameBuffer *input) override;
void accept (Visitor& v) override;
private:
ResampleFactor factor_;
static std::vector< FilteringProgram > programs_;
};
class BlurFilter : public ImageFilter
{
public: