|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Simple TextureSequence implementation allowing existing textures or image streams to be used and replayed as frames.
More...
Public Member Functions | |||||
| ImageSequence (final int textureUnit, final boolean useBuildInTexLookup) | |||||
| void | setParams (final int magFilter, final int minFilter, final int wrapS, final int wrapT) | ||||
| final TextureSequence.TextureFrame | addFrame (final GL gl, final Texture tex) | ||||
| final TextureSequence.TextureFrame | addFrame (final GL gl, final TextureSequence.TextureFrame frame) | ||||
| boolean | removeFrame (final TextureFrame tex) | ||||
| void | removeAllFrames () | ||||
| final void | addFrame (final GL gl, final Class<?> context, final String imageResourcePath, final String imageSuffix) throws IOException | ||||
| final int | getFrameCount () | ||||
| final int | getCurrentIdx () | ||||
| final void | setCurrentIdx (final int idx) throws IndexOutOfBoundsException | ||||
| final void | setManualStepping (final boolean v) | ||||
| final boolean | isManualStepping () | ||||
| final boolean | isSequenceAnimating () | ||||
Returns true if not isManualStepping() and getFrameCount() > 1. More... | |||||
| final TextureSequence.TextureFrame | getFrame (final int idx) | ||||
| void | destroy (final GL gl) throws GLException | ||||
| int | getTextureTarget () | ||||
| Returns the texture target used by implementation. More... | |||||
| int | getTextureUnit () | ||||
| Return the texture unit used to render the current frame. More... | |||||
| int[] | getTextureMinMagFilter () | ||||
| int[] | getTextureWrapST () | ||||
| boolean | useARatioAdjustment () | ||||
Returning true indicates texture correction for aspect-ratio in the shader.Graph's Region shader will utilize setTexCoordBBox(Texture, AABBox, boolean, float[], boolean) for texture-coordinate bounding-box calculation. Returning false indicates no correction for aspect-ratio in the shader. Graph's Region shader will utilize setTexCoordBBoxSimple(Texture, AABBox, float[], boolean) for texture-coordinate bounding-box calculation. Default value is implementation specific and toggling is optional.
| |||||
| void | setARatioAdjustment (final boolean v) | ||||
Toggles useARatioLetterbox().Default value is implementation specific and toggling is optional.
More... | |||||
| boolean | useARatioLetterbox () | ||||
Returns whether useARatioAdjustment() shall add letter-box space to match aspect-ratio, otherwise it will be zoomed in.Default value is implementation specific and toggling is optional.
More... | |||||
| Vec4f | getARatioLetterboxBackColor () | ||||
Returns useARatioLetterbox() background color for added letter-box space, defaults to transparent zero. More... | |||||
| void | setARatioLetterbox (final boolean v, final Vec4f backColor) | ||||
Toggles useARatioLetterbox().Default value is implementation specific and toggling is optional. Impacts only if useARatioAdjustment() returns true.
| |||||
| boolean | isTextureAvailable () | ||||
Returns true if texture source is ready and a texture is available via getNextTexture(GL) and getLastTexture(). More... | |||||
| TextureSequence.TextureFrame | getLastTexture () throws IllegalStateException | ||||
| Returns the last updated texture. More... | |||||
| TextureSequence.TextureFrame | getNextTexture (final GL gl) throws IllegalStateException | ||||
| Returns the next texture to be rendered. More... | |||||
| String | getRequiredExtensionsShaderStub () throws IllegalStateException | ||||
| In case a shader extension is required, based on the implementation and the runtime GL profile, this method returns the preprocessor macros, e.g. More... | |||||
| String | getTextureSampler2DType () throws IllegalStateException | ||||
Returns either sampler2D or samplerExternalOES depending on getLastTexture(). More... | |||||
| String | setTextureLookupFunctionName (final String texLookupFuncName) throws IllegalStateException | ||||
| Set the desired shader code's texture lookup function name. More... | |||||
| String | getTextureLookupFunctionName () throws IllegalStateException | ||||
Returns the chosen lookup function name, which can be set via setTextureLookupFunctionName(String). More... | |||||
| String | getTextureLookupFragmentShaderImpl () throws IllegalStateException | ||||
| Returns the complete texture2D lookup function code of type. More... | |||||
| String | getTextureFragmentShaderHashID () | ||||
Returns the concatenated string representing the following values utilized for getTextureFragmentShaderHashCode(). More... | |||||
| int | getTextureFragmentShaderHashCode () | ||||
Returns the hash code of the string getTextureFragmentShaderHashID(). More... | |||||
| int | getTextureTarget () | ||||
| Returns the texture target used by implementation. More... | |||||
| int | getTextureUnit () | ||||
| Return the texture unit used to render the current frame. More... | |||||
| int[] | getTextureMinMagFilter () | ||||
| int[] | getTextureWrapST () | ||||
| boolean | useARatioAdjustment () | ||||
Returning true indicates texture correction for aspect-ratio in the shader. More... | |||||
| void | setARatioAdjustment (final boolean v) | ||||
Toggles useARatioLetterbox(). More... | |||||
| boolean | useARatioLetterbox () | ||||
Returns whether useARatioAdjustment() shall add letter-box space to match aspect-ratio, otherwise it will be zoomed in. More... | |||||
| Vec4f | getARatioLetterboxBackColor () | ||||
Returns useARatioLetterbox() background color for added letter-box space, defaults to transparent zero. More... | |||||
| void | setARatioLetterbox (final boolean v, Vec4f backColor) | ||||
Toggles useARatioLetterbox(). More... | |||||
| boolean | isTextureAvailable () | ||||
Returns true if texture source is ready and a texture is available via getNextTexture(GL) and getLastTexture(). More... | |||||
| TextureFrame | getLastTexture () throws IllegalStateException | ||||
| Returns the last updated texture. More... | |||||
| TextureFrame | getNextTexture (GL gl) throws IllegalStateException | ||||
| Returns the next texture to be rendered. More... | |||||
| String | getRequiredExtensionsShaderStub () throws IllegalStateException | ||||
| In case a shader extension is required, based on the implementation and the runtime GL profile, this method returns the preprocessor macros, e.g. More... | |||||
| String | getTextureSampler2DType () throws IllegalStateException | ||||
Returns either sampler2D or samplerExternalOES depending on getLastTexture(). More... | |||||
| String | setTextureLookupFunctionName (String texLookupFuncName) throws IllegalStateException | ||||
| Set the desired shader code's texture lookup function name. More... | |||||
| String | getTextureLookupFunctionName () throws IllegalStateException | ||||
Returns the chosen lookup function name, which can be set via setTextureLookupFunctionName(String). More... | |||||
| String | getTextureLookupFragmentShaderImpl () throws IllegalStateException | ||||
| Returns the complete texture2D lookup function code of type. More... | |||||
| String | getTextureFragmentShaderHashID () | ||||
Returns the concatenated string representing the following values utilized for getTextureFragmentShaderHashCode(). More... | |||||
| int | getTextureFragmentShaderHashCode () | ||||
Returns the hash code of the string getTextureFragmentShaderHashID(). More... | |||||
Additional Inherited Members | |
Static Public Member Functions inherited from com.jogamp.opengl.util.texture.TextureSequence | |
| static void | setTexCoordBBoxSimple (final Texture tex, final AABBox box, final float[] colorTexBBox, final boolean verbose) |
| Calculates the texture coordinates bounding box w/o correcting aspect-ratio. More... | |
| static void | setTexCoordBBox (final Texture tex, final AABBox box, final boolean letterBox, final float[] colorTexBBox, final boolean verbose) |
| Calculates the texture coordinates bounding box while correcting for aspect-ratio. More... | |
Static Public Attributes inherited from com.jogamp.opengl.util.texture.TextureSequence | |
| static final String | samplerExternalOES = "samplerExternalOES" |
| static final String | sampler2D = "sampler2D" |
Simple TextureSequence implementation allowing existing textures or image streams to be used and replayed as frames.
Definition at line 48 of file ImageSequence.java.
| com.jogamp.opengl.util.texture.ImageSequence.ImageSequence | ( | final int | textureUnit, |
| final boolean | useBuildInTexLookup | ||
| ) |
Definition at line 61 of file ImageSequence.java.
| final void com.jogamp.opengl.util.texture.ImageSequence.addFrame | ( | final GL | gl, |
| final Class<?> | context, | ||
| final String | imageResourcePath, | ||
| final String | imageSuffix | ||
| ) | throws IOException |
| final TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.addFrame | ( | final GL | gl, |
| final Texture | tex | ||
| ) |
Definition at line 73 of file ImageSequence.java.
| final TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.addFrame | ( | final GL | gl, |
| final TextureSequence.TextureFrame | frame | ||
| ) |
| void com.jogamp.opengl.util.texture.ImageSequence.destroy | ( | final GL | gl | ) | throws GLException |
| Vec4f com.jogamp.opengl.util.texture.ImageSequence.getARatioLetterboxBackColor | ( | ) |
Returns useARatioLetterbox() background color for added letter-box space, defaults to transparent zero.
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 171 of file ImageSequence.java.
| final int com.jogamp.opengl.util.texture.ImageSequence.getCurrentIdx | ( | ) |
Definition at line 102 of file ImageSequence.java.
| final TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.getFrame | ( | final int | idx | ) |
Definition at line 114 of file ImageSequence.java.
| final int com.jogamp.opengl.util.texture.ImageSequence.getFrameCount | ( | ) |
Definition at line 101 of file ImageSequence.java.
| TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.getLastTexture | ( | ) | throws IllegalStateException |
Returns the last updated texture.
In case the instance is just initialized, it shall return a TextureFrame object with valid attributes. The texture content may be undefined until the first call of getNextTexture(GL).
Not blocking.
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 191 of file ImageSequence.java.
| TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.getNextTexture | ( | final GL | gl | ) | throws IllegalStateException |
Returns the next texture to be rendered.
Implementation shall return the next frame if available, may block if a next frame may arrive soon. Otherwise implementation shall return the last frame.
Shall return null in case no next or last frame is available.
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 196 of file ImageSequence.java.
| String com.jogamp.opengl.util.texture.ImageSequence.getRequiredExtensionsShaderStub | ( | ) | throws IllegalStateException |
In case a shader extension is required, based on the implementation and the runtime GL profile, this method returns the preprocessor macros, e.g.
:
#extension GL_OES_EGL_image_external : enable
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 204 of file ImageSequence.java.
| int com.jogamp.opengl.util.texture.ImageSequence.getTextureFragmentShaderHashCode | ( | ) |
Returns the hash code of the string getTextureFragmentShaderHashID().
User shall call setTextureLookupFunctionName(String) first if intended.
Returns zero if texture is not available.
The returned hash code allows selection of a matching shader program for this TextureSequence instance.
Implementation caches the resulting hash code, which is reset by setTextureLookupFunctionName(String) and this method if texture is not available.
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 254 of file ImageSequence.java.
| String com.jogamp.opengl.util.texture.ImageSequence.getTextureFragmentShaderHashID | ( | ) |
Returns the concatenated string representing the following values utilized for getTextureFragmentShaderHashCode().
To reduce string concatenating, implementation may simply return getTextureLookupFragmentShaderImpl(), if it covers getTextureSampler2DType() and getTextureLookupFunctionName().
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 244 of file ImageSequence.java.
| String com.jogamp.opengl.util.texture.ImageSequence.getTextureLookupFragmentShaderImpl | ( | ) | throws IllegalStateException |
Returns the complete texture2D lookup function code of type.
vec4 funcName(in getTextureSampler2DType() image, in vec2 texCoord) { vec4 texColor = do_something_with(image, texCoord); return texColor; }
<p<blockquote>
funcName is set via setTextureLookupFunctionName(String) and queried via getTextureLookupFunctionName().
User shall call setTextureLookupFunctionName(String) first if intended.
Note: This function may return an empty string in case a build-in lookup function is being chosen. If the implementation desires so, getTextureLookupFunctionName() will ignore the desired function name and returns the build-in lookup function name.
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 232 of file ImageSequence.java.
| String com.jogamp.opengl.util.texture.ImageSequence.getTextureLookupFunctionName | ( | ) | throws IllegalStateException |
Returns the chosen lookup function name, which can be set via setTextureLookupFunctionName(String).
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 227 of file ImageSequence.java.
| int[] com.jogamp.opengl.util.texture.ImageSequence.getTextureMinMagFilter | ( | ) |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 134 of file ImageSequence.java.
| String com.jogamp.opengl.util.texture.ImageSequence.getTextureSampler2DType | ( | ) | throws IllegalStateException |
Returns either sampler2D or samplerExternalOES depending on getLastTexture().
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 209 of file ImageSequence.java.
| int com.jogamp.opengl.util.texture.ImageSequence.getTextureTarget | ( | ) |
Returns the texture target used by implementation.
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 124 of file ImageSequence.java.
| int com.jogamp.opengl.util.texture.ImageSequence.getTextureUnit | ( | ) |
Return the texture unit used to render the current frame.
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 129 of file ImageSequence.java.
| int[] com.jogamp.opengl.util.texture.ImageSequence.getTextureWrapST | ( | ) |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 139 of file ImageSequence.java.
| final boolean com.jogamp.opengl.util.texture.ImageSequence.isManualStepping | ( | ) |
Definition at line 110 of file ImageSequence.java.
| final boolean com.jogamp.opengl.util.texture.ImageSequence.isSequenceAnimating | ( | ) |
Returns true if not isManualStepping() and getFrameCount() > 1.
Definition at line 113 of file ImageSequence.java.
| boolean com.jogamp.opengl.util.texture.ImageSequence.isTextureAvailable | ( | ) |
Returns true if texture source is ready and a texture is available via getNextTexture(GL) and getLastTexture().
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 188 of file ImageSequence.java.
| void com.jogamp.opengl.util.texture.ImageSequence.removeAllFrames | ( | ) |
Definition at line 88 of file ImageSequence.java.
| boolean com.jogamp.opengl.util.texture.ImageSequence.removeFrame | ( | final TextureFrame | tex | ) |
Definition at line 85 of file ImageSequence.java.
| void com.jogamp.opengl.util.texture.ImageSequence.setARatioAdjustment | ( | final boolean | v | ) |
Toggles useARatioLetterbox().Default value is implementation specific and toggling is optional.
Defaults to true.
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 159 of file ImageSequence.java.
| void com.jogamp.opengl.util.texture.ImageSequence.setARatioLetterbox | ( | final boolean | v, |
| final Vec4f | backColor | ||
| ) |
Toggles useARatioLetterbox().Default value is implementation specific and toggling is optional. Impacts only if useARatioAdjustment() returns true.
| v | new value for useARatioLetterbox() |
| backColor | optional background color for added letter-box space, defaults to transparent zero |
Defaults to false.
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 180 of file ImageSequence.java.
| final void com.jogamp.opengl.util.texture.ImageSequence.setCurrentIdx | ( | final int | idx | ) | throws IndexOutOfBoundsException |
Definition at line 103 of file ImageSequence.java.
| final void com.jogamp.opengl.util.texture.ImageSequence.setManualStepping | ( | final boolean | v | ) |
Definition at line 109 of file ImageSequence.java.
| void com.jogamp.opengl.util.texture.ImageSequence.setParams | ( | final int | magFilter, |
| final int | minFilter, | ||
| final int | wrapS, | ||
| final int | wrapT | ||
| ) |
| String com.jogamp.opengl.util.texture.ImageSequence.setTextureLookupFunctionName | ( | final String | texLookupFuncName | ) | throws IllegalStateException |
Set the desired shader code's texture lookup function name.
| texLookupFuncName | desired lookup function name. If null or ignored by the implementation, a build-in name is returned. |
| IllegalStateException | if instance is not initialized |
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 216 of file ImageSequence.java.
| boolean com.jogamp.opengl.util.texture.ImageSequence.useARatioAdjustment | ( | ) |
Returning true indicates texture correction for aspect-ratio in the shader.Graph's Region shader will utilize setTexCoordBBox(Texture, AABBox, boolean, float[], boolean) for texture-coordinate bounding-box calculation. Returning false indicates no correction for aspect-ratio in the shader. Graph's Region shader will utilize setTexCoordBBoxSimple(Texture, AABBox, float[], boolean) for texture-coordinate bounding-box calculation. Default value is implementation specific and toggling is optional.
Defaults to true and toggling is supported via setARatioAdjustment(boolean)
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 150 of file ImageSequence.java.
| boolean com.jogamp.opengl.util.texture.ImageSequence.useARatioLetterbox | ( | ) |
Returns whether useARatioAdjustment() shall add letter-box space to match aspect-ratio, otherwise it will be zoomed in.Default value is implementation specific and toggling is optional.
Defaults to false and toggling is supported via setARatioLetterbox(boolean, Vec4f)
Implements com.jogamp.opengl.util.texture.TextureSequence.
Definition at line 168 of file ImageSequence.java.