-
public class GifOptions
Options controlling various GIF parameters similar to android.graphics.BitmapFactory.Options
-
-
Field Summary
Fields Modifier and Type Field Description char
inSampleSize
boolean
inIsOpaque
-
Constructor Summary
Constructors Constructor Description GifOptions()
-
Method Summary
Modifier and Type Method Description void
setInSampleSize(@IntRange(from = 1, to = Character.MAX_VALUE) int inSampleSize)
If set to a value {@code > 1}
, requests the decoder to subsample the originalframes, returning a smaller frame buffer to save memory.void
setInIsOpaque(boolean inIsOpaque)
Indicates whether the content is opaque. -
-
Method Detail
-
setInSampleSize
void setInSampleSize(@IntRange(from = 1, to = Character.MAX_VALUE) int inSampleSize)
If set to a value
{@code > 1}
, requests the decoder to subsample the originalframes, returning a smaller frame buffer to save memory. The sample size isthe number of pixels in either dimension that correspond to a singlepixel in the decoded bitmap. For example, inSampleSize == 4 returnsan image that is 1/4 the width/height of the original, and 1/16 thenumber of pixels. Values outside range{@code <1, 65635>}
are treated as 1.Unlike inSampleSize values which are not powers of 2 are also supported.Default value is 1.- Parameters:
inSampleSize
- the sample size
-
setInIsOpaque
void setInIsOpaque(boolean inIsOpaque)
Indicates whether the content is opaque. GIF that is known to be opaque cantake a faster drawing case than non-opaque one, since alpha channel processing may be skipped.
Common usage is setting this to true when view where GIF is displayed is known to be non-transparentand its background is irrelevant.In such case even if GIF contains transparent areas,they will appear black.
See also setOpaque.Default value is
{@code false}
, which means that content can be transparent.- Parameters:
inIsOpaque
- whether the content is opaque
-
-
-
-