diff options
author | Sven Göthel <[email protected]> | 2024-02-01 15:37:03 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-02-01 15:37:03 +0100 |
commit | 9ff736464e0d2762c424bab66bc6d03ccc6e6d11 (patch) | |
tree | 14e1a383a86bca406608841c7e3acf5d44cbee11 /src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java | |
parent | ca846bc67e6a074a182e97f29b3c34b90a12cac3 (diff) |
Bug 805: Graph/GraphUI TextureSequence Scale: Move Region.COLORTEXTURE_LETTERBOX_RENDERING_BIT to TextureSequence and add enabling/disabling of aratio adjustment + letter-box back-color
TextureSequence color-texture params fetched from Graph VBORegion* and fed into shader.
This allows more flexibility in aspect-ratio adjustment as well as setting a clipping background color for
the added letter-box space.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java index 69a990fde..4cd78b177 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java @@ -37,6 +37,7 @@ import com.jogamp.opengl.GLException; import com.jogamp.opengl.GLProfile; import com.jogamp.common.util.IOUtil; +import com.jogamp.math.Vec4f; /** * Simple {@link TextureSequence} implementation @@ -53,6 +54,9 @@ public class ImageSequence implements TextureSequence { private volatile int frameIdx = 0; private volatile boolean manualStepping = false; private int textureFragmentShaderHashCode = 0; + private boolean aRatioAdjustment = true; + private boolean aRatioLbox = false; + private final Vec4f aRatioLboxBackColor = new Vec4f(); public ImageSequence(final int textureUnit, final boolean useBuildInTexLookup) { this.textureUnit = textureUnit; @@ -136,6 +140,50 @@ public class ImageSequence implements TextureSequence { return texWrapST; } + /** + * {@inheritDoc} + * <p> + * Defaults to {@code true} and toggling is supported via {@link #setARatioAdjustment(boolean)} + * </p> + */ + @Override + public boolean useARatioAdjustment() { return aRatioAdjustment; } + + /** + * {@inheritDoc} + * <p> + * Defaults to {@code true}. + * </p> + */ + @Override + public void setARatioAdjustment(final boolean v) { aRatioAdjustment = v; } + + /** + * {@inheritDoc} + * <p> + * Defaults to {@code false} and toggling is supported via {@link #setARatioLetterbox(boolean, Vec4f)} + * </p> + */ + @Override + public boolean useARatioLetterbox() { return aRatioLbox; } + + @Override + public Vec4f getARatioLetterboxBackColor() { return aRatioLboxBackColor; } + + /** + * {@inheritDoc} + * <p> + * Defaults to {@code false}. + * </p> + */ + @Override + public void setARatioLetterbox(final boolean v, final Vec4f backColor) { + aRatioLbox = v; + if( null != backColor ) { + aRatioLboxBackColor.set(backColor); + } + }; + @Override public boolean isTextureAvailable() { return frames.size() > 0; } |