From 8b7effd6ff1694688e93d03a48c5dcddb4efe4f0 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Tue, 18 Sep 2012 15:33:57 -0400 Subject: Moved discovery of loggers and weather providers to MEF. Also added support for third-party image processors, also discovered through MEF. --- .../Drawing/BaseImageProcessor.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 MediaBrowser.Controller/Drawing/BaseImageProcessor.cs (limited to 'MediaBrowser.Controller/Drawing/BaseImageProcessor.cs') diff --git a/MediaBrowser.Controller/Drawing/BaseImageProcessor.cs b/MediaBrowser.Controller/Drawing/BaseImageProcessor.cs new file mode 100644 index 000000000..a2b223a70 --- /dev/null +++ b/MediaBrowser.Controller/Drawing/BaseImageProcessor.cs @@ -0,0 +1,33 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Entities; +using System.Drawing; + +namespace MediaBrowser.Controller.Drawing +{ + /// + /// Provides a base image processor class that plugins can use to process images as they are being writen to http responses + /// Since this is completely modular with MEF, a plugin only needs to have a subclass in their assembly with the following attribute on the class: + /// [Export(typeof(BaseImageProcessor))] + /// This will require a reference to System.ComponentModel.Composition + /// + public abstract class BaseImageProcessor + { + /// + /// Processes the primary image for a BaseEntity (Person, Studio, User, etc) + /// + /// The bitmap holding the original image, after re-sizing + /// The graphics surface on which the output is drawn + /// The entity that owns the image + public abstract void ProcessImage(Bitmap bitmap, Graphics graphics, BaseEntity entity); + + /// + /// Processes an image for a BaseItem + /// + /// The bitmap holding the original image, after re-sizing + /// The graphics surface on which the output is drawn + /// The entity that owns the image + /// The image type + /// The image index (currently only used with backdrops) + public abstract void ProcessImage(Bitmap bitmap, Graphics graphics, BaseItem entity, ImageType imageType, int imageIndex); + } +} -- cgit v1.2.3