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

@@ -235,10 +235,10 @@ glm::vec3 FrameBuffer::resolution() const
return glm::vec3(attrib_.viewport.x, attrib_.viewport.y, 0.f);
}
void FrameBuffer::resize(int width, int height)
void FrameBuffer::resize(glm::vec3 res)
{
if (framebufferid_) {
if (attrib_.viewport.x != width || attrib_.viewport.y != height)
if (attrib_.viewport.x != res.x || attrib_.viewport.y != res.y)
{
// de-init
glDeleteFramebuffers(1, &framebufferid_);
@@ -257,7 +257,7 @@ void FrameBuffer::resize(int width, int height)
multisampling_textureid_ = 0;
// change resolution
attrib_.viewport = glm::ivec2(width, height);
attrib_.viewport = glm::ivec2(res);
mem_usage_ = 0;
}
}