Class ImageContext
public abstract class ImageContext
- Inheritance
-
ImageContext
- Derived
- Inherited Members
Constructors
ImageContext(Type)
protected ImageContext(Type imageType)
Parameters
imageType
Type
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
format
ImageFileFormat
Create(int, int, ImagePixelFormat)
Creates a new empty image.
public abstract IMemoryImage Create(int width, int height, ImagePixelFormat pixelFormat)
Parameters
width
intThe image width in pixels.
height
intThe image height in pixels.
pixelFormat
ImagePixelFormatThe image's pixel format.
Returns
GetFileFormatFromExtension(string)
public static ImageFileFormat GetFileFormatFromExtension(string path)
Parameters
path
string
Returns
GetFileFormatFromFirstBytes(byte[])
public static ImageFileFormat GetFileFormatFromFirstBytes(byte[] firstBytes)
Parameters
firstBytes
byte[]
Returns
Load(byte[])
public IMemoryImage Load(byte[] bytes)
Parameters
bytes
byte[]
Returns
Load(Stream)
Decodes an image from the given stream.
public IMemoryImage Load(Stream stream)
Parameters
stream
StreamThe 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
path
stringThe image path.
Returns
LoadCore(Stream, ImageFileFormat)
protected abstract IMemoryImage LoadCore(Stream stream, ImageFileFormat format)
Parameters
stream
Streamformat
ImageFileFormat
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
stream
StreamThe image data, in a common format (JPEG, PNG, etc).
progress
ProgressHandlerThe 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
path
stringThe image path.
progress
ProgressHandlerThe 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
produceImage
Action<IMemoryImage>stream
Streamformat
ImageFileFormatprogress
ProgressHandler
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
image
IMemoryImagetransforms
IEnumerable<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
image
IMemoryImagetransform
Transform
Returns
Render(IRenderableImage)
public IMemoryImage Render(IRenderableImage image)
Parameters
image
IRenderableImage
Returns
RenderWithoutTransforms(IRenderableImage)
public IMemoryImage RenderWithoutTransforms(IRenderableImage image)
Parameters
image
IRenderableImage
Returns
SupportsFormat(ImageFileFormat)
public bool SupportsFormat(ImageFileFormat format)
Parameters
format
ImageFileFormat