Class ImageProcessor<TPixel>
- Namespace
- SixLabors.ImageSharp.Processing.Processors
- Assembly
- SixLabors.ImageSharp.dll
The base class for all pixel specific image processors. Allows the application of processing algorithms to the image.
public abstract class ImageProcessor<TPixel> : IImageProcessor<TPixel>, IDisposable where TPixel : unmanaged, IPixel<TPixel>
Type Parameters
TPixel
The pixel format.
- Inheritance
-
ImageProcessor<TPixel>
- Implements
-
IImageProcessor<TPixel>
- Inherited Members
Constructors
ImageProcessor(Configuration, Image<TPixel>, Rectangle)
Initializes a new instance of the ImageProcessor<TPixel> class.
protected ImageProcessor(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)
Parameters
configuration
ConfigurationThe configuration which allows altering default behaviour or extending the library.
source
Image<TPixel>The source Image<TPixel> for the current processor instance.
sourceRectangle
RectangleThe source area to process for the current processor instance.
Properties
Configuration
Gets the Configuration instance to use when performing operations.
protected Configuration Configuration { get; }
Property Value
Source
Gets The source Image<TPixel> for the current processor instance.
protected Image<TPixel> Source { get; }
Property Value
- Image<TPixel>
SourceRectangle
Gets The source area to process for the current processor instance.
protected Rectangle SourceRectangle { get; }
Property Value
Methods
AfterFrameApply(ImageFrame<TPixel>)
This method is called after the process is applied to prepare the processor.
protected virtual void AfterFrameApply(ImageFrame<TPixel> source)
Parameters
source
ImageFrame<TPixel>The source image. Cannot be null.
AfterImageApply()
This method is called after the process is applied to prepare the processor.
protected virtual void AfterImageApply()
Apply(ImageFrame<TPixel>)
Applies the processor to a single image frame.
public void Apply(ImageFrame<TPixel> source)
Parameters
source
ImageFrame<TPixel>the source image.
BeforeFrameApply(ImageFrame<TPixel>)
This method is called before the process is applied to prepare the processor.
protected virtual void BeforeFrameApply(ImageFrame<TPixel> source)
Parameters
source
ImageFrame<TPixel>The source image. Cannot be null.
BeforeImageApply()
This method is called before the process is applied to prepare the processor.
protected virtual void BeforeImageApply()
Dispose()
public void Dispose()
Dispose(bool)
Disposes the object and frees resources for the Garbage Collector.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolWhether to dispose managed and unmanaged objects.
OnFrameApply(ImageFrame<TPixel>)
Applies the process to the specified portion of the specified ImageFrame<TPixel> at the specified location and with the specified size.
protected abstract void OnFrameApply(ImageFrame<TPixel> source)
Parameters
source
ImageFrame<TPixel>The source image. Cannot be null.