Class ShadowBitmap


  • @Implements(android.graphics.Bitmap.class)
    public class ShadowBitmap
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowBitmap()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void appendDescription​(java.lang.String s)  
      protected boolean compress​(android.graphics.Bitmap.CompressFormat format, int quality, java.io.OutputStream stream)  
      protected android.graphics.Bitmap copy​(android.graphics.Bitmap.Config config, boolean isMutable)  
      protected void copyPixelsFromBuffer​(java.nio.Buffer dst)  
      protected void copyPixelsToBuffer​(java.nio.Buffer dst)  
      protected android.graphics.Bitmap createAshmemBitmap()  
      protected static android.graphics.Bitmap createBitmap​(int[] colors, int width, int height, android.graphics.Bitmap.Config config)  
      protected static android.graphics.Bitmap createBitmap​(int width, int height, android.graphics.Bitmap.Config config)  
      protected static android.graphics.Bitmap createBitmap​(android.graphics.Bitmap src)  
      protected static android.graphics.Bitmap createBitmap​(android.graphics.Bitmap src, int x, int y, int width, int height)  
      protected static android.graphics.Bitmap createBitmap​(android.graphics.Bitmap src, int x, int y, int width, int height, android.graphics.Matrix matrix, boolean filter)  
      protected static android.graphics.Bitmap createBitmap​(android.util.DisplayMetrics displayMetrics, int width, int height, android.graphics.Bitmap.Config config)  
      protected static android.graphics.Bitmap createBitmap​(android.util.DisplayMetrics displayMetrics, int width, int height, android.graphics.Bitmap.Config config, boolean hasAlpha)  
      protected static android.graphics.Bitmap createScaledBitmap​(android.graphics.Bitmap src, int dstWidth, int dstHeight, boolean filter)  
      protected void eraseColor​(int color)  
      protected android.graphics.Bitmap extractAlpha()  
      protected android.graphics.Bitmap extractAlpha​(android.graphics.Paint paint, int[] offsetXY)
      This shadow implementation ignores the given paint and offsetXY and simply calls extractAlpha().
      protected int getAllocationByteCount()  
      protected int getByteCount()  
      static int getBytesPerPixel​(android.graphics.Bitmap.Config config)  
      protected android.graphics.Bitmap.Config getConfig()  
      android.graphics.Bitmap getCreatedFromBitmap()
      Reference to original Bitmap from which this Bitmap was created.
      byte[] getCreatedFromBytes()
      Bytes from which this Bitmap was created.
      int[] getCreatedFromColors()
      Color array from which this Bitmap was created.
      boolean getCreatedFromFilter()
      true if this Bitmap was created with filtering.
      int getCreatedFromHeight()
      Height from getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's content, or -1.
      android.graphics.Matrix getCreatedFromMatrix()
      Matrix from which this Bitmap's content was transformed, or null.
      java.lang.String getCreatedFromPath()
      Path from which this Bitmap was created.
      int getCreatedFromResId()
      Resource ID from which this Bitmap was created.
      java.io.InputStream getCreatedFromStream()
      InputStream from which this Bitmap was created.
      int getCreatedFromWidth()
      Width from getCreatedFromX() within getCreatedFromBitmap() of this Bitmap's content, or -1.
      int getCreatedFromX()
      Horizontal offset within getCreatedFromBitmap() of this Bitmap's content, or -1.
      int getCreatedFromY()
      Vertical offset within getCreatedFromBitmap() of this Bitmap's content, or -1.
      protected int getDensity()  
      java.lang.String getDescription()  
      protected int getGenerationId()  
      protected int getHeight()  
      protected int getPixel​(int x, int y)  
      protected void getPixels​(int[] pixels, int offset, int stride, int x, int y, int width, int height)
      Note that this method will return a RuntimeException unless: - pixels has the same length as the number of pixels of the bitmap.
      android.graphics.Bitmap getRealBitmap()  
      protected int getRowBytes()  
      protected int getWidth()  
      protected boolean hasAlpha()  
      protected boolean hasMipMap()  
      protected boolean isMutable()  
      protected boolean isPremultiplied()  
      protected boolean isRecycled()  
      protected static android.graphics.Bitmap nativeCreateFromParcel​(android.os.Parcel p)  
      protected void reconfigure​(int width, int height, android.graphics.Bitmap.Config config)  
      protected void recycle()  
      protected boolean sameAs​(android.graphics.Bitmap other)  
      protected void setConfig​(android.graphics.Bitmap.Config config)  
      void setCreatedFromResId​(int resId, java.lang.String description)  
      protected void setDensity​(int density)  
      void setDescription​(java.lang.String s)  
      protected void setHasAlpha​(boolean hasAlpha)  
      protected void setHasMipMap​(boolean hasMipMap)  
      protected void setHeight​(int height)  
      void setMutable​(boolean mutable)  
      protected void setPixel​(int x, int y, int color)  
      protected void setPixels​(int[] pixels, int offset, int stride, int x, int y, int width, int height)  
      protected void setPremultiplied​(boolean isPremultiplied)  
      protected void setWidth​(int width)  
      static java.lang.String visualize​(android.graphics.Bitmap bitmap)
      Returns a textual representation of the appearance of the object.
      protected void writeToParcel​(android.os.Parcel p, int flags)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowBitmap

        public ShadowBitmap()
    • Method Detail

      • visualize

        public static java.lang.String visualize​(android.graphics.Bitmap bitmap)
        Returns a textual representation of the appearance of the object.
        Parameters:
        bitmap - the bitmap to visualize
        Returns:
        Textual representation of the appearance of the object.
      • getCreatedFromBitmap

        public android.graphics.Bitmap getCreatedFromBitmap()
        Reference to original Bitmap from which this Bitmap was created. null if this Bitmap was not copied from another instance.
        Returns:
        Original Bitmap from which this Bitmap was created.
      • getCreatedFromResId

        public int getCreatedFromResId()
        Resource ID from which this Bitmap was created. 0 if this Bitmap was not created from a resource.
        Returns:
        Resource ID from which this Bitmap was created.
      • getCreatedFromPath

        public java.lang.String getCreatedFromPath()
        Path from which this Bitmap was created. null if this Bitmap was not create from a path.
        Returns:
        Path from which this Bitmap was created.
      • getCreatedFromStream

        public java.io.InputStream getCreatedFromStream()
        InputStream from which this Bitmap was created. null if this Bitmap was not created from a stream.
        Returns:
        InputStream from which this Bitmap was created.
      • getCreatedFromBytes

        public byte[] getCreatedFromBytes()
        Bytes from which this Bitmap was created. null if this Bitmap was not created from bytes.
        Returns:
        Bytes from which this Bitmap was created.
      • getCreatedFromColors

        public int[] getCreatedFromColors()
        Color array from which this Bitmap was created. null if this Bitmap was not created from a color array.
        Returns:
        Color array from which this Bitmap was created.
      • getCreatedFromMatrix

        public android.graphics.Matrix getCreatedFromMatrix()
        Matrix from which this Bitmap's content was transformed, or null.
        Returns:
        Matrix from which this Bitmap's content was transformed, or null.
      • getCreatedFromFilter

        public boolean getCreatedFromFilter()
        true if this Bitmap was created with filtering.
        Returns:
        true if this Bitmap was created with filtering.
      • compress

        @Implementation
        protected boolean compress​(android.graphics.Bitmap.CompressFormat format,
                                   int quality,
                                   java.io.OutputStream stream)
      • createBitmap

        @Implementation
        protected static android.graphics.Bitmap createBitmap​(int width,
                                                              int height,
                                                              android.graphics.Bitmap.Config config)
      • createBitmap

        @Implementation(minSdk=17)
        protected static android.graphics.Bitmap createBitmap​(android.util.DisplayMetrics displayMetrics,
                                                              int width,
                                                              int height,
                                                              android.graphics.Bitmap.Config config,
                                                              boolean hasAlpha)
      • createBitmap

        @Implementation(minSdk=17)
        protected static android.graphics.Bitmap createBitmap​(android.util.DisplayMetrics displayMetrics,
                                                              int width,
                                                              int height,
                                                              android.graphics.Bitmap.Config config)
      • createBitmap

        @Implementation
        protected static android.graphics.Bitmap createBitmap​(android.graphics.Bitmap src)
      • createScaledBitmap

        @Implementation
        protected static android.graphics.Bitmap createScaledBitmap​(android.graphics.Bitmap src,
                                                                    int dstWidth,
                                                                    int dstHeight,
                                                                    boolean filter)
      • createBitmap

        @Implementation
        protected static android.graphics.Bitmap createBitmap​(android.graphics.Bitmap src,
                                                              int x,
                                                              int y,
                                                              int width,
                                                              int height)
      • setPixels

        @Implementation
        protected void setPixels​(int[] pixels,
                                 int offset,
                                 int stride,
                                 int x,
                                 int y,
                                 int width,
                                 int height)
      • createBitmap

        @Implementation
        protected static android.graphics.Bitmap createBitmap​(android.graphics.Bitmap src,
                                                              int x,
                                                              int y,
                                                              int width,
                                                              int height,
                                                              android.graphics.Matrix matrix,
                                                              boolean filter)
      • createBitmap

        @Implementation
        protected static android.graphics.Bitmap createBitmap​(int[] colors,
                                                              int width,
                                                              int height,
                                                              android.graphics.Bitmap.Config config)
      • getPixel

        @Implementation
        protected int getPixel​(int x,
                               int y)
      • setPixel

        @Implementation
        protected void setPixel​(int x,
                                int y,
                                int color)
      • getPixels

        @Implementation
        protected void getPixels​(int[] pixels,
                                 int offset,
                                 int stride,
                                 int x,
                                 int y,
                                 int width,
                                 int height)
        Note that this method will return a RuntimeException unless: - pixels has the same length as the number of pixels of the bitmap. - x = 0 - y = 0 - width and height height match the current bitmap's dimensions.
      • getRowBytes

        @Implementation
        protected int getRowBytes()
      • getByteCount

        @Implementation
        protected int getByteCount()
      • recycle

        @Implementation
        protected void recycle()
      • isRecycled

        @Implementation
        protected final boolean isRecycled()
      • copy

        @Implementation
        protected android.graphics.Bitmap copy​(android.graphics.Bitmap.Config config,
                                               boolean isMutable)
      • getAllocationByteCount

        @Implementation(minSdk=19)
        protected final int getAllocationByteCount()
      • getConfig

        @Implementation
        protected final android.graphics.Bitmap.Config getConfig()
      • setConfig

        @Implementation(minSdk=19)
        protected void setConfig​(android.graphics.Bitmap.Config config)
      • isMutable

        @Implementation
        protected final boolean isMutable()
      • setMutable

        public void setMutable​(boolean mutable)
      • appendDescription

        public void appendDescription​(java.lang.String s)
      • setDescription

        public void setDescription​(java.lang.String s)
      • getDescription

        public java.lang.String getDescription()
      • hasAlpha

        @Implementation
        protected final boolean hasAlpha()
      • setHasAlpha

        @Implementation
        protected void setHasAlpha​(boolean hasAlpha)
      • extractAlpha

        @Implementation
        protected android.graphics.Bitmap extractAlpha()
      • extractAlpha

        @Implementation
        protected android.graphics.Bitmap extractAlpha​(android.graphics.Paint paint,
                                                       int[] offsetXY)
        This shadow implementation ignores the given paint and offsetXY and simply calls extractAlpha().
      • hasMipMap

        @Implementation(minSdk=17)
        protected final boolean hasMipMap()
      • setHasMipMap

        @Implementation(minSdk=17)
        protected final void setHasMipMap​(boolean hasMipMap)
      • setWidth

        @Implementation(minSdk=19)
        protected void setWidth​(int width)
      • getWidth

        @Implementation
        protected int getWidth()
      • setHeight

        @Implementation(minSdk=19)
        protected void setHeight​(int height)
      • getHeight

        @Implementation
        protected int getHeight()
      • setDensity

        @Implementation
        protected void setDensity​(int density)
      • getDensity

        @Implementation
        protected int getDensity()
      • getGenerationId

        @Implementation
        protected int getGenerationId()
      • createAshmemBitmap

        @Implementation(minSdk=23)
        protected android.graphics.Bitmap createAshmemBitmap()
      • eraseColor

        @Implementation
        protected void eraseColor​(int color)
      • writeToParcel

        @Implementation
        protected void writeToParcel​(android.os.Parcel p,
                                     int flags)
      • nativeCreateFromParcel

        @Implementation
        protected static android.graphics.Bitmap nativeCreateFromParcel​(android.os.Parcel p)
      • copyPixelsFromBuffer

        @Implementation
        protected void copyPixelsFromBuffer​(java.nio.Buffer dst)
      • copyPixelsToBuffer

        @Implementation
        protected void copyPixelsToBuffer​(java.nio.Buffer dst)
      • reconfigure

        @Implementation(minSdk=19)
        protected void reconfigure​(int width,
                                   int height,
                                   android.graphics.Bitmap.Config config)
      • setPremultiplied

        @Implementation(minSdk=19)
        protected void setPremultiplied​(boolean isPremultiplied)
      • isPremultiplied

        @Implementation(minSdk=19)
        protected boolean isPremultiplied()
      • sameAs

        @Implementation
        protected boolean sameAs​(android.graphics.Bitmap other)
      • getRealBitmap

        public android.graphics.Bitmap getRealBitmap()
      • getBytesPerPixel

        public static int getBytesPerPixel​(android.graphics.Bitmap.Config config)
      • setCreatedFromResId

        public void setCreatedFromResId​(int resId,
                                        java.lang.String description)