Class CpuSharedImageContextFactory

Namespace
NT2I.ONNX.Hub
Assembly
NT2I.ONNX.Hub.dll

Factory par défaut pour SharedImageCoordinator. Produit des CpuSharedImageContext.

public sealed class CpuSharedImageContextFactory : ISharedImageContextFactory
Inheritance
CpuSharedImageContextFactory
Implements
Inherited Members

Constructors

CpuSharedImageContextFactory()

public CpuSharedImageContextFactory()

Properties

Device

Périphérique cible des contextes produits par cette factory (CPU, GPU, …).

public DataHandlingDeviceEnum Device { get; }

Property Value

DataHandlingDeviceEnum

Methods

Create(byte[], int, int)

Crée un contexte mono-image à partir d'une image BGR entrelacée.

public ISharedImageContext Create(byte[] bgrPackedImage, int width, int height)

Parameters

bgrPackedImage byte[]

Image BGR packed (B0 G0 R0 B1 G1 R1 …).

width int

Largeur en pixels.

height int

Hauteur en pixels.

Returns

ISharedImageContext

Un ISharedImageContext à disposer par l'appelant.

Exceptions

ArgumentNullException

Si bgrPackedImage est null.

Create(byte[][], int[], int[])

Crée un contexte multi-image (batch) à partir de N images BGR de tailles potentiellement hétérogènes.

public ISharedImageContext Create(byte[][] bgrPackedImages, int[] widths, int[] heights)

Parameters

bgrPackedImages byte[][]

Tableau de N images BGR packed.

widths int[]

Largeurs des N images (longueur N).

heights int[]

Hauteurs des N images (longueur N).

Returns

ISharedImageContext

Un ISharedImageContext à disposer par l'appelant.

Exceptions

ArgumentNullException

Si l'un des arguments est null.

ArgumentException

Si les tableaux n'ont pas tous la même longueur, ou si N=0.