Click or drag to resize
Accord.NET (logo)

IFilterInformationFormatTranslations Property

Format translations dictionary.

Namespace:  Accord.Imaging.Filters
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.8.0
Syntax
Dictionary<PixelFormat, PixelFormat> FormatTranslations { get; }
Request Example View Source

Property Value

Type: DictionaryPixelFormat, PixelFormat
Remarks

The dictionary defines, which pixel formats are supported for source images and which pixel format will be used for resulting image.

Keys of this dictionary defines all pixel formats which are supported for source images, but corresponding values define what will be resulting pixel format. For example, if value Format16bppGrayScale is put into the dictionary with the Format48bppRgb key, then it means that the filter accepts color 48 bpp image and produces 16 bpp grayscale image as a result of image processing.

The information provided by this property is mostly actual for filters, which can not be applied directly to the source image, but provide new image a result. Since usually all filters implement IFilter interface, the information provided by this property (if filter also implements IFilterInformation interface) may be useful to user to resolve filter's capabilities.

Sample usage:

// get filter's IFilterInformation interface
IFilterInformation info = (IFilterInformation) filter;
// check if the filter supports our image's format
if ( info.FormatTranslations.ContainsKey( image.PixelFormat )
{
    // format is supported, check what will be result of image processing
    PixelFormat resultingFormat = info.FormatTranslations[image.PixelFormat];
}
///
See Also