Gorgon
Show / Hide Table of Contents

Class GorgonGifEncodingOptions

Options used when decoding an image from a stream as a GIF file.

Inheritance
object
GorgonGifEncodingOptions
Implements
IGorgonWicEncodingOptions
IGorgonImageCodecEncodingOptions
Inherited Members
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 class GorgonGifEncodingOptions : IGorgonWicEncodingOptions, IGorgonImageCodecEncodingOptions

Constructors

| Edit this page View Source

GorgonGifEncodingOptions()

Initializes a new instance of the GorgonGifEncodingOptions class.

Declaration
public GorgonGifEncodingOptions()

Properties

| Edit this page View Source

AlphaThreshold

Property to set or return the alpha threshold percentage for this codec.

Declaration
public float AlphaThreshold { get; set; }
Property Value
Type Description
float
Remarks

Use this to determine what percentage of alpha channel values should be considered transparent for the GIF. A value of 0.5f will mean that colors with an alpha component less than 0.5f will be considered transparent.

This value does not apply to GIF files with multiple frames.

The default value is 0.0f.

| Edit this page View Source

Dithering

Property to set or return the type of ImageDithering to use.

Declaration
public ImageDithering Dithering { get; set; }
Property Value
Type Description
ImageDithering
Remarks

This flag is used to determine which type of dithering algorithm should be used when converting the bit depth for a pixel format to a lower bit depth. If the pixel format of the image is supported natively by the codec, then this value will be ignored.

With dithering applied, the image will visually appear closer to the original by using patterns to simulate a greater number of colors.

For the GorgonCodecGif codec, only the ErrorDiffusion dithering type is supported when there are values assigned to the Palette property.

| Edit this page View Source

DpiX

Property to set or return the horizontal dots-per-inch for the encoded image.

Declaration
public double DpiX { get; set; }
Property Value
Type Description
double
| Edit this page View Source

DpiY

Property to set or return the vertical dots-per-index for the encoded image.

Declaration
public double DpiY { get; set; }
Property Value
Type Description
double
| Edit this page View Source

FrameDelays

Property to set or return a list of delays for a multi-frame GIF file.

Declaration
public IList<int> FrameDelays { get; set; }
Property Value
Type Description
IList<int>
Remarks

This specifies the delay, in 1/100 of a second, between each frame of animation for an animated GIF file. If this value is null, or empty, then no delay will be applied between the animation frames.

This is used when the GIF file is an animated GIF, and its source IGorgonImage uses an array to store frames of animation. For a single frame GIF (i.e. a IGorgonImage with an array count of 1), this value is ignored.

| Edit this page View Source

Options

Property to return the list of options available to the codec.

Declaration
public IGorgonOptionBag Options { get; }
Property Value
Type Description
IGorgonOptionBag
| Edit this page View Source

Palette

Property to set or return a custom color palette to apply to the GIF file.

Declaration
public IList<GorgonColor> Palette { get; set; }
Property Value
Type Description
IList<GorgonColor>
Remarks

Use this to define a new palette for the 8 bit indexed image in the GIF file. This will be used to find a "best fit" set of colors when downsampling from a higher bit depth.

This value is ignored when the GIF file has multiple frames of animation.

The default value is an empty list.

| Edit this page View Source

SaveAllFrames

Property to set or return whether all frames in an image array should be persisted.

Declaration
public bool SaveAllFrames { get; set; }
Property Value
Type Description
bool
Remarks

This flag only applies when the GorgonImage being saved as a GIF file has more than 1 array level.

The default value is true.

Implements

IGorgonWicEncodingOptions
IGorgonImageCodecEncodingOptions

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