Regular API function

simGetScaledImage / sim.getScaledImage

Description Generates a scaled-up or scaled down version of the input image. See also sim.transformImage, sim.loadImage, sim.saveImage and sim.setVisionSensorImg.
C/C++
synopsis
simUChar* simGetScaledImage(const simUChar* imageIn,const simInt* resolutionIn,const simInt* resolutionOut,simInt options,simVoid* reserved)
C/C++
parameters
imageIn: a pointer to rgb or rgba values of the input image.
resolutionIn: the resolution of the input image.
resolutionOut: the desired resolution of the output image. The values will be replaced by the effective resolution of the output image
options: bit-coded:
bit0 set (1): the input image is rgba, otherwise it is rgb
bit1 set (2): the returned image is rgba, otherwise it is rgb
bit2-3: 0:ignore aspect ratio, 4:keep aspect ratio (the effective resolution of the returned image will be different), 8:keep aspect ratio by expanding (the effective resolution of the returned image will be different)
bit4 set (16): no smooth transformation
reserved: Reserved for future extension. Set to nullptr.
C/C++
return value
nullptr if operation was not successful, otherwise a buffer containing the output image data. The user is in charge of releasing the buffer with simReleaseBuffer.
Lua
synopsis
buffer imageOut,int[2] effectiveResolutionOut=sim.getScaledImage(buffer imageIn,int[2] resolutionIn,int[2] desiredResolutionOut,int options)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
bytes imageOut,list effectiveRolutionOut=sim.getScaledImage(bytes imageIn,list resolutionIn,list desiredResolutionOut,int options)