ComputeDeviceCreateDeviceArrayViewColorRGBAf Method (OpenCLMemPointer, UInt64, UInt64, OpenCLCommandQueuePtr) |
Create a non-owning DeviceArrayView of ColorRGBAf over an externally-owned OpenCL memory object
Namespace:
Zivid.NET
Assembly:
ZividCoreNET (in ZividCoreNET.dll) Version: 2.18.0.0
Syntaxpublic DeviceArrayView<ColorRGBAf> CreateDeviceArrayViewColorRGBAf(
OpenCLMemPointer openCLBuffer,
ulong width,
ulong height,
OpenCLCommandQueuePtr queue
)
Public Function CreateDeviceArrayViewColorRGBAf (
openCLBuffer As OpenCLMemPointer,
width As ULong,
height As ULong,
queue As OpenCLCommandQueuePtr
) As DeviceArrayView(Of ColorRGBAf)
public:
DeviceArrayView<ColorRGBAf>^ CreateDeviceArrayViewColorRGBAf(
OpenCLMemPointer openCLBuffer,
unsigned long long width,
unsigned long long height,
OpenCLCommandQueuePtr queue
)
Parameters
- openCLBuffer
- Type: Zivid.NETOpenCLMemPointer
Non-null OpenCL memory object (cl_mem) containing RGBA float32 data - width
- Type: SystemUInt64
Width of the image in pixels - height
- Type: SystemUInt64
Height of the image in pixels - queue
- Type: Zivid.NETOpenCLCommandQueuePtr
The OpenCL command queue the buffer's preparation work (allocation and any data
production) was enqueued on
Return Value
Type:
DeviceArrayViewColorRGBAfA non-owning
DeviceArrayViewNETFormat of
ColorRGBAf referencing the provided OpenCL memory
Remarks
The memory object must be created using the same OpenCL context used by the Zivid SDK. The memory must
contain tightly packed (interleaved) RGBA float32 pixel data. The returned DeviceArrayView does not take
ownership of the OpenCL memory; the caller must keep the object valid for the lifetime of the view and any
copies of it.
The queue exists solely so the SDK does not use the buffer before it is ready: an event is recorded on it
and the SDK's internal command queue waits on it. The queue is not stored on the view. When the view is
later passed to a fill variant, that method takes its own StreamOrQueue; it need not be the same queue.
Only available when the compute backend is OpenCL. Throws if called with a CUDA backend.
See Also