encode static method

Future<String> encode(
  1. ImageProvider<Object> imageProvider, {
  2. int componentX = 4,
  3. int componentY = 3,
})

Implementation

static Future<String> encode(
  ImageProvider imageProvider, {
  int componentX = 4,
  int componentY = 3,
}) async {
  try {
    final BlurHashImageInfo info =
        await _instance._getImageInfoFromImageProvider(imageProvider);
    return _instance._encodeBlurHash(info, componentX, componentY);
  } catch (e) {
    throw BlurhashFFIException(
        'Could not encode Image', StackTrace.current, e);
  }
}