2015-04-09 07:20:23 +02:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-02-23 01:44:20 +01:00
|
|
|
|
using MediaBrowser.Model.Drawing;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
|
|
|
|
public interface IImageEnhancer
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Return true only if the given image for the given item will be enhanced by this enhancer.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="imageType">Type of the image.</param>
|
|
|
|
|
/// <returns><c>true</c> if this enhancer will enhance the supplied image for the supplied item, <c>false</c> otherwise</returns>
|
2017-08-07 23:06:13 +02:00
|
|
|
|
bool Supports(IHasMetadata item, ImageType imageType);
|
2013-02-23 01:44:20 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the priority or order in which this enhancer should be run.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The priority.</value>
|
|
|
|
|
MetadataProviderPriority Priority { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2013-05-23 17:45:13 +02:00
|
|
|
|
/// Return a key incorporating all configuration information related to this item
|
2013-02-23 01:44:20 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="imageType">Type of the image.</param>
|
2013-05-23 17:45:13 +02:00
|
|
|
|
/// <returns>Cache key relating to the current state of this item and configuration</returns>
|
2017-08-07 23:06:13 +02:00
|
|
|
|
string GetConfigurationCacheKey(IHasMetadata item, ImageType imageType);
|
2013-02-23 01:44:20 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the size of the enhanced image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="imageType">Type of the image.</param>
|
|
|
|
|
/// <param name="imageIndex">Index of the image.</param>
|
|
|
|
|
/// <param name="originalImageSize">Size of the original image.</param>
|
|
|
|
|
/// <returns>ImageSize.</returns>
|
2017-08-07 23:06:13 +02:00
|
|
|
|
ImageSize GetEnhancedImageSize(IHasMetadata item, ImageType imageType, int imageIndex, ImageSize originalImageSize);
|
2013-02-23 01:44:20 +01:00
|
|
|
|
|
2017-09-07 20:17:18 +02:00
|
|
|
|
EnhancedImageInfo GetEnhancedImageInfo(IHasMetadata item, string inputFile, ImageType imageType, int imageIndex);
|
|
|
|
|
|
2013-02-23 01:44:20 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Enhances the image async.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2015-02-20 03:12:33 +01:00
|
|
|
|
/// <param name="inputFile">The input file.</param>
|
|
|
|
|
/// <param name="outputFile">The output file.</param>
|
2013-02-23 01:44:20 +01:00
|
|
|
|
/// <param name="imageType">Type of the image.</param>
|
|
|
|
|
/// <param name="imageIndex">Index of the image.</param>
|
|
|
|
|
/// <returns>Task{Image}.</returns>
|
|
|
|
|
/// <exception cref="System.ArgumentNullException"></exception>
|
2017-08-07 23:06:13 +02:00
|
|
|
|
Task EnhanceImageAsync(IHasMetadata item, string inputFile, string outputFile, ImageType imageType, int imageIndex);
|
2013-02-23 01:44:20 +01:00
|
|
|
|
}
|
2017-09-07 20:17:18 +02:00
|
|
|
|
|
|
|
|
|
public class EnhancedImageInfo
|
|
|
|
|
{
|
|
|
|
|
public bool RequiresTransparency { get; set; }
|
|
|
|
|
}
|
2013-02-23 01:44:20 +01:00
|
|
|
|
}
|