|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
22 #ifndef __NVWARP360_H__
23 #define __NVWARP360_H__
25 #include <cuda_runtime.h>
33 #if defined(_WIN32) || defined(_WIN64)
34 #define NVWARPAPI __stdcall
181 #endif // __cplusplus
284 #define NVWARP_VERSION_MAJOR(version) (((v) >> 24) & 0xff)
289 #define NVWARP_VERSION_MINOR(version) (((v) >> 16) & 0xff)
294 #define NVWARP_VERSION_REVISION(version) (((v) >> 8) & 0xff)
569 uint32_t dstWidth, uint32_t dstHeight);
888 void *rgbBuffer,
size_t rgbRowBytes, cudaTextureObject_t rgbTex,
889 uint32_t numWarps,
const nvwarpParams_t *paramArray,
void **dstBuffers,
const size_t *dstRowBytes);
894 #endif // __cplusplus
void NVWARPAPI nvwarpSetUserData(nvwarpHandle han, void *userData)
Set the user data pointer.
nvwarpResult NVWARPAPI nvwarpComputeBoxAxialAngleRange(const nvwarpParams_t *params, const float srcBoundingBox[4], float minMaxXY[4])
Compute the angular limits on the source bounding box along the primary axes going through the center...
nvwarpResult NVWARPAPI nvwarpDstToRay(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *rays3D)
Convert destination coordinates into normalized rays.
@ NVSURF_PUSHBROOM
Simulated pushbroom. Control[0] typically in (0, 1].
@ NVWARP_ERR_DOMAIN
The coordinates are outside of the domain.
@ NVWARP_ERR_CUDA_MEMORY
There is not enough CUDA memory for the operation specified.
uint32_t width
The width of the Y and RGB channels (chroma has half the width, but is interleaved in NV12).
struct nvwarpParams_t nvwarpParams_t
Parameter structure.
void NVWARPAPI nvwarpSetSrcPrincipalPoint(nvwarpHandle han, const float xy[2], uint32_t relToCenter)
Specify the principal point of the source image.
@ NVWARP_ERR_CUDA_LAUNCH
CUDA was not able to launch the specified kernel.
void NVWARPAPI nvwarpGetDstPrincipalPoint(const nvwarpHandle han, float xy[2], uint32_t relToCenter)
Get the destination principal point.
void NVWARPAPI nvwarpDestroyInstance(nvwarpHandle han)
Destructor for a Warp360 object.
float NVWARPAPI nvwarpGetSrcRadius(const nvwarpHandle han)
Get the source fisheye clipping radius.
@ NVSURF_CYLINDER
Cylindrical, panned horizontally with vertical axis.
void NVWARPAPI nvwarpGetParams(const nvwarpHandle han, nvwarpParams_t *params)
Get the current values of the warp parameters.
nvwarpResult NVWARPAPI nvwarpSetWarpType(nvwarpHandle han, nvwarpType_t type)
Set the warp type.
void NVWARPAPI nvwarpGetDstWidthHeight(const nvwarpHandle han, uint32_t wh[2])
Get the destination width and height.
@ NVWARP_ERR_GENERAL
An otherwise unspecified failure has occurred.
nvwarpResult NVWARPAPI nvwarpComputeSrcFocalLength(nvwarpHandle han, nvwarpType_t warpType, float radius, float angle, float dist[5])
Compute the source focal length, primarily from a radius and corresponding angle (e....
nvwarpResult NVWARPAPI nvwarpWarpSurface(const nvwarpHandle han, cudaStream_t stream, cudaTextureObject_t srcTex, cudaSurfaceObject_t dstSurface)
Warp an image texture to a surface.
nvwarpResult NVWARPAPI nvwarpMultiWarp360(cudaStream_t stream, const nvwarpYUVRGBParams_t *yuvParams, const void *yuvBuffer, size_t yuvRowBytes, void *rgbBuffer, size_t rgbRowBytes, cudaTextureObject_t rgbTex, uint32_t numWarps, const nvwarpParams_t *paramArray, void **dstBuffers, const size_t *dstRowBytes)
Perform an optional YUV:420:NV12 --> RGBA conversion, followed by a suite of warps from that conversi...
@ NVSURF_UNKNOWN
Unknown (currently 255).
float srcY0
Source center of projection Y; frequently (srcHeight - 1) * 0.5, but srcHeight * ....
@ NVWARP_ERR_PARAMETER
A parameter has an invalid value.
uint32_t srcHeight
The height of the source image.
@ NVSURF_FISHEYE
Fisheye, equidistant.
float topAngle
Top angle of view. (default +pi/2)
void NVWARPAPI nvwarpSetDstPrincipalPoint(nvwarpHandle han, const float xy[2], uint32_t relToCenter)
Set the destination principal point.
void NVWARPAPI nvwarpInitParams(nvwarpParams_t *params)
Initialize nvwarpParams_t to defaults or NaN if a particular parameter must be supplied.
@ NVWARP_ERR_CUDA
An otherwise unspecified error has been reported by the CUDA runtime.
float gy
Coefficients for G with respect to Y, including normalization scaling.
@ NVSURF_ROTCYLINDER
Cylindrical, panned vertically, with horizontal axis.
@ NVWARP_EQUIRECT_CYLINDER
Equirectangular to cylindrical.
@ NVWARP_EQUIRECT_FISHEYE
Equirectangular to fisheye.
@ NVSURF_BITS
The width of the field used for each image type.
float rcb
Coefficients for R with respect to Cb, including normalization scaling.
Parameters for YUV:420:NV12 --> RGBA conversion.
void NVWARPAPI nvwarpGetBlock(const nvwarpHandle han, dim3 *dim_block)
Get the current value of the CUDA block size.
float srcFocalLen
Source focal length.
void *NVWARPAPI nvwarpGetUserData(nvwarpHandle han)
Get the current value of the user data pointer.
@ NVWARP_ERR_MISSING_PARAMETERS
Some required parameters have not been specified.
void NVWARPAPI nvwarpConvertTransformBetweenYUpandYDown(const float fr[9], float to[9])
Invert the sense of the Y- and Z-axes in the specified transformation, keeping the X axis pointing in...
nvwarpType_t
Warp type enumeration.
uint32_t dstWidth
The width of the destination.
float NVWARPAPI nvwarpGetSrcFocalLength(const nvwarpHandle han, float *fy)
Get one or both source focal lengths.
@ NVWARP_EQUIRECT_PUSHBROOM
Equirectangular to pushbroom.
uint32_t srcWidth
The width of the source image.
const char *NVWARPAPI nvwarpErrorStringFromCode(nvwarpResult err)
Get the error string corresponding to the given result code.
@ NVWARP_FISHEYE_CYLINDER
Fisheye to horizontally panned cylinder.
struct nvwarpYUVRGBParams_t nvwarpYUVRGBParams_t
Parameters for YUV:420:NV12 --> RGBA conversion.
@ NVWARP_ERR_CUDA_NO_KERNEL
No suitable CUDA kernel image has been found for this GPU.
@ NVSURF_MAX
This makes it 32 bits.
float ry
Coefficients for R with respect to Y, including normalization scaling.
struct nvwarpObject * nvwarpHandle
Opaque definition of a pointer to the Warp360 state.
nvwarpResult NVWARPAPI nvwarpInverseWarpCoordinates(const nvwarpHandle han, uint32_t numPts, const float *inPtsXY, float *outPtsXY)
Transform coordinates from the destination space to the source space.
enum nvwarpResult nvWarpResult
Error code enumerations for NVWarp360.
void NVWARPAPI nvwarpSetBlock(nvwarpHandle han, dim3 dim_block)
Set the CUDA block size.
float yOffset
Offset of luma, typically 16.
float srcX0
Source center of projection X; frequently (srcWidth - 1) * 0.5, but srcWidth * .5 for wraparounds (eq...
float bcr
Coefficients for B with respect to Cr, including normalization scaling.
void NVWARPAPI nvwarpSetControl(nvwarpHandle han, uint32_t index, float control)
Set a control parameter.
@ NVWARP_ERR_APPROXIMATE
An accurate calculation is not available; approximation returned.
float srcRadius
Source circular clipping radius. (default 0 means no clipping) (unimplemented).
void NVWARPAPI nvwarpComputeYCbCr2RgbMatrix(nvwarpYUVRGBParams_t *p, uint32_t matrix_coefficients, uint32_t video_full_range_flag, uint32_t bit_depth, uint32_t normalized_input, uint32_t normalized_output)
General method to compute all values except for {width, height, cLocation}.
float rotAngles[3]
Rotation angles in radians, corresponding to the list of rotation axes below..
uint32_t dstHeight
The height of the destination.
nvwarpResult NVWARPAPI nvwarpCreateInstance(nvwarpHandle *han)
Constructor for a new instance of a Warp360 object.
nvwarpType_t
Warp type enumeration.
uint32_t NVWARPAPI nvwarpGetPixelPhase(const nvwarpHandle han)
Get the pixel phase.
nvwarpResult NVWARPAPI nvwarpComputeSrcAngularFromPixelCoordinates(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *ang2D)
Compute the angular coordinates {longitude, latitude} of for the given points in the source.
@ NVWARP_ERR_INITIALIZATION
Initialization has not completed successfully.
@ NVSURF_PANINI
Panini. Control[0] typically in (0, 1].
float NVWARPAPI nvwarpGetDstFocalLength(const nvwarpHandle han, float *fy)
Get one or both destination focal lengths.
void NVWARPAPI nvwarpGetRotation(const nvwarpHandle han, float R[9])
Get the rotation matrix.
nvwarpResult NVWARPAPI nvwarpComputeDstAngularFromPixelCoordinates(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *ang2D)
Compute the angular coordinates {longitude, latitude} of for the given points in the destination.
@ NVWARP_NONE
This makes it 32 bits.
@ NVSURF_MASK
The NVWARP_360 mask (currently 0xFF).
nvwarpResult
Error code enumerations for NVWarp360.
@ NVWARP_EQUIRECT_PANINI
Equirectangular to Panini.
float cOffset
Offset of chroma, typically 128.
nvwarpResult NVWARPAPI nvwarpWarpCoordinates(const nvwarpHandle han, uint32_t numPts, const float *inPtsXY, float *outPtsXY)
Transform coordinates from the input space to the output space.
@ NVWARP_ERR_UNIMPLEMENTED
The requested feature has not yet been implemented.
float bcb
Coefficients for B with respect to Cb, including normalization scaling.
nvwarpResult NVWARPAPI nvwarpSetParams(nvwarpHandle han, const nvwarpParams_t *params)
Set parameters for a warp.
@ NVWARP_FISHEYE_PANINI
Fisheye to Panini.
nvwarpResult NVWARPAPI nvwarpDstFromRay(const nvwarpHandle han, uint32_t numRays, const float *rays3D, float *pts2D)
Convert rays into destination coordinates.
void NVWARPAPI nvwarpSetEulerRotation(nvwarpHandle han, const float *angles, const char *axes)
Specify the view rotation, using a list of angles and their respective axes of rotation.
void NVWARPAPI nvwarpSetPixelPhase(nvwarpHandle han, uint32_t phase)
Set the pixel phase.
@ NVWARP_FISHEYE_EQUIRECT
Fisheye to equirectangular.
@ NVWARP_EQUIRECT_STEREOGRAPHIC
Equirectangular to generalized stereographic.
@ NVWARP_PERSPECTIVE_EQUIRECT
Perspective to equirectangular.
@ NVWARP_FISHEYE_PERSPECTIVE
Fisheye to perspective.
float by
Coefficients for B with respect to Y, including normalization scaling.
char rotAxes[4]
3 rotation axes: upper case 'X', 'Y', and 'Z' are rotation about the positive X, Y and Z axes,...
@ NVWARP_ERR_MAX
This makes it 32 bits.
void NVWARPAPI nvwarpSetSrcWidthHeight(nvwarpHandle han, uint32_t w, uint32_t h)
Set the source dimensions.
nvwarpResult NVWARPAPI nvwarpComputeDstPixelFromAngularCoordinates(const nvwarpHandle han, uint32_t numPts, const float *ang2D, float *pts2D)
Compute the pixel coordinates for the given angular coordinates {longitude, latitude} in the destinat...
nvwarpResult NVWARPAPI nvwarpComputeSrcPixelFromAngularCoordinates(const nvwarpHandle han, uint32_t numPts, const float *ang2D, float *pts2D)
Compute the pixel coordinates for the given angular coordinates {longitude, latitude} in the source.
float bottomAngle
Bottom angle of view. (default -pi/2)
uint32_t height
The height of the Y and RGB channels (chroma has half the height, so this must be even).
nvwarpResult NVWARPAPI nvwarpComputeParamsOutputResolution(nvwarpParams_t *params, float aspectRatio)
Compute the output resolution that matches the source focal length and desired aspect ratio.
void NVWARPAPI nvwarpGetSrcWidthHeight(const nvwarpHandle han, uint32_t wh[2])
Get the source image dimensions.
nvwarpResult NVWARPAPI nvwarpComputeDstFocalLengths(nvwarpHandle han, float topAxialAngle, float botAxialAngle, float leftAxialAngle, float rightAxialAngle, uint32_t dstWidth, uint32_t dstHeight)
From the vertical and horizontal axial view angles, this sets the anisotropic destination focal lengt...
void NVWARPAPI nvwarpSetRotation(nvwarpHandle han, const float R[9])
Specify the rotation.
float gcr
Coefficients for G with respect to Cr, including normalization scaling.
void NVWARPAPI nvwarpGetDistortion(const nvwarpHandle han, float d[5])
Get the distortion coefficients.
@ NVSURF_EQUIRECT
Equirectangular spherical.
float gcb
Coefficients for G with respect to Cb, including normalization scaling.
nvwarpResult NVWARPAPI nvwarpWarpBuffer(const nvwarpHandle han, cudaStream_t stream, cudaTextureObject_t srcTex, void *dstAddr, size_t dstRowBytes)
Warp an image texture to a buffer.
float dist[5]
Distortion, typically for the source. (default {0,0,0,0} means no distortion).
@ NVWARP_EQUIRECT_PERSPECTIVE
Equirectangular to perspective.
void NVWARPAPI nvwarpSetDistortion(nvwarpHandle han, const float d[5])
Set the distortion coefficients.
nvwarpResult NVWARPAPI nvwarpComputeParamsSrcFocalLength(nvwarpParams_t *params, float angle, float radius)
Compute and set the srcFocalLen given the warp type and srcDist distortion coefficients,...
@ NVWARP_EQUIRECT_EQUIRECT
Equirectangular to equirectangular.
void NVWARPAPI nvwarpComputeDstFocalLength(nvwarpHandle han, float topAngle, float bottomAngle, uint32_t dstWidth, uint32_t dstHeight)
From the vertical view angles, this sets the identical destination focal lengths, plus width and heig...
void NVWARPAPI nvwarpGetSrcPrincipalPoint(const nvwarpHandle han, float xy[2], uint32_t relToCenter)
Get the source principal point.
@ NVSURF_STEREOGRAPHIC
Generalized Stereographic. Normal stereographic has control[0] = 1.
uint32_t NVWARPAPI nvwarpVersion()
Get the version number, encoded as (major_version * 16777216u + minor * 65536u + revision * 256u).
nvwarpResult NVWARPAPI nvwarpConvertYUVNV12ToRGBA(cudaStream_t stream, const nvwarpYUVRGBParams_t *params, const void *yuv, size_t yuvRowBytes, void *dst, size_t dstRowBytes)
Perform YUV 4:2:0 NV12 --> RGBA conversion.
void NVWARPAPI nvwarpSetSrcRadius(nvwarpHandle han, float r)
set the source fisheye clipping radius.
@ NVWARP_FISHEYE_PUSHBROOM
Fisheye to pushbroom.
float control[4]
Projection-specific controls.
nvwarpResult NVWARPAPI nvwarpSrcToRay(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *rays3D)
Convert source coordinates into normalized rays.
void NVWARPAPI nvwarpSetDstWidthHeight(nvwarpHandle han, uint32_t w, uint32_t h)
Set the destination width and height.
@ NVWARP_ERR_CUDA_DRIVER
CUDA driver version is insufficient for CUDA runtime version.
void NVWARPAPI nvwarpSetSrcFocalLengths(nvwarpHandle han, float fl, float fy)
Set the source focal length.
@ NVSURF_PERSPECTIVE
Perspective, projective, rectilinear.
nvwarpType_t NVWARPAPI nvwarpGetWarpType(const nvwarpHandle han)
Get the type of the warp.
struct nvwarpObject * nvwarpHandle
Opaque definition of a pointer to the Warp360 state.
float NVWARPAPI nvwarpGetControl(const nvwarpHandle han, uint32_t index)
Get the value for the control parameters.
@ NVWARP_PERSPECTIVE_PERSPECTIVE
Perspective to perspective.
@ NVWARP_PERSPECTIVE_PANINI
Perspective to Panini.
@ NVWARP_FISHEYE_ROTCYLINDER
Fisheye to vertically panned radial cylinder.
@ NVWARP_EQUIRECT_ROTCYLINDER
Equirectangular to vertical cylindrical.
nvwarpType_t type
The type of the warp.
nvwarpResult NVWARPAPI nvwarpComputeParamsAxialAngleRange(const nvwarpParams_t *params, float minMaxXY[4])
Compute the angular limits on the source image along the primary axes going through the center of pro...
void NVWARPAPI nvwarpSetDstFocalLengths(nvwarpHandle han, float fl, float fy)
Set the destination focal length.
void * userData
Pointer supplied by the user. (default NULL)
float rcr
Coefficients for R with respect to Cr, including normalization scaling.
#define NVWARPAPI
export tag
@ NVWARP_SUCCESS
The operation was successful.
@ NVWARP_FISHEYE_FISHEYE
Fisheye to fisheye.
nvwarpResult NVWARPAPI nvwarpSrcFromRay(const nvwarpHandle han, uint32_t numRays, const float *rays3D, float *pts2D)
Convert rays into source coordinates.
uint32_t cLocation
0 for chroma sampled cosited horizontally with luma; 1 for chroma sampled halfway between luma sample...