//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageProcessorCore
{
using Processors;
///
/// Extension methods for the type.
///
public static partial class ImageExtensions
{
///
/// Rotates and flips an image by the given instructions.
///
/// The image to rotate, flip, or both.
/// The to perform the rotation.
/// The to perform the flip.
/// A delegate which is called as progress is made processing the image.
/// The
public static Image RotateFlip(this Image source, RotateType rotateType, FlipType flipType, ProgressEventHandler progressHandler = null)
{
RotateFlip processor = new RotateFlip(rotateType, flipType);
processor.OnProgress += progressHandler;
try
{
return source.Process(source.Width, source.Height, source.Bounds, source.Bounds, processor);
}
finally
{
processor.OnProgress -= progressHandler;
}
}
}
}