-
public class GifTexImage2D
Provides 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 int
getFrameDuration(@IntRange(from = 0) int index)
See getFrameDuration void
seekToFrame(@IntRange(from = 0) int index)
Seeks to given frame int
getNumberOfFrames()
int
getCurrentFrameIndex()
void
setSpeed(@FloatRange(from = 0, fromInclusive = false) float factor)
Sets new animation speed factor. void
glTexImage2D(int target, int level)
Equivalent of glTexImage2D. void
glTexSubImage2D(int target, int level)
Equivalent of glTexSubImage2D. void
startDecoderThread()
Creates frame buffer and starts decoding thread. void
stopDecoderThread()
Stops decoder thread and releases frame buffer. void
recycle()
See recycle. int
getWidth()
int
getHeight()
int
getDuration()
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
Buffer
contains pixels of the current frame.- Parameters:
target
- target texturelevel
- level-of-detail number
-
glTexSubImage2D
void glTexSubImage2D(int target, int level)
Equivalent of glTexSubImage2D.Where
Buffer
contains 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
-
-
-
-