flip function

Image flip (
  1. Image src,
  2. Flip mode
)

Flips the src image using the given mode, which can be one of: Flip.horizontal, Flip.vertical, or Flip.both.

Implementation

Image flip(Image src, Flip mode) {
  switch (mode) {
    case Flip.horizontal:
      flipHorizontal(src);
      break;
    case Flip.vertical:
      flipVertical(src);
      break;
    case Flip.both:
      flipVertical(src);
      flipHorizontal(src);
      break;
  }

  return src;
}