Class ProcessingExtensions
Adds extensions that allow the processing of images to the Image<TPixel> type.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing
Assembly: SixLabors.ImageSharp.dll
Syntax
public static class ProcessingExtensions
Methods
| Edit this page View SourceApplyProcessors(IImageProcessingContext, params IImageProcessor[])
Applies the given IImageProcessor<TPixel> collection against the context
Declaration
public static IImageProcessingContext ApplyProcessors(this IImageProcessingContext source, params IImageProcessor[] operations)
Parameters
| Type | Name | Description |
|---|---|---|
| IImageProcessingContext | source | The image processing context. |
| IImageProcessor[] | operations | The operations to perform on the source. |
Returns
| Type | Description |
|---|---|
| IImageProcessingContext | The IImageProcessor<TPixel> to allow chaining of operations. |
Exceptions
| Type | Condition |
|---|---|
| ImageProcessingException | The processing operation failed. |
CalculateIntegralImage<TPixel>(ImageFrame<TPixel>)
Apply an image integral.
Declaration
public static Buffer2D<ulong> CalculateIntegralImage<TPixel>(this ImageFrame<TPixel> source) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| ImageFrame<TPixel> | source | The image frame on which to apply the integral. |
Returns
| Type | Description |
|---|---|
| Buffer2D<ulong> | The Buffer2D<T> containing all the sums. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The type of the pixel. |
CalculateIntegralImage<TPixel>(ImageFrame<TPixel>, Rectangle)
Apply an image integral.
Declaration
public static Buffer2D<ulong> CalculateIntegralImage<TPixel>(this ImageFrame<TPixel> source, Rectangle bounds) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| ImageFrame<TPixel> | source | The image frame on which to apply the integral. |
| Rectangle | bounds | The bounds within the image frame to calculate. |
Returns
| Type | Description |
|---|---|
| Buffer2D<ulong> | The Buffer2D<T> containing all the sums. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The type of the pixel. |
CalculateIntegralImage<TPixel>(Image<TPixel>)
Apply an image integral.
Declaration
public static Buffer2D<ulong> CalculateIntegralImage<TPixel>(this Image<TPixel> source) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image on which to apply the integral. |
Returns
| Type | Description |
|---|---|
| Buffer2D<ulong> | The Buffer2D<T> containing all the sums. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The type of the pixel. |
CalculateIntegralImage<TPixel>(Image<TPixel>, Rectangle)
Apply an image integral.
Declaration
public static Buffer2D<ulong> CalculateIntegralImage<TPixel>(this Image<TPixel> source, Rectangle bounds) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image on which to apply the integral. |
| Rectangle | bounds | The bounds within the image frame to calculate. |
Returns
| Type | Description |
|---|---|
| Buffer2D<ulong> | The Buffer2D<T> containing all the sums. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The type of the pixel. |
Clone(Image, Configuration, Action<IImageProcessingContext>)
Creates a deep clone of the current image. The clone is then mutated by the given operation.
Declaration
public static Image Clone(this Image source, Configuration configuration, Action<IImageProcessingContext> operation)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | source | The image to clone. |
| Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
| Action<IImageProcessingContext> | operation | The operation to perform on the clone. |
Returns
| Type | Description |
|---|---|
| Image | The new Image. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The configuration is null. |
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Clone(Image, Action<IImageProcessingContext>)
Creates a deep clone of the current image. The clone is then mutated by the given operation.
Declaration
public static Image Clone(this Image source, Action<IImageProcessingContext> operation)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | source | The image to clone. |
| Action<IImageProcessingContext> | operation | The operation to perform on the clone. |
Returns
| Type | Description |
|---|---|
| Image | The new Image. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Clone<TPixel>(Image<TPixel>, Configuration, params IImageProcessor[])
Creates a deep clone of the current image. The clone is then mutated by the given operations.
Declaration
public static Image<TPixel> Clone<TPixel>(this Image<TPixel> source, Configuration configuration, params IImageProcessor[] operations) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to clone. |
| Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
| IImageProcessor[] | operations | The operations to perform on the clone. |
Returns
| Type | Description |
|---|---|
| Image<TPixel> | The new Image<TPixel> |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The configuration is null. |
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operations are null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Clone<TPixel>(Image<TPixel>, Configuration, Action<IImageProcessingContext>)
Creates a deep clone of the current image. The clone is then mutated by the given operation.
Declaration
public static Image<TPixel> Clone<TPixel>(this Image<TPixel> source, Configuration configuration, Action<IImageProcessingContext> operation) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to clone. |
| Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
| Action<IImageProcessingContext> | operation | The operation to perform on the clone. |
Returns
| Type | Description |
|---|---|
| Image<TPixel> | The new Image<TPixel> |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The configuration is null. |
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Clone<TPixel>(Image<TPixel>, params IImageProcessor[])
Creates a deep clone of the current image. The clone is then mutated by the given operations.
Declaration
public static Image<TPixel> Clone<TPixel>(this Image<TPixel> source, params IImageProcessor[] operations) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to clone. |
| IImageProcessor[] | operations | The operations to perform on the clone. |
Returns
| Type | Description |
|---|---|
| Image<TPixel> | The new Image<TPixel> |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operations are null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Clone<TPixel>(Image<TPixel>, Action<IImageProcessingContext>)
Creates a deep clone of the current image. The clone is then mutated by the given operation.
Declaration
public static Image<TPixel> Clone<TPixel>(this Image<TPixel> source, Action<IImageProcessingContext> operation) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to clone. |
| Action<IImageProcessingContext> | operation | The operation to perform on the clone. |
Returns
| Type | Description |
|---|---|
| Image<TPixel> | The new Image<TPixel>. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Mutate(Image, Configuration, Action<IImageProcessingContext>)
Mutates the source image by applying the image operation to it.
Declaration
public static void Mutate(this Image source, Configuration configuration, Action<IImageProcessingContext> operation)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | source | The image to mutate. |
| Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
| Action<IImageProcessingContext> | operation | The operation to perform on the source. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The configuration is null. |
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Mutate(Image, Action<IImageProcessingContext>)
Mutates the source image by applying the image operation to it.
Declaration
public static void Mutate(this Image source, Action<IImageProcessingContext> operation)
Parameters
| Type | Name | Description |
|---|---|---|
| Image | source | The image to mutate. |
| Action<IImageProcessingContext> | operation | The operation to perform on the source. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Mutate<TPixel>(Image<TPixel>, Configuration, params IImageProcessor[])
Mutates the source image by applying the operations to it.
Declaration
public static void Mutate<TPixel>(this Image<TPixel> source, Configuration configuration, params IImageProcessor[] operations) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to mutate. |
| Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
| IImageProcessor[] | operations | The operations to perform on the source. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The configuration is null. |
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operations are null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Mutate<TPixel>(Image<TPixel>, Configuration, Action<IImageProcessingContext>)
Mutates the source image by applying the image operation to it.
Declaration
public static void Mutate<TPixel>(this Image<TPixel> source, Configuration configuration, Action<IImageProcessingContext> operation) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to mutate. |
| Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
| Action<IImageProcessingContext> | operation | The operation to perform on the source. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The configuration is null. |
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Mutate<TPixel>(Image<TPixel>, params IImageProcessor[])
Mutates the source image by applying the operations to it.
Declaration
public static void Mutate<TPixel>(this Image<TPixel> source, params IImageProcessor[] operations) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to mutate. |
| IImageProcessor[] | operations | The operations to perform on the source. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operations are null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |
Mutate<TPixel>(Image<TPixel>, Action<IImageProcessingContext>)
Mutates the source image by applying the image operation to it.
Declaration
public static void Mutate<TPixel>(this Image<TPixel> source, Action<IImageProcessingContext> operation) where TPixel : unmanaged, IPixel<TPixel>
Parameters
| Type | Name | Description |
|---|---|---|
| Image<TPixel> | source | The image to mutate. |
| Action<IImageProcessingContext> | operation | The operation to perform on the source. |
Type Parameters
| Name | Description |
|---|---|
| TPixel | The pixel format. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | The source is null. |
| ArgumentNullException | The operation is null. |
| ObjectDisposedException | The source has been disposed. |
| ImageProcessingException | The processing operation failed. |