Class SegmentationAsBuffer
The role of this class is to take an incoming render texture, extract the index from the color channel and output an index buffer accessible on CPU side.
Inherited Members
Namespace: Mechatronics.SensorSDK
Syntax
public class SegmentationAsBuffer : Transcoder
Fields
_outputBuffer
Internal reference on the compute buffer used to transcode the segmentation data from a render texture into a uint buffer.
Declaration
protected ComputeBuffer _outputBuffer
Field Value
Type | Description |
---|---|
ComputeBuffer |
_outSegmentationBuffer
Internal reference on the output segmentation buffer.
Declaration
protected SegmentationBuffer _outSegmentationBuffer
Field Value
Type | Description |
---|---|
SegmentationBuffer |
renderTexture
Declaration
[Tooltip("RenderTexture with segmentation data.")]
[Field("RenderTexture", PortDirection.Left, FieldExtra.Read)]
[SerializeField]
protected PortType<RenderTexture> renderTexture
Field Value
Type | Description |
---|---|
PortType<RenderTexture> |
segmentationBuffer
Declaration
[Tooltip("Buffer with indexes.")]
[Field("SegmentationBuffer", PortDirection.Right, FieldExtra.Write)]
[SerializeField]
protected PortType<SegmentationBuffer> segmentationBuffer
Field Value
Type | Description |
---|---|
PortType<SegmentationBuffer> |
Methods
Disable()
Deactivate change event ports and release graphic resources.
Declaration
public override void Disable()
Overrides
Enable(Scheduler.ClockState)
Setup the change event on ports an load the compute shader for the data transcoding.
Declaration
public override void Enable(Scheduler.ClockState clockState)
Parameters
Type | Name | Description |
---|---|---|
Scheduler.ClockState | clockState | The parameters of the waveform associated to this node |
Overrides
PrepareOutputBuffer(Int32)
Create or resize the compute buffer used to store transcoded data.
Declaration
protected virtual void PrepareOutputBuffer(int bufferSizeRequired)
Parameters
Type | Name | Description |
---|---|---|
Int32 | bufferSizeRequired | Size in bytes required to store the data |
Transcode(CustomPassContext)
Run the compute shader to convert data from the render texture to the compute buffer and request a read back.
Declaration
protected override void Transcode(CustomPassContext ctx)
Parameters
Type | Name | Description |
---|---|---|
CustomPassContext | ctx |