Class ImageBase<TImage>
- Namespace
- FellowOakDicom.Imaging
- Assembly
- fo-dicom.core.dll
Base class for image implementations.
public abstract class ImageBase<TImage> : IImage, IDisposable where TImage : class
Type Parameters
TImage
Image implementation type.
- Inheritance
-
ImageBase<TImage>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ImageBase(int, int, PinnedIntArray, TImage)
Initializes an instance of the ImageBase<TImage> object.
protected ImageBase(int width, int height, PinnedIntArray pixels, TImage image)
Parameters
width
intImage width.
height
intImage height.
pixels
PinnedIntArrayArray of pixels.
image
TImageImage object.
Fields
_disposed
protected bool _disposed
Field Value
_height
protected readonly int _height
Field Value
_image
protected TImage _image
Field Value
- TImage
_pixels
protected PinnedIntArray _pixels
Field Value
_width
protected readonly int _width
Field Value
Properties
Height
public int Height { get; }
Property Value
Pixels
Gets the array of pixels associated with the image.
public PinnedIntArray Pixels { get; }
Property Value
Width
public int Width { get; }
Property Value
Methods
As<T>()
Cast IImage object to specific (real image) type.
public virtual T As<T>()
Returns
- T
IImage object as specific (real image) type.
Type Parameters
T
Real image type to cast to.
Clone()
Creates a deep copy of the image.
public abstract IImage Clone()
Returns
- IImage
Deep copy of this image.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Dispose resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolDispose mode?
DrawGraphics(IEnumerable<IGraphic>)
Draw graphics onto existing image.
public abstract void DrawGraphics(IEnumerable<IGraphic> graphics)
Parameters
graphics
IEnumerable<IGraphic>Graphics to draw.
~ImageBase()
Destructor to free up the image resources.
protected ~ImageBase()
GetPixel(int, int)
public Color32 GetPixel(int x, int y)
Parameters
Returns
Render(int, bool, bool, int)
Renders the image given the specified parameters.
public abstract void Render(int components, bool flipX, bool flipY, int rotation)
Parameters
components
intNumber of components.
flipX
boolFlip image in X direction?
flipY
boolFlip image in Y direction?
rotation
intImage rotation.
ToBytes(ref int, ref int, int, bool, bool, int, int[])
protected static byte[] ToBytes(ref int width, ref int height, int components, bool flipX, bool flipY, int rotation, int[] data)
Parameters
Returns
- byte[]