Class CloningImageProcessor<TPixel>
The base class for all pixel specific cloning image processors. Allows the application of processing algorithms to the image. The image is cloned before operating upon and the buffers swapped upon completion.
Inherited Members
Namespace: SixLabors.ImageSharp.Processing.Processors
Assembly: SixLabors.ImageSharp.dll
Syntax
public abstract class CloningImageProcessor<TPixel> : ICloningImageProcessor<TPixel>, IImageProcessor<TPixel>, IDisposable where TPixel : struct, IPixel<TPixel>
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |
Constructors
| Improve this Doc View SourceCloningImageProcessor(Configuration, Image<TPixel>, Rectangle)
Initializes a new instance of the CloningImageProcessor<TPixel> class.
Declaration
protected CloningImageProcessor(Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration which allows altering default behaviour or extending the library. |
Image<TPixel> | source | The source Image<TPixel> for the current processor instance. |
Rectangle | sourceRectangle | The source area to process for the current processor instance. |
Properties
| Improve this Doc View SourceConfiguration
Gets the Configuration instance to use when performing operations.
Declaration
protected Configuration Configuration { get; }
Property Value
Type | Description |
---|---|
Configuration |
Source
Gets The source Image<TPixel> for the current processor instance.
Declaration
protected Image<TPixel> Source { get; }
Property Value
Type | Description |
---|---|
Image<TPixel> |
SourceRectangle
Gets The source area to process for the current processor instance.
Declaration
protected Rectangle SourceRectangle { get; }
Property Value
Type | Description |
---|---|
Rectangle |
Methods
| Improve this Doc View SourceAfterFrameApply(ImageFrame<TPixel>, ImageFrame<TPixel>)
This method is called after the process is applied to prepare the processor.
Declaration
protected virtual void AfterFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
Parameters
Type | Name | Description |
---|---|---|
ImageFrame<TPixel> | source | The source image. Cannot be null. |
ImageFrame<TPixel> | destination | The cloned/destination image. Cannot be null. |
AfterImageApply(Image<TPixel>)
This method is called after the process is applied to prepare the processor.
Declaration
protected virtual void AfterImageApply(Image<TPixel> destination)
Parameters
Type | Name | Description |
---|---|---|
Image<TPixel> | destination | The cloned/destination image. Cannot be null. |
BeforeFrameApply(ImageFrame<TPixel>, ImageFrame<TPixel>)
This method is called before the process is applied to prepare the processor.
Declaration
protected virtual void BeforeFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
Parameters
Type | Name | Description |
---|---|---|
ImageFrame<TPixel> | source | The source image. Cannot be null. |
ImageFrame<TPixel> | destination | The cloned/destination image. Cannot be null. |
BeforeImageApply(Image<TPixel>)
This method is called before the process is applied to prepare the processor.
Declaration
protected virtual void BeforeImageApply(Image<TPixel> destination)
Parameters
Type | Name | Description |
---|---|---|
Image<TPixel> | destination | The cloned/destination image. Cannot be null. |
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Disposes the object and frees resources for the Garbage Collector.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | Whether to dispose managed and unmanaged objects. |
GetDestinationSize()
Gets the size of the destination image.
Declaration
protected abstract Size GetDestinationSize()
Returns
Type | Description |
---|---|
Size | The Size. |
OnFrameApply(ImageFrame<TPixel>, ImageFrame<TPixel>)
Applies the process to the specified portion of the specified ImageFrame<TPixel> at the specified location and with the specified size.
Declaration
protected abstract void OnFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixel> destination)
Parameters
Type | Name | Description |
---|---|---|
ImageFrame<TPixel> | source | The source image. Cannot be null. |
ImageFrame<TPixel> | destination | The cloned/destination image. Cannot be null. |
Explicit Interface Implementations
| Improve this Doc View SourceICloningImageProcessor<TPixel>.CloneAndExecute()
Clones the specified Image<TPixel> and executes the process against the clone.
Declaration
Image<TPixel> ICloningImageProcessor<TPixel>.CloneAndExecute()
Returns
Type | Description |
---|---|
Image<TPixel> | The Image<TPixel>. |
IImageProcessor<TPixel>.Execute()
Executes the process against the specified Image<TPixel>.
Declaration
void IImageProcessor<TPixel>.Execute()