Table of Contents

Class ProcessedImage

Namespace
NAPS2.Images
Assembly
NAPS2.Sdk.dll

An image that has gone through the scanning (or importing) process. It has metadata about the image, possibly additional post-processing data from the scan, and may have transformations that have been applied during or after the scan.

This type is immutable and uses a reference counting model for the underlying image storage. You can create a new reference with Clone() that will need to be disposed, and the underlying image storage will only be disposed once all related instances are disposed (or the parent ScanningContext is disposed).

public class ProcessedImage : IRenderableImage, IDisposable, IEquatable<ProcessedImage>
Inheritance
ProcessedImage
Implements
Inherited Members

Properties

ImageContext

public ImageContext ImageContext { get; }

Property Value

ImageContext

Metadata

public ImageMetadata Metadata { get; }

Property Value

ImageMetadata

PostProcessingData

public PostProcessingData PostProcessingData { get; }

Property Value

PostProcessingData

Storage

public IImageStorage Storage { get; }

Property Value

IImageStorage

TransformState

public TransformState TransformState { get; }

Property Value

TransformState

Methods

Clone()

Creates a new ProcessedImage instance with the same underlying image storage/metadata. All instances will need to be disposed before the underlying image storage is disposed.

public ProcessedImage Clone()

Returns

ProcessedImage

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Equals(ProcessedImage?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ProcessedImage? other)

Parameters

other ProcessedImage

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetWeakReference()

Creates a WeakReference wrapper for the current instance that doesn't have any effect on the instance's lifetime.

public ProcessedImage.WeakReference GetWeakReference()

Returns

ProcessedImage.WeakReference

WithNoTransforms(bool)

Creates a new ProcessedImage instance with the same underlying image storage/metadata and no transforms. All instances will need to be disposed before the underlying image storage is disposed.

public ProcessedImage WithNoTransforms(bool disposeSelf = false)

Parameters

disposeSelf bool

Returns

ProcessedImage

WithPostProcessingData(PostProcessingData, bool)

public ProcessedImage WithPostProcessingData(PostProcessingData postProcessingData, bool disposeSelf)

Parameters

postProcessingData PostProcessingData
disposeSelf bool

Returns

ProcessedImage

WithTransform(Transform, bool)

Creates a new ProcessedImage instance with the same underlying image storage/metadata and a new transform appended to the TransformState. All instances will need to be disposed before the underlying image storage is disposed.

public ProcessedImage WithTransform(Transform transform, bool disposeSelf = false)

Parameters

transform Transform
disposeSelf bool

Returns

ProcessedImage

WithTransformState(TransformState, bool)

Creates a new ProcessedImage instance with the same underlying image storage/metadata and a new transform state. All instances will need to be disposed before the underlying image storage is disposed.

public ProcessedImage WithTransformState(TransformState newTransformState, bool disposeSelf = false)

Parameters

newTransformState TransformState
disposeSelf bool

Returns

ProcessedImage