Click or drag to resize
SoConversionConvertFloatToRGBA Method (SoBufferObject, SoBufferObject, UInt64, Single, Single)

Convert FLOAT data stored in a buffer to (grayscale) RGBA data.

Namespace: OIV.Inventor.Algorithms
Assembly: OIV.Inventor.Algorithms (in OIV.Inventor.Algorithms.dll) Version: 2024.2.2.0 (10.16.2.0)
Syntax
public int ConvertFloatToRGBA(
	SoBufferObject sourceBufferObject,
	SoBufferObject targetBufferObject,
	ulong size,
	float dataMin,
	float dataMax
)

Parameters

sourceBufferObject
Type: OIV.Inventor.DevicesSoBufferObject

The source buffer object containing the FLOAT data.

targetBufferObject
Type: OIV.Inventor.DevicesSoBufferObject

The target buffer object.

size
Type: SystemUInt64

The number of FLOAT values to convert.

dataMin
Type: SystemSingle

The minimum value for the greyscale conversion.

dataMax
Type: SystemSingle

The maximum value for the greyscale conversion.

Return Value

Type: Int32

Returns 0 if there were no errors during the process. Returns 1 if one or more buffers don't have the correct size.

Remarks

  • The source and the target buffers can be the same.

  • The algorithm maps float values between dataMin and dataMax to the range 0..255.

  • The resulting values are clamped to 0..255.

See Also