aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Drawing/BaseImageProcessor.cs
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-18 15:33:57 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-18 15:33:57 -0400
commit8b7effd6ff1694688e93d03a48c5dcddb4efe4f0 (patch)
tree28f2e6af0ded4cefa56bd15a963a213359cd852c /MediaBrowser.Controller/Drawing/BaseImageProcessor.cs
parent01a25c48a0c5718c40456c48e311e6c0955f7791 (diff)
Moved discovery of loggers and weather providers to MEF. Also added support for third-party image processors, also discovered through MEF.
Diffstat (limited to 'MediaBrowser.Controller/Drawing/BaseImageProcessor.cs')
-rw-r--r--MediaBrowser.Controller/Drawing/BaseImageProcessor.cs33
1 files changed, 33 insertions, 0 deletions
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
+{
+ /// <summary>
+ /// 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
+ /// </summary>
+ public abstract class BaseImageProcessor
+ {
+ /// <summary>
+ /// Processes the primary image for a BaseEntity (Person, Studio, User, etc)
+ /// </summary>
+ /// <param name="bitmap">The bitmap holding the original image, after re-sizing</param>
+ /// <param name="graphics">The graphics surface on which the output is drawn</param>
+ /// <param name="entity">The entity that owns the image</param>
+ public abstract void ProcessImage(Bitmap bitmap, Graphics graphics, BaseEntity entity);
+
+ /// <summary>
+ /// Processes an image for a BaseItem
+ /// </summary>
+ /// <param name="bitmap">The bitmap holding the original image, after re-sizing</param>
+ /// <param name="graphics">The graphics surface on which the output is drawn</param>
+ /// <param name="entity">The entity that owns the image</param>
+ /// <param name="imageType">The image type</param>
+ /// <param name="imageIndex">The image index (currently only used with backdrops)</param>
+ public abstract void ProcessImage(Bitmap bitmap, Graphics graphics, BaseItem entity, ImageType imageType, int imageIndex);
+ }
+}