Class ShadowBitmap

    • Constructor Detail

      • ShadowBitmap

        public ShadowBitmap()
    • Method Detail

      • visualize

        public static String visualize​(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 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 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 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 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.
      • createBitmap

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

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

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

        @Implementation(minSdk=17)
        protected static Bitmap createBitmap​(DisplayMetrics displayMetrics,
                                             int[] colors,
                                             int offset,
                                             int stride,
                                             int width,
                                             int height,
                                             Bitmap.Config config)
      • createBitmap

        @Implementation
        protected static Bitmap createBitmap​(int[] colors,
                                             int offset,
                                             int stride,
                                             int width,
                                             int height,
                                             Bitmap.Config config)
      • createScaledBitmap

        @Implementation
        protected static Bitmap createScaledBitmap​(Bitmap src,
                                                   int dstWidth,
                                                   int dstHeight,
                                                   boolean filter)
      • setPixels

        @Implementation
        protected void setPixels​(int[] pixels,
                                 int offset,
                                 int stride,
                                 int x,
                                 int y,
                                 int width,
                                 int height)
      • 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()
      • getAllocationByteCount

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

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

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

        @Implementation
        protected final boolean isMutable()
      • setMutable

        public void setMutable​(boolean mutable)
      • appendDescription

        public void appendDescription​(String s)
      • setDescription

        public void setDescription​(String s)
      • getDescription

        public String getDescription()
      • hasAlpha

        @Implementation
        protected final boolean hasAlpha()
      • setHasAlpha

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

        @Implementation
        protected Bitmap extractAlpha()
      • extractAlpha

        @Implementation
        protected Bitmap extractAlpha​(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()
      • getGenerationId

        @Implementation
        protected int getGenerationId()
      • createAshmemBitmap

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

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

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

        @Implementation
        protected static Bitmap nativeCreateFromParcel​(Parcel p)
      • copyPixelsFromBuffer

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

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

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

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

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

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

        public Bitmap getRealBitmap()
      • getBytesPerPixel

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

        public void setCreatedFromResId​(int resId,
                                        String description)