public static int getPixelSizeForBitmapConfig(Bitmap.Config bitmapConfig) {

    switch (bitmapConfig) {
      case ARGB_8888:
        return ARGB_8888_BYTES_PER_PIXEL;
      case ALPHA_8:
        return ALPHA_8_BYTES_PER_PIXEL;
      case ARGB_4444:
        return ARGB_4444_BYTES_PER_PIXEL;
      case RGB_565:
        return RGB_565_BYTES_PER_PIXEL;
      case RGBA_F16:
        return RGBA_F16_BYTES_PER_PIXEL;
    }
    throw new UnsupportedOperationException("The provided Bitmap.Config is not supported");
  }
public static int getPixelSizeForBitmapConfig ( Bitmap . Config bitmapConfig ) { switch ( bitmapConfig ) { case ARGB_8888 : return ARGB_8888_BYTES_PER_PIXEL ; case ALPHA_8 : return ALPHA_8_BYTES_PER_PIXEL ; case ARGB_4444 : return ARGB_4444_BYTES_PER_PIXEL ; case RGB_565 : return RGB_565_BYTES_PER_PIXEL ; case RGBA_F16 : return RGBA_F16_BYTES_PER_PIXEL ; } throw new UnsupportedOperationException ( "The provided Bitmap.Config is not supported" ) ; }
Returns the amount of bytes used by a pixel in a specific
{@link android.graphics.Bitmap.Config}
@param bitmapConfig the {@link android.graphics.Bitmap.Config} for which the size in byte
will be returned
@return