ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | List of all members
ImageResizer.Plugins.WicEncoder.WicEncoderPlugin Class Reference
Inheritance diagram for ImageResizer.Plugins.WicEncoder.WicEncoderPlugin:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.WicEncoder.WicEncoderPlugin:
Collaboration graph
[legend]

Public Member Functions

Guid GetOutputFormatWicGuid ()
 
 WicEncoderPlugin (ResizeSettings settings, object original)
 
IPlugin Install (Configuration.Config c)
 
bool Uninstall (Configuration.Config c)
 
IEncoder CreateIfSuitable (ResizeSettings settings, object original)
 If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null. More...
 
void Write (System.Drawing.Image i, System.IO.Stream s)
 
void EncodeToStream (IWICComponentFactory factory, IWICBitmapSource data, Size imageSize, IStream outputStream)
 
- Public Member Functions inherited from ImageResizer.Plugins.Basic.DefaultEncoder
 DefaultEncoder (ImageFormat outputFormat)
 
 DefaultEncoder (ImageFormat outputFormat, int jpegQuality)
 
 DefaultEncoder (ResizeSettings settings, object original)
 
bool IsValidOutputFormat (ImageFormat f)
 Returns true if the this encoder supports the specified image format More...
 
void Write (Image image, System.IO.Stream s)
 Writes the specified image to the stream using Quality and OutputFormat More...
 
virtual IEnumerable< string > GetSupportedQuerystringKeys ()
 Returns the querystring keys used by DefaultEncoder (quality, format, and thumbnail) More...
 
IPlugin Install (Configuration.Config c)
 
bool Uninstall (Configuration.Config c)
 
IEnumerable< FileSignatureGetSignatures ()
 Returns signatures for jpeg, bmp, gif, png, wmf, ico, and tif More...
 
- Public Member Functions inherited from ImageResizer.Encoding.IEncoder
void Write (Image i, Stream s)
 Encodes the image to the specified stream More...
 
- Public Member Functions inherited from ImageResizer.Plugins.IPlugin
IPlugin Install (Config c)
 Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. More...
 
bool Uninstall (Config c)
 Uninstalls the plugin. Should reverse all changes made during Install More...
 

Properties

string Subsampling [get, set]
 The Jpeg subsampling. Supported values for WIC are 420, 422, and 444. FreeImage supports 411 in addition to the aforementioned values. More...
 
int Colors [get, set]
 The number of colors to use. Only applicable for png, gif, and bmp photos where palletes can be used. The default is -1, which means "as much color fidelity as possible". More...
 
bool Dither [get, set]
 If true, error-diffusion dithering will be applied to 8-bit output images More...
 
bool Interlace [get, set]
 If true, PNGs will be encoded in interlaced form. More...
 
- Properties inherited from ImageResizer.Plugins.Basic.DefaultEncoder
ImageFormat OutputFormat [get, set]
 If you set this to anything other than Gif, Png, or Jpeg, it will throw an exception. Defaults to Jpeg More...
 
int Quality [get, set]
 0..100 value. The Jpeg compression quality. 90 is the best setting. Not relevant in Png or Gif compression More...
 
bool SupportsTransparency [get]
 Returns true if the desired output type supports transparency. More...
 
string MimeType [get]
 Returns the default mime-type for the OutputFormat More...
 
string Extension [get]
 Returns the default file extesnion for OutputFormat More...
 
- Properties inherited from ImageResizer.Encoding.IEncoder
bool SupportsTransparency [get]
 True if the output format will support transparency as it is currently configured. More...
 
string MimeType [get]
 Returns the appropriate mime-time for the output format as currently configured. More...
 
string Extension [get]
 Returns a file extension appropriate for the output format as currently configured, without a leading dot. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ImageResizer.Plugins.Basic.DefaultEncoder
static ImageFormat GetRequestedFormat (string format, ImageFormat defaultValue)
 Tries to parse an ImageFormat from the settings.Format value. If an unrecogized format is specified, returns null. If an unsupported format is specified, it is returned. If no format is specified, returns defaultValue. More...
 
static ImageFormat GetOriginalFormat (object original)
 Attempts to determine the ImageFormat of the source image. First attempts to parse the path, if a string is present in original.Tag. (or if 'original' is a string) Falls back to using original.RawFormat. Returns null if both 'original' is null. RawFormat has a bad reputation, so this may return unexpected values, like MemoryBitmap or something in some situations. More...
 
static ImageFormat GetImageFormatFromPhysicalPath (string path)
 Returns the ImageFormat enumeration value based on the extension in the specified physical path. Extensions can lie, just a guess. More...
 
static string GetExtensionFromImageFormat (ImageFormat format)
 Returns an string instance from the specfied ImageFormat. First matching entry in imageExtensions is used. Returns null if not recognized. More...
 
static ImageFormat GetImageFormatFromExtension (string ext)
 Returns an ImageFormat instance from the specfied file extension. Extensions lie sometimes, just a guess. returns null if not recognized. More...
 
static void AddImageExtension (string extension, ImageFormat matchingFormat)
 
static string GetContentTypeFromImageFormat (ImageFormat format)
 Supports Png, Jpeg, Gif, Bmp, and Tiff. Throws a ArgumentOutOfRangeException if not png, jpeg, gif, bmp, or tiff More...
 
static ImageCodecInfo GetImageCodeInfo (string mimeType)
 Returns the first ImageCodeInfo instance with the specified mime type. Returns null if there are no matches. More...
 
static void SaveJpeg (Image b, Stream target, int quality)
 Saves the specified image to the specified stream using jpeg compression of the specified quality. More...
 
static void SavePng (Image img, Stream target)
 
static void SaveBmp (Image img, Stream target)
 
static void SaveGif (Image img, Stream target)
 

Detailed Description

Definition at line 16 of file WicEncoder.cs.

Member Function Documentation

IEncoder ImageResizer.Plugins.WicEncoder.WicEncoderPlugin.CreateIfSuitable ( ResizeSettings  settings,
object  original 
)
inline

If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null.

Parameters
settingsRequest settings, like format, quality, colors, dither, etc.
originalMay be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. May also be used for palette generation hinting by some encoders.
Returns

Implements ImageResizer.Encoding.IEncoder.

Definition at line 81 of file WicEncoder.cs.

81  {
82 
83  ImageFormat requestedFormat = DefaultEncoder.GetRequestedFormat(settings.Format, ImageFormat.Jpeg);
84  if (requestedFormat == null || !IsValidOutputFormat(requestedFormat)) return null; //An unsupported format was explicitly specified.
85  if (!"wic".Equals(settings["encoder"], StringComparison.OrdinalIgnoreCase)) return null;
86  return new WicEncoderPlugin(settings, original);
87  }

Property Documentation

int ImageResizer.Plugins.WicEncoder.WicEncoderPlugin.Colors
getset

The number of colors to use. Only applicable for png, gif, and bmp photos where palletes can be used. The default is -1, which means "as much color fidelity as possible".

Definition at line 36 of file WicEncoder.cs.

bool ImageResizer.Plugins.WicEncoder.WicEncoderPlugin.Dither
getset

If true, error-diffusion dithering will be applied to 8-bit output images

Definition at line 41 of file WicEncoder.cs.

bool ImageResizer.Plugins.WicEncoder.WicEncoderPlugin.Interlace
getset

If true, PNGs will be encoded in interlaced form.

Definition at line 46 of file WicEncoder.cs.

string ImageResizer.Plugins.WicEncoder.WicEncoderPlugin.Subsampling
getset

The Jpeg subsampling. Supported values for WIC are 420, 422, and 444. FreeImage supports 411 in addition to the aforementioned values.

Definition at line 29 of file WicEncoder.cs.


The documentation for this class was generated from the following file: