• Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • SixLabors.ImageSharp
      • Color
      • ColorMatrix
      • Configuration
      • DenseMatrix<T>
      • GeometryUtilities
      • GraphicOptionsDefaultsExtensions
      • GraphicsOptions
      • IConfigurationModule
      • IDeepCloneable
      • IDeepCloneable<T>
      • IImage
      • IImageInfo
      • Image
      • Image<TPixel>
      • ImageExtensions
      • ImageFormatException
      • ImageFrame
      • ImageFrame<TPixel>
      • ImageFrameCollection
      • ImageFrameCollection<TPixel>
      • ImageInfoExtensions
      • ImageProcessingException
      • IndexedImageFrame<TPixel>
      • InvalidImageContentException
      • Matrix3x2Extensions
      • MetadataExtensions
      • Number
      • Point
      • PointF
      • Rational
      • ReadOrigin
      • Rectangle
      • RectangleF
      • SignedRational
      • Size
      • SizeF
      • UnknownImageFormatException
    • SixLabors.ImageSharp.Advanced
      • AdvancedImageExtensions
      • IImageVisitor
      • IImageVisitorAsync
      • IRowIntervalOperation
      • IRowIntervalOperation<TBuffer>
      • IRowOperation
      • IRowOperation<TBuffer>
      • ParallelExecutionSettings
      • ParallelRowIterator
    • SixLabors.ImageSharp.ColorSpaces
      • CieLab
      • CieLch
      • CieLchuv
      • CieLuv
      • CieXyy
      • CieXyz
      • Cmyk
      • Hsl
      • Hsv
      • HunterLab
      • Illuminants
      • LinearRgb
      • Lms
      • Rgb
      • RgbWorkingSpaces
      • YCbCr
    • SixLabors.ImageSharp.ColorSpaces.Companding
      • GammaCompanding
      • LCompanding
      • Rec2020Companding
      • Rec709Companding
      • SRgbCompanding
    • SixLabors.ImageSharp.ColorSpaces.Conversion
      • CieXyChromaticityCoordinates
      • ColorSpaceConverter
      • ColorSpaceConverterOptions
      • GammaWorkingSpace
      • IChromaticAdaptation
      • LmsAdaptationMatrix
      • LWorkingSpace
      • Rec2020WorkingSpace
      • Rec709WorkingSpace
      • RgbPrimariesChromaticityCoordinates
      • RgbWorkingSpace
      • SRgbWorkingSpace
      • VonKriesChromaticAdaptation
    • SixLabors.ImageSharp.Formats
      • IImageDecoder
      • IImageEncoder
      • IImageFormat
      • IImageFormat<TFormatMetadata, TFormatFrameMetadata>
      • IImageFormat<TFormatMetadata>
      • IImageFormatDetector
      • IImageInfoDetector
      • ImageFormatManager
      • PixelTypeInfo
    • SixLabors.ImageSharp.Formats.Bmp
      • BmpBitsPerPixel
      • BmpConfigurationModule
      • BmpDecoder
      • BmpEncoder
      • BmpFileMarkerType
      • BmpFormat
      • BmpImageFormatDetector
      • BmpInfoHeaderType
      • BmpMetadata
      • RleSkippedPixelHandling
    • SixLabors.ImageSharp.Formats.Gif
      • GifColorTableMode
      • GifConfigurationModule
      • GifDecoder
      • GifDisposalMethod
      • GifEncoder
      • GifFormat
      • GifFrameMetadata
      • GifImageFormatDetector
      • GifMetadata
      • IGifExtension
    • SixLabors.ImageSharp.Formats.Jpeg
      • JpegConfigurationModule
      • JpegDecoder
      • JpegEncoder
      • JpegFormat
      • JpegImageFormatDetector
      • JpegMetadata
      • JpegSubsample
    • SixLabors.ImageSharp.Formats.Png
      • PngBitDepth
      • PngChunkFilter
      • PngColorType
      • PngCompressionLevel
      • PngConfigurationModule
      • PngDecoder
      • PngEncoder
      • PngFilterMethod
      • PngFormat
      • PngImageFormatDetector
      • PngInterlaceMode
      • PngMetadata
      • PngTextData
      • PngTransparentColorMode
    • SixLabors.ImageSharp.Formats.Tga
      • TgaBitsPerPixel
      • TgaCompression
      • TgaConfigurationModule
      • TgaDecoder
      • TgaEncoder
      • TgaFormat
      • TgaImageFormatDetector
      • TgaImageType
      • TgaImageTypeExtensions
      • TgaMetadata
    • SixLabors.ImageSharp.Memory
      • AllocationOptions
      • ArrayPoolMemoryAllocator
      • Buffer2D<T>
      • Buffer2DExtensions
      • Buffer2DRegion<T>
      • IManagedByteBuffer
      • IMemoryGroup<T>
      • InvalidMemoryOperationException
      • MemoryAllocator
      • MemoryAllocatorExtensions
      • RowInterval
      • SimpleGcMemoryAllocator
    • SixLabors.ImageSharp.Metadata
      • FrameDecodingMode
      • ImageFrameMetadata
      • ImageMetadata
      • PixelResolutionUnit
    • SixLabors.ImageSharp.Metadata.Profiles.Exif
      • ExifDataType
      • ExifParts
      • ExifProfile
      • ExifTag
      • ExifTag<TValueType>
      • IExifValue
      • IExifValue<TValueType>
    • SixLabors.ImageSharp.Metadata.Profiles.Icc
      • IccColorSpaceType
      • IccDeviceAttribute
      • IccPrimaryPlatformType
      • IccProfile
      • IccProfileClass
      • IccProfileFlag
      • IccProfileHeader
      • IccProfileId
      • IccProfileTag
      • IccRenderingIntent
      • IccTagDataEntry
      • IccTypeSignature
      • IccVersion
      • InvalidIccProfileException
    • SixLabors.ImageSharp.Metadata.Profiles.Iptc
      • IptcProfile
      • IptcTag
      • IptcTagExtensions
      • IptcValue
    • SixLabors.ImageSharp.PixelFormats
      • A8
      • Argb32
      • Bgr24
      • Bgr565
      • Bgra32
      • Bgra4444
      • Bgra5551
      • Byte4
      • HalfSingle
      • HalfVector2
      • HalfVector4
      • IPackedVector<TPacked>
      • IPixel
      • IPixel<TSelf>
      • L16
      • L8
      • La16
      • La32
      • NormalizedByte2
      • NormalizedByte4
      • NormalizedShort2
      • NormalizedShort4
      • PixelAlphaCompositionMode
      • PixelAlphaRepresentation
      • PixelBlender<TPixel>
      • PixelColorBlendingMode
      • PixelConversionModifiers
      • PixelOperations<TPixel>
      • Rg32
      • Rgb24
      • Rgb48
      • Rgba1010102
      • Rgba32
      • Rgba64
      • RgbaVector
      • Short2
      • Short4
    • SixLabors.ImageSharp.Processing
      • AdaptiveThresholdExtensions
      • AffineTransformBuilder
      • AnchorPositionMode
      • AutoOrientExtensions
      • BackgroundColorExtensions
      • BinaryDitherExtensions
      • BinaryThresholdExtensions
      • BinaryThresholdMode
      • BlackWhiteExtensions
      • BokehBlurExtensions
      • BoxBlurExtensions
      • BrightnessExtensions
      • ColorBlindnessExtensions
      • ColorBlindnessMode
      • ContrastExtensions
      • CropExtensions
      • DetectEdgesExtensions
      • DitherExtensions
      • DrawImageExtensions
      • EntropyCropExtensions
      • FilterExtensions
      • FlipExtensions
      • FlipMode
      • GaussianBlurExtensions
      • GaussianSharpenExtensions
      • GlowExtensions
      • GrayscaleExtensions
      • GrayscaleMode
      • HistogramEqualizationExtensions
      • HueExtensions
      • IImageProcessingContext
      • InvertExtensions
      • KnownDitherings
      • KnownEdgeDetectorKernels
      • KnownFilterMatrices
      • KnownQuantizers
      • KnownResamplers
      • KodachromeExtensions
      • LightnessExtensions
      • LomographExtensions
      • OilPaintExtensions
      • OpacityExtensions
      • PadExtensions
      • PixelateExtensions
      • PixelRowDelegateExtensions
      • PixelRowOperation
      • PixelRowOperation<T>
      • PolaroidExtensions
      • ProcessingExtensions
      • ProjectiveTransformBuilder
      • QuantizeExtensions
      • ResizeExtensions
      • ResizeMode
      • ResizeOptions
      • RotateExtensions
      • RotateFlipExtensions
      • RotateMode
      • SaturateExtensions
      • SepiaExtensions
      • SkewExtensions
      • TaperCorner
      • TaperSide
      • TransformExtensions
      • VignetteExtensions
    • SixLabors.ImageSharp.Processing.Extensions.Transforms
      • SwizzleExtensions
    • SixLabors.ImageSharp.Processing.Processors
      • CloningImageProcessor
      • CloningImageProcessor<TPixel>
      • ICloningImageProcessor
      • ICloningImageProcessor<TPixel>
      • IImageProcessor
      • IImageProcessor<TPixel>
      • ImageProcessor<TPixel>
    • SixLabors.ImageSharp.Processing.Processors.Binarization
      • AdaptiveThresholdProcessor
      • BinaryThresholdProcessor
    • SixLabors.ImageSharp.Processing.Processors.Convolution
      • BokehBlurProcessor
      • BoxBlurProcessor
      • EdgeDetector2DKernel
      • EdgeDetector2DProcessor
      • EdgeDetectorCompassKernel
      • EdgeDetectorCompassProcessor
      • EdgeDetectorKernel
      • EdgeDetectorProcessor
      • GaussianBlurProcessor
      • GaussianSharpenProcessor
    • SixLabors.ImageSharp.Processing.Processors.Dithering
      • ErrorDither
      • IDither
      • IPaletteDitherImageProcessor<TPixel>
      • OrderedDither
      • PaletteDitherProcessor
    • SixLabors.ImageSharp.Processing.Processors.Drawing
      • DrawImageProcessor
    • SixLabors.ImageSharp.Processing.Processors.Effects
      • IPixelRowDelegate
      • OilPaintingProcessor
      • PixelateProcessor
    • SixLabors.ImageSharp.Processing.Processors.Filters
      • AchromatomalyProcessor
      • AchromatopsiaProcessor
      • BlackWhiteProcessor
      • BrightnessProcessor
      • ContrastProcessor
      • DeuteranomalyProcessor
      • DeuteranopiaProcessor
      • FilterProcessor
      • GrayscaleBt601Processor
      • GrayscaleBt709Processor
      • HueProcessor
      • InvertProcessor
      • KodachromeProcessor
      • LightnessProcessor
      • LomographProcessor
      • OpacityProcessor
      • PolaroidProcessor
      • ProtanomalyProcessor
      • ProtanopiaProcessor
      • SaturateProcessor
      • SepiaProcessor
      • TritanomalyProcessor
      • TritanopiaProcessor
    • SixLabors.ImageSharp.Processing.Processors.Normalization
      • AdaptiveHistogramEqualizationProcessor
      • AdaptiveHistogramEqualizationSlidingWindowProcessor
      • GlobalHistogramEqualizationProcessor
      • HistogramEqualizationMethod
      • HistogramEqualizationOptions
      • HistogramEqualizationProcessor
    • SixLabors.ImageSharp.Processing.Processors.Overlays
      • BackgroundColorProcessor
      • GlowProcessor
      • VignetteProcessor
    • SixLabors.ImageSharp.Processing.Processors.Quantization
      • DefaultPixelSamplingStrategy
      • ExtensivePixelSamplingStrategy
      • IPixelSamplingStrategy
      • IQuantizer
      • IQuantizer<TPixel>
      • OctreeQuantizer
      • OctreeQuantizer<TPixel>
      • PaletteQuantizer
      • QuantizeProcessor
      • QuantizerConstants
      • QuantizerOptions
      • QuantizerUtilities
      • WebSafePaletteQuantizer
      • WernerPaletteQuantizer
      • WuQuantizer
    • SixLabors.ImageSharp.Processing.Processors.Transforms
      • AffineTransformProcessor
      • AutoOrientProcessor
      • BicubicResampler
      • BoxResampler
      • CropProcessor
      • CubicResampler
      • DegenerateTransformException
      • EntropyCropProcessor
      • FlipProcessor
      • IResampler
      • IResamplingTransformImageProcessor<TPixel>
      • ISwizzler
      • LanczosResampler
      • NearestNeighborResampler
      • ProjectiveTransformProcessor
      • ResizeProcessor
      • RotateProcessor
      • SkewProcessor
      • SwizzleProcessor<TSwizzler>
      • TriangleResampler
      • WelchResampler

    Class Image

    Encapsulates an image, which consists of the pixel data for a graphics image and its attributes. For the non-generic Image type, the pixel type is only known at runtime. Image is always implemented by a pixel-specific Image<TPixel> instance.

    Inheritance
    Object
    Image
    Image<TPixel>
    Implements
    IImage
    IImageInfo
    IDisposable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: SixLabors.ImageSharp
    Assembly: SixLabors.ImageSharp.dll
    Syntax
    public abstract class Image : IImage, IImageInfo, IDisposable

    Constructors

    | Improve this Doc View Source

    Image(Configuration, PixelTypeInfo, ImageMetadata, Size)

    Initializes a new instance of the Image class.

    Declaration
    protected Image(Configuration configuration, PixelTypeInfo pixelType, ImageMetadata metadata, Size size)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration which allows altering default behaviour or extending the library.

    PixelTypeInfo pixelType

    The PixelTypeInfo.

    ImageMetadata metadata

    The ImageMetadata.

    Size size

    The SixLabors.ImageSharp.Image.size.

    Properties

    | Improve this Doc View Source

    Frames

    Gets the frames of the image as (non-generic) ImageFrameCollection.

    Declaration
    public ImageFrameCollection Frames { get; }
    Property Value
    Type Description
    ImageFrameCollection
    | Improve this Doc View Source

    Height

    Gets the height.

    Declaration
    public int Height { get; }
    Property Value
    Type Description
    Int32
    | Improve this Doc View Source

    Metadata

    Gets the metadata of the image.

    Declaration
    public ImageMetadata Metadata { get; }
    Property Value
    Type Description
    ImageMetadata
    | Improve this Doc View Source

    NonGenericFrameCollection

    Gets the ImageFrameCollection implementing the public Frames property.

    Declaration
    protected abstract ImageFrameCollection NonGenericFrameCollection { get; }
    Property Value
    Type Description
    ImageFrameCollection
    | Improve this Doc View Source

    PixelType

    Gets information about the image pixels.

    Declaration
    public PixelTypeInfo PixelType { get; }
    Property Value
    Type Description
    PixelTypeInfo
    | Improve this Doc View Source

    Width

    Gets the width.

    Declaration
    public int Width { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    CloneAs<TPixel2>()

    Returns a copy of the image in the given pixel format.

    Declaration
    public Image<TPixel2> CloneAs<TPixel2>()
        where TPixel2 : struct, IPixel<TPixel2>
    Returns
    Type Description
    Image<TPixel2>

    The Image<TPixel>

    Type Parameters
    Name Description
    TPixel2

    The pixel format.

    | Improve this Doc View Source

    CloneAs<TPixel2>(Configuration)

    Returns a copy of the image in the given pixel format.

    Declaration
    public abstract Image<TPixel2> CloneAs<TPixel2>(Configuration configuration)
        where TPixel2 : struct, IPixel<TPixel2>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration providing initialization code which allows extending the library.

    Returns
    Type Description
    Image<TPixel2>

    The Image<TPixel>.

    Type Parameters
    Name Description
    TPixel2

    The pixel format.

    | Improve this Doc View Source

    DetectFormat(Configuration, Byte[])

    By reading the header on the provided byte array this calculates the images format.

    Declaration
    public static IImageFormat DetectFormat(Configuration configuration, byte[] data)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Byte[] data

    The byte array containing encoded image data to read the header from.

    Returns
    Type Description
    IImageFormat

    The mime type or null if none found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    | Improve this Doc View Source

    DetectFormat(Configuration, Stream)

    By reading the header on the provided stream this calculates the images format type.

    Declaration
    public static IImageFormat DetectFormat(Configuration configuration, Stream stream)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Stream stream

    The image stream to read the header from.

    Returns
    Type Description
    IImageFormat

    The format type or null if none found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    | Improve this Doc View Source

    DetectFormat(Configuration, ReadOnlySpan<Byte>)

    By reading the header on the provided byte span this calculates the images format.

    Declaration
    public static IImageFormat DetectFormat(Configuration configuration, ReadOnlySpan<byte> data)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    ReadOnlySpan<Byte> data

    The byte span containing encoded image data to read the header from.

    Returns
    Type Description
    IImageFormat

    The mime type or null if none found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    DetectFormat(Configuration, String)

    By reading the header on the provided file this calculates the images mime type.

    Declaration
    public static IImageFormat DetectFormat(Configuration configuration, string filePath)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    String filePath

    The image file to open and to read the header from.

    Returns
    Type Description
    IImageFormat

    The mime type or null if none found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    DetectFormat(Byte[])

    By reading the header on the provided byte array this calculates the images format.

    Declaration
    public static IImageFormat DetectFormat(byte[] data)
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing encoded image data to read the header from.

    Returns
    Type Description
    IImageFormat

    The format or null if none found.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    | Improve this Doc View Source

    DetectFormat(Stream)

    By reading the header on the provided stream this calculates the images format type.

    Declaration
    public static IImageFormat DetectFormat(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The image stream to read the header from.

    Returns
    Type Description
    IImageFormat

    The format type or null if none found.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    | Improve this Doc View Source

    DetectFormat(ReadOnlySpan<Byte>)

    By reading the header on the provided byte span this calculates the images format.

    Declaration
    public static IImageFormat DetectFormat(ReadOnlySpan<byte> data)
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing encoded image data to read the header from.

    Returns
    Type Description
    IImageFormat

    The format or null if none found.

    | Improve this Doc View Source

    DetectFormat(String)

    By reading the header on the provided file this calculates the images mime type.

    Declaration
    public static IImageFormat DetectFormat(string filePath)
    Parameters
    Type Name Description
    String filePath

    The image file to open and to read the header from.

    Returns
    Type Description
    IImageFormat

    The mime type or null if none found.

    | Improve this Doc View Source

    DetectFormatAsync(Configuration, Stream)

    By reading the header on the provided stream this calculates the images format type.

    Declaration
    public static Task<IImageFormat> DetectFormatAsync(Configuration configuration, Stream stream)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Stream stream

    The image stream to read the header from.

    Returns
    Type Description
    Task<IImageFormat>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    | Improve this Doc View Source

    DetectFormatAsync(Stream)

    By reading the header on the provided stream this calculates the images format type.

    Declaration
    public static Task<IImageFormat> DetectFormatAsync(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The image stream to read the header from.

    Returns
    Type Description
    Task<IImageFormat>

    A Task<TResult> representing the asynchronous operation or null if none is found.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Disposes the object and frees resources for the Garbage Collector.

    Declaration
    protected abstract void Dispose(bool disposing)
    Parameters
    Type Name Description
    Boolean disposing

    Whether to dispose of managed and unmanaged objects.

    | Improve this Doc View Source

    Identify(Configuration, Byte[], out IImageFormat)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(Configuration configuration, byte[] data, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Byte[] data

    The byte array containing encoded image data to read the header from.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    NotSupportedException

    The data is not readable.

    | Improve this Doc View Source

    Identify(Configuration, Stream)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(Configuration configuration, Stream stream)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Stream stream

    The image stream to read the information from.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if a suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Identify(Configuration, Stream, out IImageFormat)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(Configuration configuration, Stream stream, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Stream stream

    The image stream to read the information from.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if a suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Identify(Configuration, String, out IImageFormat)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(Configuration configuration, string filePath, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    String filePath

    The image file to open and to read the header from.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    Identify(Byte[])

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(byte[] data)
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing encoded image data to read the header from.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if suitable info detector not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    NotSupportedException

    The data is not readable.

    | Improve this Doc View Source

    Identify(Byte[], out IImageFormat)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(byte[] data, out IImageFormat format)
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing encoded image data to read the header from.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if suitable info detector not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    NotSupportedException

    The data is not readable.

    | Improve this Doc View Source

    Identify(Stream)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The image stream to read the header from.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if a suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Identify(Stream, out IImageFormat)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(Stream stream, out IImageFormat format)
    Parameters
    Type Name Description
    Stream stream

    The image stream to read the header from.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if a suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Identify(String)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(string filePath)
    Parameters
    Type Name Description
    String filePath

    The image file to open and to read the header from.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if suitable info detector not found.

    | Improve this Doc View Source

    Identify(String, out IImageFormat)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static IImageInfo Identify(string filePath, out IImageFormat format)
    Parameters
    Type Name Description
    String filePath

    The image file to open and to read the header from.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    IImageInfo

    The IImageInfo or null if suitable info detector not found.

    | Improve this Doc View Source

    IdentifyAsync(Configuration, Stream, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static async Task<IImageInfo> IdentifyAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Stream stream

    The image stream to read the information from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<IImageInfo>

    A Task<TResult> representing the asynchronous operation or null if a suitable detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    IdentifyAsync(Configuration, String, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static async Task<IImageInfo> IdentifyAsync(Configuration configuration, string filePath, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    String filePath

    The image file to open and to read the header from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<IImageInfo>

    The Task<TResult> representing the asynchronous operation with the parameter type IImageInfo property set to null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    IdentifyAsync(Stream)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static Task<IImageInfo> IdentifyAsync(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The image stream to read the header from.

    Returns
    Type Description
    Task<IImageInfo>

    A Task<TResult> representing the asynchronous operation or null if a suitable detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    IdentifyAsync(String, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static Task<IImageInfo> IdentifyAsync(string filePath, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    String filePath

    The image file to open and to read the header from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<IImageInfo>

    The Task<TResult> representing the asynchronous operation with the parameter type IImageInfo property set to null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    IdentifyWithFormatAsync(Configuration, Stream, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static Task<(IImageInfo ImageInfo, IImageFormat Format)> IdentifyWithFormatAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    Stream stream

    The image stream to read the information from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<(T1, T2)<IImageInfo, IImageFormat>>

    The Task<TResult> representing the asynchronous operation with the parameter type IImageInfo property set to null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    IdentifyWithFormatAsync(Configuration, String, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static async Task<(IImageInfo ImageInfo, IImageFormat Format)> IdentifyWithFormatAsync(Configuration configuration, string filePath, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration.

    String filePath

    The image file to open and to read the header from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<(T1, T2)<IImageInfo, IImageFormat>>

    The Task<TResult> representing the asynchronous operation with the parameter type IImageInfo property set to null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    IdentifyWithFormatAsync(Stream, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static Task<(IImageInfo ImageInfo, IImageFormat Format)> IdentifyWithFormatAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Stream stream

    The image stream to read the information from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<(T1, T2)<IImageInfo, IImageFormat>>

    The Task<TResult> representing the asynchronous operation with the parameter type IImageInfo property set to null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    IdentifyWithFormatAsync(String, CancellationToken)

    Reads the raw image information from the specified stream without fully decoding it.

    Declaration
    public static Task<(IImageInfo ImageInfo, IImageFormat Format)> IdentifyWithFormatAsync(string filePath, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    String filePath

    The image file to open and to read the header from.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<(T1, T2)<IImageInfo, IImageFormat>>

    The Task<TResult> representing the asynchronous operation with the parameter type IImageInfo property set to null if suitable info detector is not found.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    Load(Configuration, Byte[])

    Load a new instance of Image from the given encoded byte array.

    Declaration
    public static Image Load(Configuration configuration, byte[] data)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Byte[] data

    The byte array containing encoded image data.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, Byte[], IImageDecoder)

    Load a new instance of Image from the given encoded byte array.

    Declaration
    public static Image Load(Configuration configuration, byte[] data, IImageDecoder decoder)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Byte[] data

    The byte array containing image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, Byte[], out IImageFormat)

    Load a new instance of Image from the given encoded byte array.

    Declaration
    public static Image Load(Configuration configuration, byte[] data, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Byte[] data

    The byte array containing image data.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, Stream)

    Decode a new instance of the Image class from the given stream.

    Declaration
    public static Image Load(Configuration configuration, Stream stream)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Image

    A new Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, Stream, IImageDecoder)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Image Load(Configuration configuration, Stream stream, IImageDecoder decoder)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    A new Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    ArgumentNullException

    The decoder is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, Stream, out IImageFormat)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Image Load(Configuration configuration, Stream stream, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Stream stream

    The stream containing image information.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    Image

    A new Image<TPixel>.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, ReadOnlySpan<Byte>)

    Decodes a new instance of Image from the given encoded byte span.

    Declaration
    public static Image Load(Configuration configuration, ReadOnlySpan<byte> data)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    ReadOnlySpan<Byte> data

    The byte span containing image data.

    Returns
    Type Description
    Image

    The Image.

    | Improve this Doc View Source

    Load(Configuration, ReadOnlySpan<Byte>, IImageDecoder)

    Load a new instance of Image from the given encoded byte span.

    Declaration
    public static Image Load(Configuration configuration, ReadOnlySpan<byte> data, IImageDecoder decoder)
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The decoder is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, ReadOnlySpan<Byte>, out IImageFormat)

    Load a new instance of Image from the given encoded byte span.

    Declaration
    public static Image Load(Configuration configuration, ReadOnlySpan<byte> data, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageFormat format

    The IImageFormat of the decoded image.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, String)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Image Load(Configuration configuration, string path)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    String path

    The file path to the image.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, String, IImageDecoder)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Image Load(Configuration configuration, string path, IImageDecoder decoder)
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Configuration, String, out IImageFormat)

    Create a new instance of the Image class from the given file. The pixel type is selected by the decoder.

    Declaration
    public static Image Load(Configuration configuration, string path, out IImageFormat format)
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    String path

    The file path to the image.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image

    A new Image<TPixel>.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Byte[])

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<Rgba32> Load(byte[] data)
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing image data.

    Returns
    Type Description
    Image<Rgba32>

    A new Image<TPixel>.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    | Improve this Doc View Source

    Load(Byte[], IImageDecoder)

    Load a new instance of Image from the given encoded byte array.

    Declaration
    public static Image Load(byte[] data, IImageDecoder decoder)
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing encoded image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Byte[], out IImageFormat)

    Load a new instance of Image from the given encoded byte array.

    Declaration
    public static Image Load(byte[] data, out IImageFormat format)
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing image data.

    IImageFormat format

    The detected format.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Stream)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Image Load(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Stream, IImageDecoder)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Image Load(Stream stream, IImageDecoder decoder)
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    ArgumentNullException

    The decoder is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(Stream, out IImageFormat)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Image Load(Stream stream, out IImageFormat format)
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(ReadOnlySpan<Byte>)

    Load a new instance of Image from the given encoded byte span.

    Declaration
    public static Image Load(ReadOnlySpan<byte> data)
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing image data.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(ReadOnlySpan<Byte>, IImageDecoder)

    Load a new instance of Image from the given encoded byte span.

    Declaration
    public static Image Load(ReadOnlySpan<byte> data, IImageDecoder decoder)
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(ReadOnlySpan<Byte>, out IImageFormat)

    Load a new instance of Image from the given encoded byte array.

    Declaration
    public static Image Load(ReadOnlySpan<byte> data, out IImageFormat format)
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageFormat format

    The detected format.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(String)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Image Load(string path)
    Parameters
    Type Name Description
    String path

    The file path to the image.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the stream is not readable nor seekable.

    | Improve this Doc View Source

    Load(String, IImageDecoder)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Image Load(string path, IImageDecoder decoder)
    Parameters
    Type Name Description
    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image

    The Image.

    Exceptions
    Type Condition
    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load(String, out IImageFormat)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Image Load(string path, out IImageFormat format)
    Parameters
    Type Name Description
    String path

    The file path to the image.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image

    A new Image<TPixel>.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the stream is not readable nor seekable.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, Byte[])

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, byte[] data)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Byte[] data

    The byte array containing encoded image data.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, Byte[], IImageDecoder)

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, byte[] data, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    Byte[] data

    The byte array containing encoded image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, Byte[], out IImageFormat)

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, byte[] data, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Byte[] data

    The byte array containing encoded image data.

    IImageFormat format

    The IImageFormat of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, Stream)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, Stream stream)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, Stream, IImageDecoder)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, Stream stream, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, Stream, out IImageFormat)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, Stream stream, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Stream stream

    The stream containing image information.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A Task representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, ReadOnlySpan<Byte>)

    Load a new instance of Image<TPixel> from the given encoded byte span.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, ReadOnlySpan<byte> data)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    ReadOnlySpan<Byte> data

    The byte span containing encoded image data.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, ReadOnlySpan<Byte>, IImageDecoder)

    Load a new instance of Image<TPixel> from the given encoded byte span.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, ReadOnlySpan<byte> data, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, ReadOnlySpan<Byte>, out IImageFormat)

    Load a new instance of Image<TPixel> from the given encoded byte span.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, ReadOnlySpan<byte> data, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageFormat format

    The IImageFormat of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, String)

    Create a new instance of the Image<TPixel> class from the given file.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, string path)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    String path

    The file path to the image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, String, IImageDecoder)

    Create a new instance of the Image<TPixel> class from the given file.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, string path, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Configuration, String, out IImageFormat)

    Create a new instance of the Image<TPixel> class from the given file.

    Declaration
    public static Image<TPixel> Load<TPixel>(Configuration configuration, string path, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    String path

    The file path to the image.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Byte[])

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<TPixel> Load<TPixel>(byte[] data)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing encoded image data.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Byte[], IImageDecoder)

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<TPixel> Load<TPixel>(byte[] data, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing encoded image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Byte[], out IImageFormat)

    Load a new instance of Image<TPixel> from the given encoded byte array.

    Declaration
    public static Image<TPixel> Load<TPixel>(byte[] data, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing image data.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The data is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Stream)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Image<TPixel> Load<TPixel>(Stream stream)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Stream, IImageDecoder)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Image<TPixel> Load<TPixel>(Stream stream, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(Stream, out IImageFormat)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Image<TPixel> Load<TPixel>(Stream stream, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    IImageFormat format

    The format type of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(ReadOnlySpan<Byte>)

    Load a new instance of Image<TPixel> from the given encoded byte span.

    Declaration
    public static Image<TPixel> Load<TPixel>(ReadOnlySpan<byte> data)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing encoded image data.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(ReadOnlySpan<Byte>, IImageDecoder)

    Load a new instance of Image<TPixel> from the given encoded byte span.

    Declaration
    public static Image<TPixel> Load<TPixel>(ReadOnlySpan<byte> data, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing encoded image data.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(ReadOnlySpan<Byte>, out IImageFormat)

    Load a new instance of Image<TPixel> from the given encoded byte span.

    Declaration
    public static Image<TPixel> Load<TPixel>(ReadOnlySpan<byte> data, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte span containing image data.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(String)

    Create a new instance of the Image<TPixel> class from the given file.

    Declaration
    public static Image<TPixel> Load<TPixel>(string path)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    String path

    The file path to the image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(String, IImageDecoder)

    Create a new instance of the Image<TPixel> class from the given file.

    Declaration
    public static Image<TPixel> Load<TPixel>(string path, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Load<TPixel>(String, out IImageFormat)

    Create a new instance of the Image<TPixel> class from the given file.

    Declaration
    public static Image<TPixel> Load<TPixel>(string path, out IImageFormat format)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    String path

    The file path to the image.

    IImageFormat format

    The mime type of the decoded image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(Configuration, Stream, IImageDecoder, CancellationToken)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Task<Image> LoadAsync(Configuration configuration, Stream stream, IImageDecoder decoder, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    ArgumentNullException

    The decoder is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(Configuration, Stream, CancellationToken)

    Decode a new instance of the Image class from the given stream.

    Declaration
    public static async Task<Image> LoadAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Stream stream

    The stream containing image information.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(Configuration, String, IImageDecoder, CancellationToken)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Task<Image> LoadAsync(Configuration configuration, string path, IImageDecoder decoder, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(Configuration, String, CancellationToken)

    Create a new instance of the Image class from the given file.

    Declaration
    public static async Task<Image> LoadAsync(Configuration configuration, string path, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    String path

    The file path to the image.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(Stream)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Task<Image> LoadAsync(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(Stream, IImageDecoder)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Task<Image> LoadAsync(Stream stream, IImageDecoder decoder)
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    ArgumentNullException

    The decoder is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(String, IImageDecoder)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Task<Image> LoadAsync(string path, IImageDecoder decoder)
    Parameters
    Type Name Description
    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync(String, CancellationToken)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Task<Image> LoadAsync(string path, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    String path

    The file path to the image.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(Configuration, Stream, IImageDecoder, CancellationToken)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Task<Image<TPixel>> LoadAsync<TPixel>(Configuration configuration, Stream stream, IImageDecoder decoder, CancellationToken cancellationToken = default(CancellationToken))
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(Configuration, Stream, CancellationToken)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static async Task<Image<TPixel>> LoadAsync<TPixel>(Configuration configuration, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Stream stream

    The stream containing image information.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(Configuration, String, IImageDecoder, CancellationToken)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Task<Image<TPixel>> LoadAsync<TPixel>(Configuration configuration, string path, IImageDecoder decoder, CancellationToken cancellationToken = default(CancellationToken))
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration.

    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(Configuration, String, CancellationToken)

    Create a new instance of the Image class from the given file.

    Declaration
    public static async Task<Image<TPixel>> LoadAsync<TPixel>(Configuration configuration, string path, CancellationToken cancellationToken = default(CancellationToken))
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    String path

    The file path to the image.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(Stream)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Task<Image<TPixel>> LoadAsync<TPixel>(Stream stream)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(Stream, IImageDecoder, CancellationToken)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Task<Image<TPixel>> LoadAsync<TPixel>(Stream stream, IImageDecoder decoder, CancellationToken cancellationToken = default(CancellationToken))
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    IImageDecoder decoder

    The decoder.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(String)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Task<Image<TPixel>> LoadAsync<TPixel>(string path)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    String path

    The file path to the image.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadAsync<TPixel>(String, IImageDecoder)

    Create a new instance of the Image class from the given file.

    Declaration
    public static Task<Image<TPixel>> LoadAsync<TPixel>(string path, IImageDecoder decoder)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    String path

    The file path to the image.

    IImageDecoder decoder

    The decoder.

    Returns
    Type Description
    Task<Image<TPixel>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The path is null.

    ArgumentNullException

    The decoder is null.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(TPixel[], Int32, Int32)

    Create a new instance of the Image<TPixel> class from the raw TPixel data.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(TPixel[] data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    TPixel[] data

    The byte array containing image data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(Configuration, TPixel[], Int32, Int32)

    Create a new instance of the Image<TPixel> class from the raw TPixel data.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(Configuration configuration, TPixel[] data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    TPixel[] data

    The Span containing the image Pixel data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(Configuration, Byte[], Int32, Int32)

    Create a new instance of the Image<TPixel> class from the given byte array in TPixel format.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(Configuration configuration, byte[] data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    Byte[] data

    The byte array containing image data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(Configuration, ReadOnlySpan<TPixel>, Int32, Int32)

    Create a new instance of the Image<TPixel> class from the raw TPixel data.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(Configuration configuration, ReadOnlySpan<TPixel> data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    ReadOnlySpan<TPixel> data

    The Span containing the image Pixel data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(Configuration, ReadOnlySpan<Byte>, Int32, Int32)

    Create a new instance of the Image<TPixel> class from the given byte array in TPixel format.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(Configuration configuration, ReadOnlySpan<byte> data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration for the decoder.

    ReadOnlySpan<Byte> data

    The byte array containing image data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(Byte[], Int32, Int32)

    Create a new instance of the Image<TPixel> class from the given byte array in TPixel format.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(byte[] data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Byte[] data

    The byte array containing image data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(ReadOnlySpan<TPixel>, Int32, Int32)

    Create a new instance of the Image<TPixel> class from the raw TPixel data.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(ReadOnlySpan<TPixel> data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    ReadOnlySpan<TPixel> data

    The byte array containing image data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadPixelData<TPixel>(ReadOnlySpan<Byte>, Int32, Int32)

    Create a new instance of the Image<TPixel> class from the given byte array in TPixel format.

    Declaration
    public static Image<TPixel> LoadPixelData<TPixel>(ReadOnlySpan<byte> data, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    ReadOnlySpan<Byte> data

    The byte array containing image data.

    Int32 width

    The width of the final image.

    Int32 height

    The height of the final image.

    Returns
    Type Description
    Image<TPixel>

    A new Image<TPixel>.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentException

    The data length is incorrect.

    | Improve this Doc View Source

    LoadWithFormatAsync(Configuration, Stream, CancellationToken)

    Create a new instance of the Image class from the given stream.

    Declaration
    public static async Task<(Image Image, IImageFormat Format)> LoadWithFormatAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Stream stream

    The stream containing image information.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<(T1, T2)<Image, IImageFormat>>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadWithFormatAsync(Stream)

    Decode a new instance of the Image class from the given stream. The pixel format is selected by the decoder.

    Declaration
    public static Task<(Image Image, IImageFormat Format)> LoadWithFormatAsync(Stream stream)
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Task<(T1, T2)<Image, IImageFormat>>

    A Task<TResult> representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadWithFormatAsync<TPixel>(Configuration, Stream, CancellationToken)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static async Task<(Image<TPixel> Image, IImageFormat Format)> LoadWithFormatAsync<TPixel>(Configuration configuration, Stream stream, CancellationToken cancellationToken = default(CancellationToken))
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The configuration options.

    Stream stream

    The stream containing image information.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task<(T1, T2)<Image<TPixel>, IImageFormat>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    LoadWithFormatAsync<TPixel>(Stream)

    Create a new instance of the Image<TPixel> class from the given stream.

    Declaration
    public static Task<(Image<TPixel> Image, IImageFormat Format)> LoadWithFormatAsync<TPixel>(Stream stream)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Stream stream

    The stream containing image information.

    Returns
    Type Description
    Task<(T1, T2)<Image<TPixel>, IImageFormat>>

    A Task<TResult> representing the asynchronous operation.

    Type Parameters
    Name Description
    TPixel

    The pixel format.

    Exceptions
    Type Condition
    ArgumentNullException

    The stream is null.

    NotSupportedException

    The stream is not readable.

    UnknownImageFormatException

    Image format not recognised.

    InvalidImageContentException

    Image contains invalid content.

    | Improve this Doc View Source

    Save(Stream, IImageEncoder)

    Saves the image to the given stream using the given image encoder.

    Declaration
    public void Save(Stream stream, IImageEncoder encoder)
    Parameters
    Type Name Description
    Stream stream

    The stream to save the image to.

    IImageEncoder encoder

    The encoder to save the image with.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream or encoder is null.

    | Improve this Doc View Source

    SaveAsync(Stream, IImageEncoder, CancellationToken)

    Saves the image to the given stream using the given image encoder.

    Declaration
    public Task SaveAsync(Stream stream, IImageEncoder encoder, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    Stream stream

    The stream to save the image to.

    IImageEncoder encoder

    The encoder to save the image with.

    CancellationToken cancellationToken

    The token to monitor for cancellation requests.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the stream or encoder is null.

    | Improve this Doc View Source

    UpdateSize(Size)

    Update the size of the image after mutation.

    Declaration
    protected void UpdateSize(Size size)
    Parameters
    Type Name Description
    Size size

    The Size.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, IMemoryOwner<TPixel>, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, allowing to view/manipulate it as an Image<TPixel> instance. The ownership of the pixelMemoryOwner is being transferred to the new Image<TPixel> instance, meaning that the caller is not allowed to dispose pixelMemoryOwner. It will be disposed together with the result image.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, IMemoryOwner<TPixel> pixelMemoryOwner, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    IMemoryOwner<TPixel> pixelMemoryOwner

    The IMemoryOwner<T> that is being transferred to the image.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance

    Type Parameters
    Name Description
    TPixel

    The pixel type.

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, IMemoryOwner<TPixel>, Int32, Int32, ImageMetadata)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, allowing to view/manipulate it as an Image<TPixel> instance. The ownership of the pixelMemoryOwner is being transferred to the new Image<TPixel> instance, meaning that the caller is not allowed to dispose pixelMemoryOwner. It will be disposed together with the result image.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, IMemoryOwner<TPixel> pixelMemoryOwner, int width, int height, ImageMetadata metadata)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    IMemoryOwner<TPixel> pixelMemoryOwner

    The IMemoryOwner<T> that is being transferred to the image

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    ImageMetadata metadata

    The ImageMetadata

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The metadata is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, Memory<TPixel>, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: using this method does not transfer the ownership of the underlying buffer of the input Memory<T> to the new Image<TPixel> instance. This means that consumers of this method must ensure that the input buffer is either self-contained, (for example, a Memory<T> instance wrapping a new array that was created), or that the owning object is not disposed until the returned Image<TPixel> is disposed.

    If the input Memory<T> instance is one retrieved from an IMemoryOwner<T> instance rented from a memory pool (such as MemoryPool<T>), and that owning instance is disposed while the image is still in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, Memory<TPixel> pixelMemory, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    Memory<TPixel> pixelMemory

    The pixel memory.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, Memory<TPixel>, Int32, Int32, ImageMetadata)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: using this method does not transfer the ownership of the underlying buffer of the input Memory<T> to the new Image<TPixel> instance. This means that consumers of this method must ensure that the input buffer is either self-contained, (for example, a Memory<T> instance wrapping a new array that was created), or that the owning object is not disposed until the returned Image<TPixel> is disposed.

    If the input Memory<T> instance is one retrieved from an IMemoryOwner<T> instance rented from a memory pool (such as MemoryPool<T>), and that owning instance is disposed while the image is still in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, Memory<TPixel> pixelMemory, int width, int height, ImageMetadata metadata)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    Memory<TPixel> pixelMemory

    The pixel memory.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    ImageMetadata metadata

    The ImageMetadata.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The metadata is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, Memory<Byte>, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: using this method does not transfer the ownership of the underlying buffer of the input Memory<T> to the new Image<TPixel> instance. This means that consumers of this method must ensure that the input buffer is either self-contained, (for example, a Memory<T> instance wrapping a new array that was created), or that the owning object is not disposed until the returned Image<TPixel> is disposed.

    If the input Memory<T> instance is one retrieved from an IMemoryOwner<T> instance rented from a memory pool (such as MemoryPool<T>), and that owning instance is disposed while the image is still in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, Memory<byte> byteMemory, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    Memory<Byte> byteMemory

    The byte memory representing the pixel data.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, Memory<Byte>, Int32, Int32, ImageMetadata)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: using this method does not transfer the ownership of the underlying buffer of the input Memory<T> to the new Image<TPixel> instance. This means that consumers of this method must ensure that the input buffer is either self-contained, (for example, a Memory<T> instance wrapping a new array that was created), or that the owning object is not disposed until the returned Image<TPixel> is disposed.

    If the input Memory<T> instance is one retrieved from an IMemoryOwner<T> instance rented from a memory pool (such as MemoryPool<T>), and that owning instance is disposed while the image is still in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, Memory<byte> byteMemory, int width, int height, ImageMetadata metadata)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    Memory<Byte> byteMemory

    The byte memory representing the pixel data.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    ImageMetadata metadata

    The ImageMetadata.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The metadata is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, Void*, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: this method relies on callers to carefully manage the target memory area being referenced by the pointer and that the lifetime of such a memory area is at least equal to that of the returned Image<TPixel> instance. For example, if the input pointer references an unmanaged memory area, callers must ensure that the memory area is not freed as long as the returned Image<TPixel> is in use and not disposed. The same applies if the input memory area points to a pinned managed object, as callers must ensure that objects will remain pinned as long as the Image<TPixel> instance is in use. Failing to do so constitutes undefined behavior and will likely lead to memory corruption and runtime crashes.

    Note also that if you have a Memory<T> or an array (which can be cast to Memory<T>) of either Byte or TPixel values, it is highly recommended to use one of the other available overloads of this method instead (such as WrapMemory<TPixel>(Configuration, Memory<Byte>, Int32, Int32) or WrapMemory<TPixel>(Configuration, Memory<TPixel>, Int32, Int32), to make the resulting code less error prone and avoid having to pin the underlying memory buffer in use. This method is primarily meant to be used when doing interop or working with buffers that are located in unmanaged memory.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, void *pointer, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    Void* pointer

    The pointer to the target memory buffer to wrap.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Configuration, Void*, Int32, Int32, ImageMetadata)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: this method relies on callers to carefully manage the target memory area being referenced by the pointer and that the lifetime of such a memory area is at least equal to that of the returned Image<TPixel> instance. For example, if the input pointer references an unmanaged memory area, callers must ensure that the memory area is not freed as long as the returned Image<TPixel> is in use and not disposed. The same applies if the input memory area points to a pinned managed object, as callers must ensure that objects will remain pinned as long as the Image<TPixel> instance is in use. Failing to do so constitutes undefined behavior and will likely lead to memory corruption and runtime crashes.

    Note also that if you have a Memory<T> or an array (which can be cast to Memory<T>) of either Byte or TPixel values, it is highly recommended to use one of the other available overloads of this method instead (such as WrapMemory<TPixel>(Configuration, Memory<Byte>, Int32, Int32) or WrapMemory<TPixel>(Configuration, Memory<TPixel>, Int32, Int32), to make the resulting code less error prone and avoid having to pin the underlying memory buffer in use. This method is primarily meant to be used when doing interop or working with buffers that are located in unmanaged memory.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Configuration configuration, void *pointer, int width, int height, ImageMetadata metadata)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Configuration configuration

    The Configuration

    Void* pointer

    The pointer to the target memory buffer to wrap.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    ImageMetadata metadata

    The ImageMetadata.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance

    Type Parameters
    Name Description
    TPixel

    The pixel type

    Exceptions
    Type Condition
    ArgumentNullException

    The configuration is null.

    ArgumentNullException

    The metadata is null.

    | Improve this Doc View Source

    WrapMemory<TPixel>(IMemoryOwner<TPixel>, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels, allowing to view/manipulate it as an Image<TPixel> instance. The ownership of the pixelMemoryOwner is being transferred to the new Image<TPixel> instance, meaning that the caller is not allowed to dispose pixelMemoryOwner. It will be disposed together with the result image.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(IMemoryOwner<TPixel> pixelMemoryOwner, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    IMemoryOwner<TPixel> pixelMemoryOwner

    The IMemoryOwner<T> that is being transferred to the image.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type

    | Improve this Doc View Source

    WrapMemory<TPixel>(Memory<TPixel>, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: using this method does not transfer the ownership of the underlying buffer of the input Memory<T> to the new Image<TPixel> instance. This means that consumers of this method must ensure that the input buffer is either self-contained, (for example, a Memory<T> instance wrapping a new array that was created), or that the owning object is not disposed until the returned Image<TPixel> is disposed.

    If the input Memory<T> instance is one retrieved from an IMemoryOwner<T> instance rented from a memory pool (such as MemoryPool<T>), and that owning instance is disposed while the image is still in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Memory<TPixel> pixelMemory, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Memory<TPixel> pixelMemory

    The pixel memory.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Memory<Byte>, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: using this method does not transfer the ownership of the underlying buffer of the input Memory<T> to the new Image<TPixel> instance. This means that consumers of this method must ensure that the input buffer is either self-contained, (for example, a Memory<T> instance wrapping a new array that was created), or that the owning object is not disposed until the returned Image<TPixel> is disposed.

    If the input Memory<T> instance is one retrieved from an IMemoryOwner<T> instance rented from a memory pool (such as MemoryPool<T>), and that owning instance is disposed while the image is still in use, this will lead to undefined behavior and possibly runtime crashes (as the same buffer might then be modified by other consumers while the returned image is still working on it). Make sure to control the lifetime of the input buffers appropriately.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(Memory<byte> byteMemory, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Memory<Byte> byteMemory

    The byte memory representing the pixel data.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type.

    | Improve this Doc View Source

    WrapMemory<TPixel>(Void*, Int32, Int32)

    Wraps an existing contiguous memory area of at least 'width' x 'height' pixels allowing viewing/manipulation as an Image<TPixel> instance.

    Please note: this method relies on callers to carefully manage the target memory area being referenced by the pointer and that the lifetime of such a memory area is at least equal to that of the returned Image<TPixel> instance. For example, if the input pointer references an unmanaged memory area, callers must ensure that the memory area is not freed as long as the returned Image<TPixel> is in use and not disposed. The same applies if the input memory area points to a pinned managed object, as callers must ensure that objects will remain pinned as long as the Image<TPixel> instance is in use. Failing to do so constitutes undefined behavior and will likely lead to memory corruption and runtime crashes.

    Note also that if you have a Memory<T> or an array (which can be cast to Memory<T>) of either Byte or TPixel values, it is highly recommended to use one of the other available overloads of this method instead (such as WrapMemory<TPixel>(Configuration, Memory<Byte>, Int32, Int32) or WrapMemory<TPixel>(Configuration, Memory<TPixel>, Int32, Int32), to make the resulting code less error prone and avoid having to pin the underlying memory buffer in use. This method is primarily meant to be used when doing interop or working with buffers that are located in unmanaged memory.

    Declaration
    public static Image<TPixel> WrapMemory<TPixel>(void *pointer, int width, int height)
        where TPixel : struct, IPixel<TPixel>
    Parameters
    Type Name Description
    Void* pointer

    The pointer to the target memory buffer to wrap.

    Int32 width

    The width of the memory image.

    Int32 height

    The height of the memory image.

    Returns
    Type Description
    Image<TPixel>

    An Image<TPixel> instance.

    Type Parameters
    Name Description
    TPixel

    The pixel type.

    Implements

    IImage
    IImageInfo
    System.IDisposable

    Extension Methods

    ImageExtensions.SaveAsBmp(Image, String)
    ImageExtensions.SaveAsBmpAsync(Image, String)
    ImageExtensions.SaveAsBmpAsync(Image, String, CancellationToken)
    ImageExtensions.SaveAsBmp(Image, String, BmpEncoder)
    ImageExtensions.SaveAsBmpAsync(Image, String, BmpEncoder, CancellationToken)
    ImageExtensions.SaveAsBmp(Image, Stream)
    ImageExtensions.SaveAsBmpAsync(Image, Stream, CancellationToken)
    ImageExtensions.SaveAsBmp(Image, Stream, BmpEncoder)
    ImageExtensions.SaveAsBmpAsync(Image, Stream, BmpEncoder, CancellationToken)
    ImageExtensions.SaveAsGif(Image, String)
    ImageExtensions.SaveAsGifAsync(Image, String)
    ImageExtensions.SaveAsGifAsync(Image, String, CancellationToken)
    ImageExtensions.SaveAsGif(Image, String, GifEncoder)
    ImageExtensions.SaveAsGifAsync(Image, String, GifEncoder, CancellationToken)
    ImageExtensions.SaveAsGif(Image, Stream)
    ImageExtensions.SaveAsGifAsync(Image, Stream, CancellationToken)
    ImageExtensions.SaveAsGif(Image, Stream, GifEncoder)
    ImageExtensions.SaveAsGifAsync(Image, Stream, GifEncoder, CancellationToken)
    ImageExtensions.SaveAsJpeg(Image, String)
    ImageExtensions.SaveAsJpegAsync(Image, String)
    ImageExtensions.SaveAsJpegAsync(Image, String, CancellationToken)
    ImageExtensions.SaveAsJpeg(Image, String, JpegEncoder)
    ImageExtensions.SaveAsJpegAsync(Image, String, JpegEncoder, CancellationToken)
    ImageExtensions.SaveAsJpeg(Image, Stream)
    ImageExtensions.SaveAsJpegAsync(Image, Stream, CancellationToken)
    ImageExtensions.SaveAsJpeg(Image, Stream, JpegEncoder)
    ImageExtensions.SaveAsJpegAsync(Image, Stream, JpegEncoder, CancellationToken)
    ImageExtensions.SaveAsPng(Image, String)
    ImageExtensions.SaveAsPngAsync(Image, String)
    ImageExtensions.SaveAsPngAsync(Image, String, CancellationToken)
    ImageExtensions.SaveAsPng(Image, String, PngEncoder)
    ImageExtensions.SaveAsPngAsync(Image, String, PngEncoder, CancellationToken)
    ImageExtensions.SaveAsPng(Image, Stream)
    ImageExtensions.SaveAsPngAsync(Image, Stream, CancellationToken)
    ImageExtensions.SaveAsPng(Image, Stream, PngEncoder)
    ImageExtensions.SaveAsPngAsync(Image, Stream, PngEncoder, CancellationToken)
    ImageExtensions.SaveAsTga(Image, String)
    ImageExtensions.SaveAsTgaAsync(Image, String)
    ImageExtensions.SaveAsTgaAsync(Image, String, CancellationToken)
    ImageExtensions.SaveAsTga(Image, String, TgaEncoder)
    ImageExtensions.SaveAsTgaAsync(Image, String, TgaEncoder, CancellationToken)
    ImageExtensions.SaveAsTga(Image, Stream)
    ImageExtensions.SaveAsTgaAsync(Image, Stream, CancellationToken)
    ImageExtensions.SaveAsTga(Image, Stream, TgaEncoder)
    ImageExtensions.SaveAsTgaAsync(Image, Stream, TgaEncoder, CancellationToken)
    ImageExtensions.Save(Image, String)
    ImageExtensions.SaveAsync(Image, String, CancellationToken)
    ImageExtensions.Save(Image, String, IImageEncoder)
    ImageExtensions.SaveAsync(Image, String, IImageEncoder, CancellationToken)
    ImageExtensions.Save(Image, Stream, IImageFormat)
    ImageExtensions.SaveAsync(Image, Stream, IImageFormat, CancellationToken)
    ImageExtensions.ToBase64String(Image, IImageFormat)
    ImageInfoExtensions.Size(IImageInfo)
    ImageInfoExtensions.Bounds(IImageInfo)
    AdvancedImageExtensions.DetectEncoder(Image, String)
    AdvancedImageExtensions.AcceptVisitor(Image, IImageVisitor)
    AdvancedImageExtensions.AcceptVisitorAsync(Image, IImageVisitorAsync, CancellationToken)
    AdvancedImageExtensions.GetConfiguration(Image)
    ProcessingExtensions.Mutate(Image, Action<IImageProcessingContext>)
    ProcessingExtensions.Mutate(Image, Configuration, Action<IImageProcessingContext>)
    ProcessingExtensions.Clone(Image, Action<IImageProcessingContext>)
    ProcessingExtensions.Clone(Image, Configuration, Action<IImageProcessingContext>)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX