Gorgon
Show / Hide Table of Contents

Class GorgonImageCodecPlugIn

A plug in to allow for loading of custom image codecs.

Inheritance
object
GorgonPlugIn
GorgonImageCodecPlugIn
Implements
IGorgonNamedObject
Inherited Members
GorgonPlugIn.Name
GorgonPlugIn.Assembly
GorgonPlugIn.PlugInPath
GorgonPlugIn.Description
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Graphics.Imaging.Codecs
Assembly: Gorgon.Graphics.Imaging.dll
Syntax
public abstract class GorgonImageCodecPlugIn : GorgonPlugIn, IGorgonNamedObject

Constructors

| Edit this page View Source

GorgonImageCodecPlugIn(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 Source

Codecs

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 Source

CreateCodec(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 codec parameter is null.

ArgumentEmptyException

Thrown when the codec parameter is empty.

KeyNotFoundException

Thrown when the codec was not found in this plug in.

| Edit this page View Source

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 codec parameter is null.

ArgumentEmptyException

Thrown when the codec parameter is empty.

KeyNotFoundException

Thrown when the codec was not found in this plug in.

| Edit this page View Source

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 codec parameter is null.

ArgumentEmptyException

Thrown when the codec parameter is empty.

KeyNotFoundException

Thrown when the codec was not found in this plug in.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

Implements

IGorgonNamedObject

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author