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.
      • createScaledBitmap

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

        public static int getBytesPerPixel​(Bitmap.Config config)
      • 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.
      • setPixels

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

        public void setMutable​(boolean mutable)
      • appendDescription

        public void appendDescription​(String s)
      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String s)
      • setHasAlpha

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

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

        public Bitmap getRealBitmap()
      • setCreatedFromResId

        public void setCreatedFromResId​(int resId,
                                        String description)