Package com.castlabs.android.utils

# Class ImageUtils

java.lang.Object
com.castlabs.android.utils.ImageUtils

public class ImageUtils extends Object
Image utilities that offers helper functions to decode and scale bitmap images.

Since:
  1.0.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Bitmap`
  `decodeBitmap(byte[] data)`
  Creates a `Bitmap` from teh given data array
  `static Bitmap`
  `downsizeBitmap(byte[] data, int targetWidth)`
  Scale the given bitmap data and return a new, scaled `Bitmap` if target width is specified.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### decodeBitmap

    public static Bitmap decodeBitmap(byte[] data)
    Creates a `Bitmap` from teh given data array
    Parameters:
      `data` - the data array
    Returns:
      the bitmap

  - ### downsizeBitmap

    public static Bitmap downsizeBitmap(byte[] data, int targetWidth)
    Scale the given bitmap data and return a new, scaled `Bitmap` if target width is specified. If no target with is given, the unscaled bitmap is loaded and returned.
    Parameters:
      `data` - the data array
      `targetWidth` - the target width or -1
    Returns:
      the scaled image