-
public class GifTexImage2DProvides support for animated GIFs in OpenGL. There are 2 possible usages:
- Automatic animation according to timing defined in GIF file - startDecoderThread and stopDecoderThread.
- Manual frame advancing - seekToFrame.
-
-
Constructor Summary
Constructors Constructor Description GifTexImage2D(InputSource inputSource, GifOptions options)Constructs new GifTexImage2D.
-
Method Summary
Modifier and Type Method Description intgetFrameDuration(@IntRange(from = 0) int index)See getFrameDuration voidseekToFrame(@IntRange(from = 0) int index)Seeks to given frame intgetNumberOfFrames()intgetCurrentFrameIndex()voidsetSpeed(@FloatRange(from = 0, fromInclusive = false) float factor)Sets new animation speed factor. voidglTexImage2D(int target, int level)Equivalent of glTexImage2D. voidglTexSubImage2D(int target, int level)Equivalent of glTexSubImage2D. voidstartDecoderThread()Creates frame buffer and starts decoding thread. voidstopDecoderThread()Stops decoder thread and releases frame buffer. voidrecycle()See recycle. intgetWidth()intgetHeight()intgetDuration()See getDuration -
-
Constructor Detail
-
GifTexImage2D
GifTexImage2D(InputSource inputSource, GifOptions options)
Constructs new GifTexImage2D.- Parameters:
inputSource- sourceoptions- null-ok; options controlling parameters like subsampling and opacity
-
-
Method Detail
-
getFrameDuration
int getFrameDuration(@IntRange(from = 0) int index)
See getFrameDuration
- Parameters:
index- index of the frame
-
seekToFrame
void seekToFrame(@IntRange(from = 0) int index)
Seeks to given frame
- Parameters:
index- index of the frame
-
getNumberOfFrames
int getNumberOfFrames()
-
getCurrentFrameIndex
int getCurrentFrameIndex()
-
setSpeed
void setSpeed(@FloatRange(from = 0, fromInclusive = false) float factor)
Sets new animation speed factor. See setSpeed.
- Parameters:
factor- new speed factor, eg.
-
glTexImage2D
void glTexImage2D(int target, int level)
Equivalent of glTexImage2D.Where
Buffercontains pixels of the current frame.- Parameters:
target- target texturelevel- level-of-detail number
-
glTexSubImage2D
void glTexSubImage2D(int target, int level)
Equivalent of glTexSubImage2D.Where
Buffercontains pixels of the current frame.- Parameters:
target- target texturelevel- level-of-detail number
-
startDecoderThread
void startDecoderThread()
Creates frame buffer and starts decoding thread. Does nothing if already started.
-
stopDecoderThread
void stopDecoderThread()
Stops decoder thread and releases frame buffer. Does nothing if already stopped.
-
getWidth
int getWidth()
-
getHeight
int getHeight()
-
getDuration
int getDuration()
See getDuration
-
-
-
-