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