getPixelInterpolate method

Color getPixelInterpolate(
  1. num fx,
  2. num fy, {
  3. Interpolation interpolation = Interpolation.linear,
})

Get the pixel using the given interpolation type for non-integer pixel coordinates.

Implementation

Color getPixelInterpolate(num fx, num fy,
    {Interpolation interpolation = Interpolation.linear}) {
  switch (interpolation) {
    case Interpolation.nearest:
      return getPixelSafe(fx.toInt(), fy.toInt());
    case Interpolation.linear:
    case Interpolation.average:
      return getPixelLinear(fx, fy);
    case Interpolation.cubic:
      return getPixelCubic(fx, fy);
  }
}