public static ImageOptions.Builder createImageOptions(
      final Context context, final Config config) {
    FrescoSystrace.beginSection("VitoUtil#createVitoHierarchy");
    ImageOptions.Builder builder =
        ImageOptions.create()
            .fadeDurationMs(config.fadeDurationMs)
            .placeholderColor(Const.PLACEHOLDER_COLOR)
            .errorColor(Const.FAILURE_COLOR)
            .scale(ScalingUtils.ScaleType.FIT_CENTER);
    applyScaleType(builder, config);

    if (config.useRoundedCorners || config.drawBorder) {
      final Resources res = context.getResources();

      if (config.useRoundedCorners) {
        if (config.useRoundedAsCircle) {
          builder.round(RoundingOptions.asCircle());
        } else {
          builder.round(
              RoundingOptions.forCornerRadiusPx(
                  res.getDimensionPixelSize(R.dimen.vito_corner_radius)));
        }
      }

      if (config.drawBorder) {
        builder.borders(
            BorderOptions.create(
                res.getColor(R.color.colorPrimary),
                res.getDimensionPixelSize(R.dimen.vito_border_width)));
      }
    }
    FrescoSystrace.endSection();
    return builder;
  }
Creates the Hierarchy using the information into the Config

@param context The Context
@param config The Config object
@return The Hierarchy to use
samples/scrollperf/src/main/java/com/facebook/samples/scrollperf/util/VitoUtil.java