Table of Contents

Method CreateLookupTable3D

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.dll

CreateLookupTable3D<T>(ILookupTable3DFactory, BufferPrecision, int, int, int, ReadOnlySpan<T>)

Creates a 3D lookup table for mapping a 3-channel input to a 3-channel output. The table data must be provided in 4-channel format.
ID2D1DeviceContext2::CreateLookupTable3D()
ID2D1EffectContext1::CreateLookupTable3D()

public static ILookupTable3D CreateLookupTable3D<T>(this ILookupTable3DFactory factory, BufferPrecision precision, int extentX, int extentY, int extentZ, ReadOnlySpan<T> data) where T : unmanaged

Parameters

factory ILookupTable3DFactory

The factory to use.

precision BufferPrecision

Precision of the input lookup table data.

extentX int

The number of elements in the X dimension, which corresponds to the blue channel.

extentY int

The number of elements, or rows, in the Y dimension, which corresponds to the green channel.

extentZ int

The number of elements, or planes, in the Z dimension, which corresponds to the red channel.

data ReadOnlySpan<T>

Buffer holding the lookup table data. This total byte size of the buffer must be appropriate for the given precision and extents.

Returns

ILookupTable3D

Type Parameters

T

Remarks

The maximum extent in any direction is 256, which means that a 256x256x256 table using 32-bits per component will consume 64MB. Because lookup uses linear interpolation, much smaller tables will usually give good results.
T may be any unmanaged type, but it is recommended to use a type that is appropriate for the given precision and to simplify working with it. For example:

The total number of elements when using a 4-component data type must be extentX * extentY * extentZ.
If using byte, ushort, Half, or float, the number of elements must be 4 * extentX * extentY * extentZ.
The total byte size of the data buffer must be appropriate for the given precision and extents. The elements of type T are bitwise reinterpreted; they are neither converted nor cast.

CreateLookupTable3D<T>(ILookupTable3DFactory, BufferPrecision, int, int, int, T[])

Creates a 3D lookup table for mapping a 3-channel input to a 3-channel output. The table data must be provided in 4-channel format.
ID2D1DeviceContext2::CreateLookupTable3D()
ID2D1EffectContext1::CreateLookupTable3D()

public static ILookupTable3D CreateLookupTable3D<T>(this ILookupTable3DFactory factory, BufferPrecision precision, int extentX, int extentY, int extentZ, T[] data) where T : unmanaged

Parameters

factory ILookupTable3DFactory

The factory to use.

precision BufferPrecision

Precision of the input lookup table data.

extentX int

The number of elements in the X dimension, which corresponds to the blue channel.

extentY int

The number of elements, or rows, in the Y dimension, which corresponds to the green channel.

extentZ int

The number of elements, or planes, in the Z dimension, which corresponds to the red channel.

data T[]

Buffer holding the lookup table data. This total byte size of the buffer must be appropriate for the given precision and extents.

Returns

ILookupTable3D

Type Parameters

T

Remarks

The maximum extent in any direction is 256, which means that a 256x256x256 table using 32-bits per component will consume 64MB. Because lookup uses linear interpolation, much smaller tables will usually give good results.
T may be any unmanaged type, but it is recommended to use a type that is appropriate for the given precision and to simplify working with it. For example:

The total number of elements when using a 4-component data type must be extentX * extentY * extentZ.
If using byte, ushort, Half, or float, the number of elements must be 4 * extentX * extentY * extentZ.
The total byte size of the data buffer must be appropriate for the given precision and extents. The elements of type T are bitwise reinterpreted; they are neither converted nor cast.