Package 

Class Gif

  • All Implemented Interfaces:

    
    public final class Gif
    
                        

    Representation of the gif, with methods to decode frames. This class's methods are not thread safe.

    • Method Detail

      • getFrameCount

         final Integer getFrameCount()

        How many frames in the GIF. If more than 1, we have an animated GIF.

      • getLoopCount

         final LoopCount getLoopCount()

        For animated gif, the loop count policy: should never loop, should loop forever or should loop a set amount of time.

      • advance

         final Result<Unit> advance()

        Advance the frame index, decode the new frame, looping back to zero after the last frame has been reached. Does not care about loop count.

      • getCurrentFrame

         final Result<IntArray> getCurrentFrame(IntArray inPixels)

        Write the current frame in the int array.

        Parameters:
        inPixels - The buffer where the pixels will be written.
      • getFrame

         final Result<IntArray> getFrame(Integer index)

        Get the frame at set index, returning a int array. It will internally advance the current frame counter if needed, and draw each needed frame it turn, to make sure the result is consistent.

        Parameters:
        index - The index of the frame to decode and return.
      • getFrame

         final Result<IntArray> getFrame(Integer index, IntArray inPixels)

        Get the frame at set index, writing it in the provided int array. It will internally advance the current frame counter if needed, and draw each needed frame it turn, to make sure the result is consistent.

        Parameters:
        index - The index of the frame to decode and return.
        inPixels - The buffer where the pixels will be written.