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