JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.texture.ImageSequence Class Reference

Simple TextureSequence implementation allowing existing textures or image streams to be used and replayed as frames. More...

Inheritance diagram for com.jogamp.opengl.util.texture.ImageSequence:
Collaboration diagram for com.jogamp.opengl.util.texture.ImageSequence:

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.
See also
setTexCoordBBox(Texture, AABBox, boolean, float[], boolean)
setTexCoordBBoxSimple(Texture, AABBox, float[], boolean)
useARatioLetterbox()
More...
 
void setARatioAdjustment (final boolean v)
 Toggles useARatioLetterbox().Default value is implementation specific and toggling is optional.
See also
useARatioLetterbox()
useARatioAdjustment()
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.
See also
useARatioAdjustment()
setARatioLetterbox(boolean, Vec4f)
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.
Parameters
vnew value for useARatioLetterbox()
backColoroptional background color for added letter-box space, defaults to transparent zero
See also
useARatioLetterbox()
useARatioAdjustment()
More...
 
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"
 

Detailed Description

Simple TextureSequence implementation allowing existing textures or image streams to be used and replayed as frames.

Definition at line 48 of file ImageSequence.java.

Constructor & Destructor Documentation

◆ ImageSequence()

com.jogamp.opengl.util.texture.ImageSequence.ImageSequence ( final int  textureUnit,
final boolean  useBuildInTexLookup 
)

Definition at line 61 of file ImageSequence.java.

Member Function Documentation

◆ addFrame() [1/3]

final void com.jogamp.opengl.util.texture.ImageSequence.addFrame ( final GL  gl,
final Class<?>  context,
final String  imageResourcePath,
final String  imageSuffix 
) throws IOException

Definition at line 92 of file ImageSequence.java.

Here is the call graph for this function:

◆ addFrame() [2/3]

final TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.addFrame ( final GL  gl,
final Texture  tex 
)

Definition at line 73 of file ImageSequence.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addFrame() [3/3]

final TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.addFrame ( final GL  gl,
final TextureSequence.TextureFrame  frame 
)

Definition at line 76 of file ImageSequence.java.

Here is the call graph for this function:

◆ destroy()

void com.jogamp.opengl.util.texture.ImageSequence.destroy ( final GL  gl) throws GLException

Definition at line 116 of file ImageSequence.java.

Here is the caller graph for this function:

◆ getARatioLetterboxBackColor()

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.

◆ getCurrentIdx()

final int com.jogamp.opengl.util.texture.ImageSequence.getCurrentIdx ( )

Definition at line 102 of file ImageSequence.java.

◆ getFrame()

final TextureSequence.TextureFrame com.jogamp.opengl.util.texture.ImageSequence.getFrame ( final int  idx)

Definition at line 114 of file ImageSequence.java.

◆ getFrameCount()

final int com.jogamp.opengl.util.texture.ImageSequence.getFrameCount ( )

Definition at line 101 of file ImageSequence.java.

◆ getLastTexture()

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.

Exceptions
IllegalStateExceptionif instance is not initialized

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 191 of file ImageSequence.java.

◆ getNextTexture()

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.

Exceptions
IllegalStateExceptionif instance is not initialized

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 196 of file ImageSequence.java.

◆ getRequiredExtensionsShaderStub()

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
Exceptions
IllegalStateExceptionif instance is not initialized

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 204 of file ImageSequence.java.

◆ getTextureFragmentShaderHashCode()

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.

See also
setTextureLookupFunctionName(String)
getTextureLookupFunctionName()
getTextureLookupFragmentShaderImpl()
getTextureFragmentShaderHashID()

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 254 of file ImageSequence.java.

Here is the call graph for this function:

◆ getTextureFragmentShaderHashID()

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().

See also
getTextureFragmentShaderHashCode()

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 244 of file ImageSequence.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTextureLookupFragmentShaderImpl()

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.

Exceptions
IllegalStateExceptionif instance is not initialized
See also
getTextureLookupFunctionName()
setTextureLookupFunctionName(String)
getTextureFragmentShaderHashID()
getTextureFragmentShaderHashCode()
getTextureSampler2DType()

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 232 of file ImageSequence.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTextureLookupFunctionName()

String com.jogamp.opengl.util.texture.ImageSequence.getTextureLookupFunctionName ( ) throws IllegalStateException

Returns the chosen lookup function name, which can be set via setTextureLookupFunctionName(String).

Exceptions
IllegalStateExceptionif instance is not initialized
See also
setTextureLookupFunctionName(String)
getTextureFragmentShaderHashCode()
getTextureLookupFragmentShaderImpl()

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 227 of file ImageSequence.java.

Here is the caller graph for this function:

◆ getTextureMinMagFilter()

int[] com.jogamp.opengl.util.texture.ImageSequence.getTextureMinMagFilter ( )

◆ getTextureSampler2DType()

String com.jogamp.opengl.util.texture.ImageSequence.getTextureSampler2DType ( ) throws IllegalStateException

Returns either sampler2D or samplerExternalOES depending on getLastTexture().

getTexture().getTarget().

Exceptions
IllegalStateExceptionif instance is not initialized

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 209 of file ImageSequence.java.

Here is the caller graph for this function:

◆ getTextureTarget()

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.

Here is the caller graph for this function:

◆ getTextureUnit()

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.

Here is the caller graph for this function:

◆ getTextureWrapST()

int[] com.jogamp.opengl.util.texture.ImageSequence.getTextureWrapST ( )

◆ isManualStepping()

final boolean com.jogamp.opengl.util.texture.ImageSequence.isManualStepping ( )

Definition at line 110 of file ImageSequence.java.

◆ isSequenceAnimating()

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.

◆ isTextureAvailable()

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.

Here is the caller graph for this function:

◆ removeAllFrames()

void com.jogamp.opengl.util.texture.ImageSequence.removeAllFrames ( )

Definition at line 88 of file ImageSequence.java.

◆ removeFrame()

boolean com.jogamp.opengl.util.texture.ImageSequence.removeFrame ( final TextureFrame  tex)

Definition at line 85 of file ImageSequence.java.

◆ setARatioAdjustment()

void com.jogamp.opengl.util.texture.ImageSequence.setARatioAdjustment ( final boolean  v)

Toggles useARatioLetterbox().Default value is implementation specific and toggling is optional.

See also
useARatioLetterbox()
useARatioAdjustment()

Defaults to true.

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 159 of file ImageSequence.java.

◆ setARatioLetterbox()

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.

Parameters
vnew value for useARatioLetterbox()
backColoroptional background color for added letter-box space, defaults to transparent zero
See also
useARatioLetterbox()
useARatioAdjustment()

Defaults to false.

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 180 of file ImageSequence.java.

Here is the call graph for this function:

◆ setCurrentIdx()

final void com.jogamp.opengl.util.texture.ImageSequence.setCurrentIdx ( final int  idx) throws IndexOutOfBoundsException

Definition at line 103 of file ImageSequence.java.

◆ setManualStepping()

final void com.jogamp.opengl.util.texture.ImageSequence.setManualStepping ( final boolean  v)

Definition at line 109 of file ImageSequence.java.

◆ setParams()

void com.jogamp.opengl.util.texture.ImageSequence.setParams ( final int  magFilter,
final int  minFilter,
final int  wrapS,
final int  wrapT 
)

Definition at line 66 of file ImageSequence.java.

Here is the caller graph for this function:

◆ setTextureLookupFunctionName()

String com.jogamp.opengl.util.texture.ImageSequence.setTextureLookupFunctionName ( final String  texLookupFuncName) throws IllegalStateException

Set the desired shader code's texture lookup function name.

Parameters
texLookupFuncNamedesired lookup function name. If null or ignored by the implementation, a build-in name is returned.
Returns
the chosen lookup function name
Exceptions
IllegalStateExceptionif instance is not initialized
See also
getTextureLookupFunctionName()
getTextureFragmentShaderHashCode()
getTextureLookupFragmentShaderImpl()

Implements com.jogamp.opengl.util.texture.TextureSequence.

Definition at line 216 of file ImageSequence.java.

◆ useARatioAdjustment()

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.

See also
setTexCoordBBox(Texture, AABBox, boolean, float[], boolean)
setTexCoordBBoxSimple(Texture, AABBox, float[], boolean)
useARatioLetterbox()

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.

◆ useARatioLetterbox()

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.

See also
useARatioAdjustment()
setARatioLetterbox(boolean, Vec4f)

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.


The documentation for this class was generated from the following file: