Class MagicImageProcessor
Provides a set of methods for constructing a MagicScaler processing pipeline or for all-at-once processing of an image.
Inheritance
Namespace: PhotoSauce.MagicScaler
Assembly: PhotoSauce.MagicScaler.dll
Syntax
public static class MagicImageProcessor : Object
Methods
BuildPipeline(IImageContainer, ProcessImageSettings)
Constructs a new processing pipeline from which pixels can be retrieved.
Declaration
public static ProcessingPipeline BuildPipeline(IImageContainer imgContainer, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IImageContainer | imgContainer | A custom IImageContainer to use as input. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessingPipeline | A ProcessingPipeline containing the IPixelSource, settings used, and basic instrumentation for the pipeline. |
BuildPipeline(IPixelSource, ProcessImageSettings)
Constructs a new processing pipeline from which pixels can be retrieved.
Declaration
public static ProcessingPipeline BuildPipeline(IPixelSource imgSource, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IPixelSource | imgSource | A custom pixel source to use as input. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessingPipeline | A ProcessingPipeline containing the IPixelSource, settings used, and basic instrumentation for the pipeline. |
BuildPipeline(Stream, ProcessImageSettings)
Constructs a new processing pipeline from which pixels can be retrieved.
Declaration
public static ProcessingPipeline BuildPipeline(Stream imgStream, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | imgStream | A stream containing a supported input image container. The stream must allow Seek and Read. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessingPipeline | A ProcessingPipeline containing the IPixelSource, settings used, and basic instrumentation for the pipeline. |
BuildPipeline(String, ProcessImageSettings)
Constructs a new processing pipeline from which pixels can be retrieved.
Declaration
public static ProcessingPipeline BuildPipeline(string imgPath, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.String | imgPath | The path to a file containing the input image. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessingPipeline | A ProcessingPipeline containing the IPixelSource, settings used, and basic instrumentation for the pipeline. |
ProcessImage(IImageContainer, Stream, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(IImageContainer imgContainer, Stream outStream, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IImageContainer | imgContainer | A custom IImageContainer to use as input. |
System.IO.Stream | outStream | The stream to which the output image will be written. The stream must allow Seek and Write. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
ProcessImage(IImageContainer, String, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(IImageContainer imgContainer, string outPath, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IImageContainer | imgContainer | A custom IImageContainer to use as input. |
System.String | outPath | The path to which the output image will be written. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
Remarks
If outPath
already exists, it will be overwritten.
ProcessImage(IPixelSource, Stream, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(IPixelSource imgSource, Stream outStream, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IPixelSource | imgSource | A custom pixel source to use as input. |
System.IO.Stream | outStream | The stream to which the output image will be written. The stream must allow Seek and Write. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
ProcessImage(IPixelSource, String, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(IPixelSource imgSource, string outPath, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
IPixelSource | imgSource | A custom pixel source to use as input. |
System.String | outPath | The path to which the output image will be written. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
Remarks
If outPath
already exists, it will be overwritten.
ProcessImage(Stream, Stream, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(Stream imgStream, Stream outStream, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | imgStream | A stream containing a supported input image container. The stream must allow Seek and Read. |
System.IO.Stream | outStream | The stream to which the output image will be written. The stream must allow Seek and Write. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
ProcessImage(Stream, String, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(Stream imgStream, string outPath, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | imgStream | A stream containing a supported input image container. The stream must allow Seek and Read. |
System.String | outPath | The path to which the output image will be written. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
Remarks
If outPath
already exists, it will be overwritten.
ProcessImage(ReadOnlySpan<Byte>, Stream, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(ReadOnlySpan<byte> imgBuffer, Stream outStream, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | imgBuffer | A buffer containing a supported input image container. |
System.IO.Stream | outStream | The stream to which the output image will be written. The stream must allow Seek and Write. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
ProcessImage(ReadOnlySpan<Byte>, String, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(ReadOnlySpan<byte> imgBuffer, string outPath, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.ReadOnlySpan<System.Byte> | imgBuffer | A buffer containing a supported input image container. |
System.String | outPath | The path to which the output image will be written. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
Remarks
If outPath
already exists, it will be overwritten.
ProcessImage(String, Stream, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(string imgPath, Stream outStream, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.String | imgPath | The path to a file containing the input image. |
System.IO.Stream | outStream | The stream to which the output image will be written. The stream must allow Seek and Write. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
ProcessImage(String, String, ProcessImageSettings)
All-in-one processing of an image according to the specified settings
.
Declaration
public static ProcessImageResult ProcessImage(string imgPath, string outPath, ProcessImageSettings settings)
Parameters
Type | Name | Description |
---|---|---|
System.String | imgPath | The path to a file containing the input image. |
System.String | outPath | The path to which the output image will be written. |
ProcessImageSettings | settings | The settings for this processing operation. |
Returns
Type | Description |
---|---|
ProcessImageResult | A ProcessImageResult containing the settings used and basic instrumentation for the pipeline. |
Remarks
If outPath
already exists, it will be overwritten.