Class AnimationFrameInfo
- java.lang.Object
-
- io.github.humbleui.skija.AnimationFrameInfo
-
public class AnimationFrameInfo extends java.lang.ObjectInformation about individual frames in a multi-framed image.
-
-
Field Summary
Fields Modifier and Type Field Description ColorAlphaType_alphaTypeThis is conservative; it will still return non-opaque if e.g.BlendMode_blendModeHow this frame should blend with the prior frame.AnimationDisposalMode_disposalMethodHow this frame should be modified before decoding the next one.int_durationNumber of milliseconds to show this frame.io.github.humbleui.types.IRect_frameRectThe rectangle updated by this frame.boolean_fullyReceivedWhether the end marker for this frame is contained in the stream.boolean_hasAlphaWithinBoundsWhether the updated rectangle contains alpha.int_requiredFrameThe 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).
-
Constructor Summary
Constructors Constructor Description AnimationFrameInfo(int requiredFrame, int duration, boolean fullyReceived, int alphaTypeOrdinal, boolean hasAlphaWithinBounds, int disposalMethodOrdinal, int blendModeOrdinal, io.github.humbleui.types.IRect frameRect)AnimationFrameInfo(int requiredFrame, int duration, boolean fullyReceived, ColorAlphaType alphaType, boolean hasAlphaWithinBounds, AnimationDisposalMode disposalMethod, BlendMode blendMode, io.github.humbleui.types.IRect frameRect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)ColorAlphaTypegetAlphaType()This is conservative; it will still return non-opaque if e.g.BlendModegetBlendMode()How this frame should blend with the prior frame.AnimationDisposalModegetDisposalMethod()How this frame should be modified before decoding the next one.intgetDuration()Number of milliseconds to show this frame.io.github.humbleui.types.IRectgetFrameRect()The rectangle updated by this frame.intgetRequiredFrame()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).inthashCode()booleanisFullyReceived()Whether the end marker for this frame is contained in the stream.booleanisHasAlphaWithinBounds()Whether the updated rectangle contains alpha.AnimationFrameInfosetAlphaType(ColorAlphaType _alphaType)This is conservative; it will still return non-opaque if e.g.AnimationFrameInfosetBlendMode(BlendMode _blendMode)How this frame should blend with the prior frame.AnimationFrameInfosetDisposalMethod(AnimationDisposalMode _disposalMethod)How this frame should be modified before decoding the next one.AnimationFrameInfosetDuration(int _duration)Number of milliseconds to show this frame.AnimationFrameInfosetFrameRect(io.github.humbleui.types.IRect _frameRect)The rectangle updated by this frame.AnimationFrameInfosetFullyReceived(boolean _fullyReceived)Whether the end marker for this frame is contained in the stream.AnimationFrameInfosetHasAlphaWithinBounds(boolean _hasAlphaWithinBounds)Whether the updated rectangle contains alpha.AnimationFrameInfosetRequiredFrame(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).java.lang.StringtoString()AnimationFrameInfowithAlphaType(ColorAlphaType _alphaType)This is conservative; it will still return non-opaque if e.g.AnimationFrameInfowithBlendMode(BlendMode _blendMode)How this frame should blend with the prior frame.AnimationFrameInfowithDisposalMethod(AnimationDisposalMode _disposalMethod)How this frame should be modified before decoding the next one.AnimationFrameInfowithDuration(int _duration)Number of milliseconds to show this frame.AnimationFrameInfowithFrameRect(io.github.humbleui.types.IRect _frameRect)The rectangle updated by this frame.AnimationFrameInfowithFullyReceived(boolean _fullyReceived)Whether the end marker for this frame is contained in the stream.AnimationFrameInfowithHasAlphaWithinBounds(boolean _hasAlphaWithinBounds)Whether the updated rectangle contains alpha.AnimationFrameInfowithRequiredFrame(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).
-
-
-
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.
-
setDisposalMethod
public AnimationFrameInfo setDisposalMethod(AnimationDisposalMode _disposalMethod)
How this frame should be modified before decoding the next one.
- 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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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.
-
withDisposalMethod
public AnimationFrameInfo withDisposalMethod(AnimationDisposalMode _disposalMethod)
How this frame should be modified before decoding the next one.
- 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.
-
-