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
ILookupTable3DFactoryThe factory to use.
precision
BufferPrecisionPrecision of the input lookup table data.
extentX
intThe number of elements in the X dimension, which corresponds to the blue channel.
extentY
intThe number of elements, or rows, in the Y dimension, which corresponds to the green channel.
extentZ
intThe 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
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:
- For UInt8Normalized or UInt8NormalizedSrgb, use ColorRgba32. You can also use byte with 4 times as many elements.
- For UInt16Normalized, use ColorRgba64. You can also use ushort with 4 times as many elements.
- For Float16, use Half with each lookup table entry spanning 4 elements.
- For Float32, use ColorRgba128Float, Vector4Float, or Vector4. You can also use float with 4 times as many elements.
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
ILookupTable3DFactoryThe factory to use.
precision
BufferPrecisionPrecision of the input lookup table data.
extentX
intThe number of elements in the X dimension, which corresponds to the blue channel.
extentY
intThe number of elements, or rows, in the Y dimension, which corresponds to the green channel.
extentZ
intThe 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
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:
- For UInt8Normalized or UInt8NormalizedSrgb, use ColorRgba32. You can also use byte with 4 times as many elements.
- For UInt16Normalized, use ColorRgba64. You can also use ushort with 4 times as many elements.
- For Float16, use Half with each lookup table entry spanning 4 elements.
- For Float32, use ColorRgba128Float, Vector4Float, or Vector4. You can also use float with 4 times as many elements.
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.