Class GorgonImageCodecPlugIn
A plug in to allow for loading of custom image codecs.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Imaging.Codecs
Assembly: Gorgon.Graphics.Imaging.dll
Syntax
public abstract class GorgonImageCodecPlugIn : GorgonPlugIn, IGorgonNamedObject
Constructors
| Edit this page View SourceGorgonImageCodecPlugIn(string)
Initializes a new instance of the GorgonImageCodecPlugIn class.
Declaration
protected GorgonImageCodecPlugIn(string description)
Parameters
Type | Name | Description |
---|---|---|
string | description | Optional description of the plug in. |
Remarks
Objects that implement this base class should pass in a hard coded description on the base constructor.
Properties
| Edit this page View SourceCodecs
Property to return the names of the available codecs for this plug in.
Declaration
public abstract IReadOnlyList<GorgonImageCodecDescription> Codecs { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<GorgonImageCodecDescription> |
Remarks
This returns a IReadOnlyDictionary<TKey, TValue> containing the name of the plug in as its key, and an optional friendly description as its value.
Methods
| Edit this page View SourceCreateCodec(string)
Function to create a new image codec object.
Declaration
public IGorgonImageCodec CreateCodec(string codec)
Parameters
Type | Name | Description |
---|---|---|
string | codec | The name of the codec to look up within the plug in. |
Returns
Type | Description |
---|---|
IGorgonImageCodec | A new instance of a IGorgonImageCodec. |
Remarks
If the codec
is not found within the plug in, then an exception will be thrown. To determine whether the plug in has the desired codec
, check the
Codecs property on the plug in to locate the plug in name.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown when the |
CreateDecodingOptions(string)
Function to create a new codec decoding options object for the specified codec.
Declaration
public IGorgonImageCodecDecodingOptions CreateDecodingOptions(string codec)
Parameters
Type | Name | Description |
---|---|---|
string | codec | The name of the codec to which the options will apply. |
Returns
Type | Description |
---|---|
IGorgonImageCodecDecodingOptions | A new instance of a IGorgonImageCodecDecodingOptions object. |
Remarks
If the requested codec
has no decoding options, then this method will return null.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown when the |
CreateEncodingOptions(string)
Function to create a new codec encoding options object for the specified codec.
Declaration
public IGorgonImageCodecEncodingOptions CreateEncodingOptions(string codec)
Parameters
Type | Name | Description |
---|---|---|
string | codec | The name of the codec to which the options will apply. |
Returns
Type | Description |
---|---|
IGorgonImageCodecEncodingOptions | A new instance of a IGorgonImageCodecEncodingOptions object. |
Remarks
If the requested codec
has no encoding options, then this method will return null.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentEmptyException | Thrown when the |
KeyNotFoundException | Thrown when the |
OnCreateCodec(string)
Function to create a new IGorgonImageCodec.
Declaration
protected abstract IGorgonImageCodec OnCreateCodec(string codec)
Parameters
Type | Name | Description |
---|---|---|
string | codec | The codec to retrieve from the plug in. |
Returns
Type | Description |
---|---|
IGorgonImageCodec | A new IGorgonImageCodec object. |
Remarks
Implementors must implement this method to return the codec from the plug in assembly.
OnCreateCodecDecodingOptions(string)
Function to create image decoding options for the codec.
Declaration
protected abstract IGorgonImageCodecDecodingOptions OnCreateCodecDecodingOptions(string codec)
Parameters
Type | Name | Description |
---|---|---|
string | codec | The name of the codec to which the options will apply. |
Returns
Type | Description |
---|---|
IGorgonImageCodecDecodingOptions | A new IGorgonImageCodecDecodingOptions object. |
Remarks
Implementors must implement this method to return any optional decoding options for the codec to use when decoding data. If no decoding options apply to the codec, then this method should return null.
OnCreateCodecEncodingOptions(string)
Function to create image encoding options for the codec.
Declaration
protected abstract IGorgonImageCodecEncodingOptions OnCreateCodecEncodingOptions(string codec)
Parameters
Type | Name | Description |
---|---|---|
string | codec | The name of the codec to which the options will apply. |
Returns
Type | Description |
---|---|
IGorgonImageCodecEncodingOptions | A new IGorgonImageCodecEncodingOptions object. |
Remarks
Implementors must implement this method to return any optional encoding options for the codec to use when encoding data. If no encoding options apply to the codec, then this method should return null.