Class AnimationFrameInfo


  • public class AnimationFrameInfo
    extends java.lang.Object
    Information about individual frames in a multi-framed image.
    • Field Detail

      • _requiredFrame

        @Internal
        public int _requiredFrame

        The frame that this frame needs to be blended with, or -1 if this frame is independent (so it can be drawn over an uninitialized buffer).

        Note that this is the *earliest* frame that can be used for blending. Any frame from [_requiredFrame, i) can be used, unless its getDisposalMethod() is AnimationDisposalMode.RESTORE_PREVIOUS.

      • _duration

        @Internal
        public int _duration
        Number of milliseconds to show this frame.
      • _fullyReceived

        @Internal
        public boolean _fullyReceived

        Whether the end marker for this frame is contained in the stream.

        Note: this does not guarantee that an attempt to decode will be complete. There could be an error in the stream.

      • _alphaType

        @Internal
        public ColorAlphaType _alphaType

        This is conservative; it will still return non-opaque if e.g. a color index-based frame has a color with alpha but does not use it.

      • _hasAlphaWithinBounds

        @Internal
        public boolean _hasAlphaWithinBounds

        Whether the updated rectangle contains alpha.

        This is conservative; it will still be set to true if e.g. a color index-based frame has a color with alpha but does not use it. In addition, it may be set to true, even if the final frame, after blending, is opaque.

      • _disposalMethod

        @Internal
        public AnimationDisposalMode _disposalMethod

        How this frame should be modified before decoding the next one.

      • _blendMode

        @Internal
        public BlendMode _blendMode

        How this frame should blend with the prior frame.

      • _frameRect

        @Internal
        public io.github.humbleui.types.IRect _frameRect

        The rectangle updated by this frame.

        It may be empty, if the frame does not change the image. It will always be contained by Codec.getSize().

    • Constructor Detail

      • AnimationFrameInfo

        @Internal
        public AnimationFrameInfo​(int requiredFrame,
                                  int duration,
                                  boolean fullyReceived,
                                  int alphaTypeOrdinal,
                                  boolean hasAlphaWithinBounds,
                                  int disposalMethodOrdinal,
                                  int blendModeOrdinal,
                                  io.github.humbleui.types.IRect frameRect)
      • AnimationFrameInfo

        public AnimationFrameInfo​(int requiredFrame,
                                  int duration,
                                  boolean fullyReceived,
                                  ColorAlphaType alphaType,
                                  boolean hasAlphaWithinBounds,
                                  AnimationDisposalMode disposalMethod,
                                  BlendMode blendMode,
                                  io.github.humbleui.types.IRect frameRect)
    • Method Detail

      • getRequiredFrame

        public int getRequiredFrame()

        The frame that this frame needs to be blended with, or -1 if this frame is independent (so it can be drawn over an uninitialized buffer).

        Note that this is the *earliest* frame that can be used for blending. Any frame from [_requiredFrame, i) can be used, unless its getDisposalMethod() is AnimationDisposalMode.RESTORE_PREVIOUS.

      • getDuration

        public int getDuration()
        Number of milliseconds to show this frame.
      • isFullyReceived

        public boolean isFullyReceived()

        Whether the end marker for this frame is contained in the stream.

        Note: this does not guarantee that an attempt to decode will be complete. There could be an error in the stream.

      • getAlphaType

        public ColorAlphaType getAlphaType()

        This is conservative; it will still return non-opaque if e.g. a color index-based frame has a color with alpha but does not use it.

      • isHasAlphaWithinBounds

        public boolean isHasAlphaWithinBounds()

        Whether the updated rectangle contains alpha.

        This is conservative; it will still be set to true if e.g. a color index-based frame has a color with alpha but does not use it. In addition, it may be set to true, even if the final frame, after blending, is opaque.

      • getDisposalMethod

        public AnimationDisposalMode getDisposalMethod()

        How this frame should be modified before decoding the next one.

      • getBlendMode

        public BlendMode getBlendMode()

        How this frame should blend with the prior frame.

      • getFrameRect

        public io.github.humbleui.types.IRect getFrameRect()

        The rectangle updated by this frame.

        It may be empty, if the frame does not change the image. It will always be contained by Codec.getSize().

      • setRequiredFrame

        public AnimationFrameInfo setRequiredFrame​(int _requiredFrame)

        The frame that this frame needs to be blended with, or -1 if this frame is independent (so it can be drawn over an uninitialized buffer).

        Note that this is the *earliest* frame that can be used for blending. Any frame from [_requiredFrame, i) can be used, unless its getDisposalMethod() is AnimationDisposalMode.RESTORE_PREVIOUS.

        Returns:
        this.
      • setDuration

        public AnimationFrameInfo setDuration​(int _duration)
        Number of milliseconds to show this frame.
        Returns:
        this.
      • setFullyReceived

        public AnimationFrameInfo setFullyReceived​(boolean _fullyReceived)

        Whether the end marker for this frame is contained in the stream.

        Note: this does not guarantee that an attempt to decode will be complete. There could be an error in the stream.

        Returns:
        this.
      • setAlphaType

        public AnimationFrameInfo setAlphaType​(ColorAlphaType _alphaType)

        This is conservative; it will still return non-opaque if e.g. a color index-based frame has a color with alpha but does not use it.

        Returns:
        this.
      • setHasAlphaWithinBounds

        public AnimationFrameInfo setHasAlphaWithinBounds​(boolean _hasAlphaWithinBounds)

        Whether the updated rectangle contains alpha.

        This is conservative; it will still be set to true if e.g. a color index-based frame has a color with alpha but does not use it. In addition, it may be set to true, even if the final frame, after blending, is opaque.

        Returns:
        this.
      • setBlendMode

        public AnimationFrameInfo setBlendMode​(BlendMode _blendMode)

        How this frame should blend with the prior frame.

        Returns:
        this.
      • setFrameRect

        public AnimationFrameInfo setFrameRect​(io.github.humbleui.types.IRect _frameRect)

        The rectangle updated by this frame.

        It may be empty, if the frame does not change the image. It will always be contained by Codec.getSize().

        Returns:
        this.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • withRequiredFrame

        public AnimationFrameInfo withRequiredFrame​(int _requiredFrame)

        The frame that this frame needs to be blended with, or -1 if this frame is independent (so it can be drawn over an uninitialized buffer).

        Note that this is the *earliest* frame that can be used for blending. Any frame from [_requiredFrame, i) can be used, unless its getDisposalMethod() is AnimationDisposalMode.RESTORE_PREVIOUS.

        Returns:
        this.
      • withDuration

        public AnimationFrameInfo withDuration​(int _duration)
        Number of milliseconds to show this frame.
        Returns:
        this.
      • withFullyReceived

        public AnimationFrameInfo withFullyReceived​(boolean _fullyReceived)

        Whether the end marker for this frame is contained in the stream.

        Note: this does not guarantee that an attempt to decode will be complete. There could be an error in the stream.

        Returns:
        this.
      • withAlphaType

        public AnimationFrameInfo withAlphaType​(ColorAlphaType _alphaType)

        This is conservative; it will still return non-opaque if e.g. a color index-based frame has a color with alpha but does not use it.

        Returns:
        this.
      • withHasAlphaWithinBounds

        public AnimationFrameInfo withHasAlphaWithinBounds​(boolean _hasAlphaWithinBounds)

        Whether the updated rectangle contains alpha.

        This is conservative; it will still be set to true if e.g. a color index-based frame has a color with alpha but does not use it. In addition, it may be set to true, even if the final frame, after blending, is opaque.

        Returns:
        this.
      • withBlendMode

        public AnimationFrameInfo withBlendMode​(BlendMode _blendMode)

        How this frame should blend with the prior frame.

        Returns:
        this.
      • withFrameRect

        public AnimationFrameInfo withFrameRect​(io.github.humbleui.types.IRect _frameRect)

        The rectangle updated by this frame.

        It may be empty, if the frame does not change the image. It will always be contained by Codec.getSize().

        Returns:
        this.