public class

CloseableStaticBitmap

extends CloseableBitmap
implements HasBitmap
java.lang.Object
   ↳ com.facebook.imagepipeline.image.CloseableImage
     ↳ com.facebook.imagepipeline.image.CloseableBitmap
       ↳ com.facebook.imagepipeline.image.CloseableStaticBitmap

Class Overview

CloseableImage that contains one Bitmap.

Summary

Public Constructors
CloseableStaticBitmap(Bitmap bitmap, ResourceReleaser<Bitmap> resourceReleaser, QualityInfo qualityInfo, int rotationAngle)
Creates a new instance of a CloseableStaticBitmap.
CloseableStaticBitmap(Bitmap bitmap, ResourceReleaser<Bitmap> resourceReleaser, QualityInfo qualityInfo, int rotationAngle, int exifOrientation)
Creates a new instance of a CloseableStaticBitmap.
CloseableStaticBitmap(CloseableReference<Bitmap> bitmapReference, QualityInfo qualityInfo, int rotationAngle)
Creates a new instance of a CloseableStaticBitmap from an existing CloseableReference.
CloseableStaticBitmap(CloseableReference<Bitmap> bitmapReference, QualityInfo qualityInfo, int rotationAngle, int exifOrientation)
Creates a new instance of a CloseableStaticBitmap from an existing CloseableReference.
Public Methods
synchronized CloseableReference<Bitmap> cloneUnderlyingBitmapReference()
Get a cloned bitmap reference for the underlying original CloseableReference<Bitmap>.
void close()
Releases the bitmap to the pool.
synchronized CloseableReference<Bitmap> convertToBitmapReference()
Convert this object to a CloseableReference<Bitmap>.
int getExifOrientation()
int getHeight()
QualityInfo getQualityInfo()
Returns quality information for the image.
int getRotationAngle()
int getSizeInBytes()
Bitmap getUnderlyingBitmap()
Gets the underlying bitmap.
int getWidth()
synchronized boolean isClosed()
Returns whether this instance is closed.
[Expand]
Inherited Methods
From class com.facebook.imagepipeline.image.CloseableBitmap
From class com.facebook.imagepipeline.image.CloseableImage
From class java.lang.Object
From interface com.facebook.imagepipeline.image.HasImageMetadata
From interface com.facebook.imagepipeline.image.ImageInfo
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public Constructors

public CloseableStaticBitmap (Bitmap bitmap, ResourceReleaser<Bitmap> resourceReleaser, QualityInfo qualityInfo, int rotationAngle)

Creates a new instance of a CloseableStaticBitmap.

Parameters
bitmap the bitmap to wrap
resourceReleaser ResourceReleaser to release the bitmap to

public CloseableStaticBitmap (Bitmap bitmap, ResourceReleaser<Bitmap> resourceReleaser, QualityInfo qualityInfo, int rotationAngle, int exifOrientation)

Creates a new instance of a CloseableStaticBitmap.

Parameters
bitmap the bitmap to wrap
resourceReleaser ResourceReleaser to release the bitmap to

public CloseableStaticBitmap (CloseableReference<Bitmap> bitmapReference, QualityInfo qualityInfo, int rotationAngle)

Creates a new instance of a CloseableStaticBitmap from an existing CloseableReference. The CloseableStaticBitmap will hold a reference to the Bitmap until it's closed.

Parameters
bitmapReference the bitmap reference.

public CloseableStaticBitmap (CloseableReference<Bitmap> bitmapReference, QualityInfo qualityInfo, int rotationAngle, int exifOrientation)

Creates a new instance of a CloseableStaticBitmap from an existing CloseableReference. The CloseableStaticBitmap will hold a reference to the Bitmap until it's closed.

Parameters
bitmapReference the bitmap reference.

Public Methods

public synchronized CloseableReference<Bitmap> cloneUnderlyingBitmapReference ()

Get a cloned bitmap reference for the underlying original CloseableReference<Bitmap>.

After calling this method, this object can still be used. See convertToBitmapReference() for an alternative that detaches the original reference instead.

Returns
  • the cloned bitmap reference without altering this instance or null if already closed

public void close ()

Releases the bitmap to the pool.

public synchronized CloseableReference<Bitmap> convertToBitmapReference ()

Convert this object to a CloseableReference<Bitmap>.

You cannot call this method on an object that has already been closed.

The reference count of the bitmap is preserved. After calling this method, this object can no longer be used and no longer points to the bitmap.

See cloneUnderlyingBitmapReference() for an alternative that returns a cloned bitmap reference instead.

Returns
  • the underlying bitmap reference after being detached from this instance
Throws
IllegalArgumentException if this object has already been closed.

public int getExifOrientation ()

Returns
  • the EXIF orientation of the image

public int getHeight ()

Returns
  • height of the image

public QualityInfo getQualityInfo ()

Returns quality information for the image.

public int getRotationAngle ()

Returns
  • the rotation angle of the image

public int getSizeInBytes ()

Returns
  • size in bytes of the underlying bitmap

public Bitmap getUnderlyingBitmap ()

Gets the underlying bitmap.

Returns
  • the underlying bitmap

public int getWidth ()

Returns
  • width of the image

public synchronized boolean isClosed ()

Returns whether this instance is closed.