Table of Contents

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 int

Image width.

height int

Image height.

pixels PinnedIntArray

Array of pixels.

image TImage

Image object.

Fields

_disposed

protected bool _disposed

Field Value

bool

_height

protected readonly int _height

Field Value

int

_image

protected TImage _image

Field Value

TImage

_pixels

protected PinnedIntArray _pixels

Field Value

PinnedIntArray

_width

protected readonly int _width

Field Value

int

Properties

Height

public int Height { get; }

Property Value

int

Pixels

Gets the array of pixels associated with the image.

public PinnedIntArray Pixels { get; }

Property Value

PinnedIntArray

Width

public int Width { get; }

Property Value

int

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 bool

Dispose 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

x int
y int

Returns

Color32

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 int

Number of components.

flipX bool

Flip image in X direction?

flipY bool

Flip image in Y direction?

rotation int

Image 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

width int
height int
components int
flipX bool
flipY bool
rotation int
data int[]

Returns

byte[]