
simGetVisionSensorFilter
Description
|
Retrieves the parameters and settings of a specific filter component of a vision sensor. See also simSetVisionSensorFilter and the other vision sensor related API functions. |
C synopsis
|
simInt simGetVisionSensorFilter(simInt visionSensorHandle,simInt filterIndex,simInt* options,simInt* pSizes,simUChar** bytes,simInt** ints,simFloat** floats,simUChar** custom) |
C parameters |
filterIndex: the zero-based index of the filter position.
options: bit-coded return value:
bit 0 set (1): the component is enabled
pSizes: a pointer to 4 integer values receiving the sizes of the returned buffers (see next 4 arguments).
bytes: a buffer of bytes values representing the byte parameters of the filter component. The user is in charge of releasing that buffer with simReleaseBuffer.
ints: a buffer of ints values representing the int parameters of the filter component. The user is in charge of releasing that buffer with simReleaseBuffer.
floats: a buffer of floats values representing the float parameters of the filter component. The user is in charge of releasing that buffer with simReleaseBuffer.
custom: a buffer of bytes values representing the custom parameters of the filter component. The user is in charge of releasing that buffer with simReleaseBuffer.
USAGE EXAMPLE:
int options=0;
int sizes[4]={0,0,0,0};
unsigned char* bytes;
int* ints;
float* floats;
unsigned char* custom;
int filterType=simGetVisionSensorFilter(handle,index,&options,sizes,&bytes,&ints,&floats,&custom);
if (filterType>0)
{
// Modify options, bytes, ints, floats and custom
// ...
// Now write back the updated values:
simSetVisionSensorFilter(handle,index,options,sizes,bytes,ints,floats,custom);
// Destroy the buffers:
simReleaseBuffer((simChar*)bytes);
simReleaseBuffer((simChar*)ints);
simReleaseBuffer((simChar*)floats);
simReleaseBuffer((simChar*)custom);
}
|
C return value
|
-1 in case of an error, 0 if the filterIndex is not valid, otherwise the type of filter component pointed by the filterIndex.
|
Lua synopsis
|
number filterType,number options,table byteVals,table intVals,table floatVals,string customBuffer=simGetVisionSensorFilter(number sensorHandle,number filterIndex) |
Lua parameters |
Same as C-function
|
Lua return values
|
Similar as C-function
USAGE EXAMPLE:
local filterType,options,bytes,ints,floats,buffer=simGetVisionSensorFilter(handle,index)
if filterType>0 then
-- Modify options, bytes, ints, floats and buffer
-- ...
-- Now write back the updated values:
simSetVisionSensorFilter(handle,index,options,bytes,ints,floats,buffer)
end
|
All regular API functions on one page
|