Class ImageContext
public abstract class ImageContext
- Inheritance
-
ImageContext
- Derived
- Inherited Members
Constructors
ImageContext(Type)
protected ImageContext(Type imageType)
Parameters
imageTypeType
Properties
ImageType
public Type ImageType { get; }
Property Value
SupportsJpeg2000
protected virtual bool SupportsJpeg2000 { get; }
Property Value
SupportsTiff
protected virtual bool SupportsTiff { get; }
Property Value
TiffWriter
public virtual ITiffWriter TiffWriter { get; }
Property Value
Methods
CheckSupportsFormat(ImageFileFormat)
public void CheckSupportsFormat(ImageFileFormat format)
Parameters
formatImageFileFormat
Create(int, int, ImagePixelFormat)
Creates a new empty image.
public abstract IMemoryImage Create(int width, int height, ImagePixelFormat pixelFormat)
Parameters
widthintThe image width in pixels.
heightintThe image height in pixels.
pixelFormatImagePixelFormatThe image's pixel format.
Returns
GetFileFormatFromExtension(string)
public static ImageFileFormat GetFileFormatFromExtension(string path)
Parameters
pathstring
Returns
GetFileFormatFromFirstBytes(byte[])
public static ImageFileFormat GetFileFormatFromFirstBytes(byte[] firstBytes)
Parameters
firstBytesbyte[]
Returns
Load(byte[])
public IMemoryImage Load(byte[] bytes)
Parameters
bytesbyte[]
Returns
Load(Stream)
Decodes an image from the given stream.
public IMemoryImage Load(Stream stream)
Parameters
streamStreamThe image data, in a common format (JPEG, PNG, etc).
Returns
Load(string)
Loads an image from the given file path.
public IMemoryImage Load(string path)
Parameters
pathstringThe image path.
Returns
LoadCore(Stream, ImageFileFormat)
protected abstract IMemoryImage LoadCore(Stream stream, ImageFileFormat format)
Parameters
streamStreamformatImageFileFormat
Returns
LoadFrames(Stream, ProgressHandler)
Loads an image that may have multiple frames (e.g. a TIFF file) from the given stream.
public IAsyncEnumerable<IMemoryImage> LoadFrames(Stream stream, ProgressHandler progress = default)
Parameters
streamStreamThe image data, in a common format (JPEG, PNG, etc).
progressProgressHandlerThe progress callback and/or cancellation token.
Returns
LoadFrames(string, ProgressHandler)
Loads an image that may have multiple frames (e.g. a TIFF file) from the given file path.
public IAsyncEnumerable<IMemoryImage> LoadFrames(string path, ProgressHandler progress = default)
Parameters
pathstringThe image path.
progressProgressHandlerThe progress callback and/or cancellation token.
Returns
LoadFramesCore(Action<IMemoryImage>, Stream, ImageFileFormat, ProgressHandler)
protected abstract void LoadFramesCore(Action<IMemoryImage> produceImage, Stream stream, ImageFileFormat format, ProgressHandler progress)
Parameters
produceImageAction<IMemoryImage>streamStreamformatImageFileFormatprogressProgressHandler
PerformAllTransforms(IMemoryImage, IEnumerable<Transform>)
Performs the specified transformations on the specified image using a compatible transformer.
public IMemoryImage PerformAllTransforms(IMemoryImage image, IEnumerable<Transform> transforms)
Parameters
imageIMemoryImagetransformsIEnumerable<Transform>
Returns
PerformTransform(IMemoryImage, Transform)
Performs the specified transformation on the specified image using a compatible transformer.
public abstract IMemoryImage PerformTransform(IMemoryImage image, Transform transform)
Parameters
imageIMemoryImagetransformTransform
Returns
Render(IRenderableImage)
public IMemoryImage Render(IRenderableImage image)
Parameters
imageIRenderableImage
Returns
RenderWithoutTransforms(IRenderableImage)
public IMemoryImage RenderWithoutTransforms(IRenderableImage image)
Parameters
imageIRenderableImage
Returns
SupportsFormat(ImageFileFormat)
public bool SupportsFormat(ImageFileFormat format)
Parameters
formatImageFileFormat