comparison Framework/Scene2D/Internals/OpenGLFloatTextureRenderer.cpp @ 914:4d1f57773b5b

Added image inversion support in GrayscaleStyleConfigurator + OpenGLFloatTextureProgram
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 19 Jul 2019 10:54:03 +0200
parents 6e888cf6a48b
children 1091b2adeb5a
comparison
equal deleted inserted replaced
913:2b4b6b86520a 914:4d1f57773b5b
34 texture_.reset(new OpenGLFloatTextureProgram::Data(layer.GetTexture(), layer.IsLinearInterpolation())); 34 texture_.reset(new OpenGLFloatTextureProgram::Data(layer.GetTexture(), layer.IsLinearInterpolation()));
35 } 35 }
36 36
37 layerTransform_ = layer.GetTransform(); 37 layerTransform_ = layer.GetTransform();
38 layer.GetWindowing(windowCenter_, windowWidth_); 38 layer.GetWindowing(windowCenter_, windowWidth_);
39 invert_ = layer.IsInverted();
39 } 40 }
40 41
41 42
42 OpenGLFloatTextureRenderer::OpenGLFloatTextureRenderer(OpenGL::IOpenGLContext& context, 43 OpenGLFloatTextureRenderer::OpenGLFloatTextureRenderer(OpenGL::IOpenGLContext& context,
43 OpenGLFloatTextureProgram& program, 44 OpenGLFloatTextureProgram& program,
54 unsigned int canvasHeight) 55 unsigned int canvasHeight)
55 { 56 {
56 if (texture_.get() != NULL) 57 if (texture_.get() != NULL)
57 { 58 {
58 program_.Apply(*texture_, AffineTransform2D::Combine(transform, layerTransform_), 59 program_.Apply(*texture_, AffineTransform2D::Combine(transform, layerTransform_),
59 windowCenter_, windowWidth_); 60 windowCenter_, windowWidth_, invert_);
60 } 61 }
61 } 62 }
62 63
63 64
64 void OpenGLFloatTextureRenderer::Update(const ISceneLayer& layer) 65 void OpenGLFloatTextureRenderer::Update(const ISceneLayer& layer)