NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/nvdewarper/Warp360/include/NVWarp360.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2017-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
21 
22 #ifndef __NVWARP360_H__
23 #define __NVWARP360_H__
24 
25 #include <cuda_runtime.h>
26 #include <stdint.h>
27 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #if defined(_WIN32) || defined(_WIN64)
34  #define NVWARPAPI __stdcall
35 #else /* !_WINxx */
36  #define NVWARPAPI
37 #endif /* _WINxx */
38 
48 
50 typedef enum nvwarpResult
51 {
65  NVWARP_ERR_MAX = 0x7fffffff
66 } nvWarpResult;
67 
68 // These are not used directly by the API.
69 typedef enum nvwarpSurface_t
70 {
79 
81  NVSURF_UNKNOWN = ((1 << NVSURF_BITS) - 1),
82  NVSURF_MASK = ((1 << NVSURF_BITS) - 1),
83  NVSURF_MAX = 0x7fffffff
85 
87 typedef enum nvwarpType_t
88 {
107  NVWARP_NONE = 0xffffffff
108 } nvwarpType_t;
109 
110 
111 
112 
127 
128 
131 struct nvwarpParams_t;
133 
134 
138 
139 
141 typedef struct nvwarpParams_t
142 {
143  // Warp type selector
145 
146  // Source specification
147  uint32_t srcWidth;
148  uint32_t srcHeight;
149  float srcX0;
150  float srcY0;
151  float srcFocalLen;
152  float srcRadius;
153 
154  float dist[5];
155 
156  // Destination specification
157  uint32_t dstWidth;
158  uint32_t dstHeight;
159 
160  // View specification
161  float rotAngles[3];
162  char rotAxes[4];
163 
169  float topAngle;
170  float bottomAngle;
171 
172  void* userData;
173 
174  // Warp controls
175  float control[4];
176 
177 #ifdef __cplusplus
178  nvwarpParams_t() { nvwarpInitParams(this); }
181 #endif // __cplusplus
182 
183 } nvwarpParams_t;
184 
185 
204 nvwarpResult NVWARPAPI nvwarpComputeParamsSrcFocalLength(nvwarpParams_t *params, float angle, float radius);
205 
216 
227 
238 nvwarpResult NVWARPAPI nvwarpComputeBoxAxialAngleRange(const nvwarpParams_t *params, const float srcBoundingBox[4], float minMaxXY[4]);
239 
240 
241 
249 
250 
252 struct nvwarpObject;
253 
255 typedef struct nvwarpObject *nvwarpHandle;
256 
261 
265 
266 
279 uint32_t NVWARPAPI nvwarpVersion();
280 
284 #define NVWARP_VERSION_MAJOR(version) (((v) >> 24) & 0xff)
285 
289 #define NVWARP_VERSION_MINOR(version) (((v) >> 16) & 0xff)
290 
294 #define NVWARP_VERSION_REVISION(version) (((v) >> 8) & 0xff)
295 
300 
301 
309 
310 
311  // Set the Warp Object from the Parameter Block //
312 
318 
325 void NVWARPAPI nvwarpGetParams(const nvwarpHandle han, nvwarpParams_t *params);
326 
327 
328  // Warp Type //
329 
336 
341 
342 
343  // CUDA Block Size //
344 
348 void NVWARPAPI nvwarpSetBlock(nvwarpHandle han, dim3 dim_block);
349 
353 void NVWARPAPI nvwarpGetBlock(const nvwarpHandle han, dim3 *dim_block);
354 
355 
356  // Pixel Phase //
357 
362 void NVWARPAPI nvwarpSetPixelPhase(nvwarpHandle han, uint32_t phase);
363 
368 uint32_t NVWARPAPI nvwarpGetPixelPhase(const nvwarpHandle han);
369 
370 
371  // Source Dimensions //
372 
377 void NVWARPAPI nvwarpSetSrcWidthHeight(nvwarpHandle han, uint32_t w, uint32_t h);
378 
382 void NVWARPAPI nvwarpGetSrcWidthHeight(const nvwarpHandle han, uint32_t wh[2]);
383 
384 
385  // Source focal length //
386 
394 void NVWARPAPI nvwarpSetSrcFocalLengths(nvwarpHandle han, float fl, float fy);
395 
420 nvwarpResult NVWARPAPI nvwarpComputeSrcFocalLength(nvwarpHandle han, nvwarpType_t warpType, float radius, float angle, float dist[5]);
421 
427 float NVWARPAPI nvwarpGetSrcFocalLength(const nvwarpHandle han, float *fy);
428 
429 
430  // Source Principal Point //
431 
440 void NVWARPAPI nvwarpSetSrcPrincipalPoint(nvwarpHandle han, const float xy[2], uint32_t relToCenter);
441 
447 void NVWARPAPI nvwarpGetSrcPrincipalPoint(const nvwarpHandle han, float xy[2], uint32_t relToCenter);
448 
449 
450  // Source Fisheye Radius //
451 
456 void NVWARPAPI nvwarpSetSrcRadius(nvwarpHandle han, float r);
457 
461 float NVWARPAPI nvwarpGetSrcRadius(const nvwarpHandle han);
462 
463 
464  // Distortion //
465 
472 void NVWARPAPI nvwarpSetDistortion(nvwarpHandle han, const float d[5]);
473 
478 void NVWARPAPI nvwarpGetDistortion(const nvwarpHandle han, float d[5]);
479 
480 
481  // Rotation //
482 
490 void NVWARPAPI nvwarpSetRotation(nvwarpHandle han, const float R[9]);
491 
507 void NVWARPAPI nvwarpSetEulerRotation(nvwarpHandle han, const float *angles, const char *axes);
508 
512 void NVWARPAPI nvwarpGetRotation(const nvwarpHandle han, float R[9]);
513 
514 
515  // Destination dimensions //
516 
521 void NVWARPAPI nvwarpSetDstWidthHeight(nvwarpHandle han, uint32_t w, uint32_t h);
522 
526 void NVWARPAPI nvwarpGetDstWidthHeight(const nvwarpHandle han, uint32_t wh[2]);
527 
528 
529  // Destination focal length //
530 
542 void NVWARPAPI nvwarpSetDstFocalLengths(nvwarpHandle han, float fl, float fy);
543 
553 void NVWARPAPI nvwarpComputeDstFocalLength(nvwarpHandle han, float topAngle, float bottomAngle, uint32_t dstWidth, uint32_t dstHeight);
554 
555 
568 nvwarpResult NVWARPAPI nvwarpComputeDstFocalLengths(nvwarpHandle han, float topAxialAngle, float botAxialAngle, float leftAxialAngle, float rightAxialAngle,
569  uint32_t dstWidth, uint32_t dstHeight);
570 
576 float NVWARPAPI nvwarpGetDstFocalLength(const nvwarpHandle han, float *fy);
577 
578 
579  // Destination Principal Point //
580 
589 void NVWARPAPI nvwarpSetDstPrincipalPoint(nvwarpHandle han, const float xy[2], uint32_t relToCenter);
590 
596 void NVWARPAPI nvwarpGetDstPrincipalPoint(const nvwarpHandle han, float xy[2], uint32_t relToCenter);
597 
598 
599  // Control Parameters //
600 
607 void NVWARPAPI nvwarpSetControl(nvwarpHandle han, uint32_t index, float control);
608 
614 float NVWARPAPI nvwarpGetControl(const nvwarpHandle han, uint32_t index);
615 
616 
617  // User Data Pointer //
618 
622 void NVWARPAPI nvwarpSetUserData(nvwarpHandle han, void *userData);
623 
628 
629 
630 
638 
639 
640  // Warp Images //
641 
648 nvwarpResult NVWARPAPI nvwarpWarpSurface(const nvwarpHandle han, cudaStream_t stream, cudaTextureObject_t srcTex, cudaSurfaceObject_t dstSurface);
649 
657 nvwarpResult NVWARPAPI nvwarpWarpBuffer(const nvwarpHandle han, cudaStream_t stream, cudaTextureObject_t srcTex, void *dstAddr, size_t dstRowBytes);
658 
659 
660  // Warp Coordinates Between Source and Destination //
661 
674 nvwarpResult NVWARPAPI nvwarpWarpCoordinates(const nvwarpHandle han, uint32_t numPts, const float *inPtsXY, float *outPtsXY);
675 
687 nvwarpResult NVWARPAPI nvwarpInverseWarpCoordinates(const nvwarpHandle han, uint32_t numPts, const float *inPtsXY, float *outPtsXY);
688 
689 
690  // Ray <--> Coordinate Conversion //
691 
720 nvwarpResult NVWARPAPI nvwarpSrcToRay(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *rays3D);
721 
730 nvwarpResult NVWARPAPI nvwarpDstToRay(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *rays3D);
731 
740 nvwarpResult NVWARPAPI nvwarpSrcFromRay(const nvwarpHandle han, uint32_t numRays, const float *rays3D, float *pts2D);
741 
750 nvwarpResult NVWARPAPI nvwarpDstFromRay(const nvwarpHandle han, uint32_t numRays, const float *rays3D, float *pts2D);
751 
752 
753  // Angle <--> Coordinate Conversion //
754 
763 nvwarpResult NVWARPAPI nvwarpComputeSrcAngularFromPixelCoordinates(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *ang2D);
764 
773 nvwarpResult NVWARPAPI nvwarpComputeSrcPixelFromAngularCoordinates(const nvwarpHandle han, uint32_t numPts, const float *ang2D, float *pts2D);
774 
783 nvwarpResult NVWARPAPI nvwarpComputeDstAngularFromPixelCoordinates(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *ang2D);
784 
793 nvwarpResult NVWARPAPI nvwarpComputeDstPixelFromAngularCoordinates(const nvwarpHandle han, uint32_t numPts, const float *ang2D, float *pts2D);
794 
795 
796  // Miscellaneous //
797 
803 void NVWARPAPI nvwarpConvertTransformBetweenYUpandYDown(const float fr[9], float to[9]);
804 
805 
806 
814 
815 
816 
818 typedef struct nvwarpYUVRGBParams_t
819 {
820  uint32_t width;
821  uint32_t height;
822  uint32_t cLocation;
823  float ry,
824  rcb,
825  rcr,
826  gy,
827  gcb,
828  gcr,
829  by,
830  bcb,
831  bcr;
832  float yOffset,
833  cOffset;
835 
836 
844 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);
845 
846 
855 nvwarpResult NVWARPAPI nvwarpConvertYUVNV12ToRGBA(cudaStream_t stream, const nvwarpYUVRGBParams_t *params, const void *yuv, size_t yuvRowBytes, void *dst, size_t dstRowBytes);
856 
857 
858 
869 
870 
871 
887  const nvwarpYUVRGBParams_t *yuvParams, const void *yuvBuffer, size_t yuvRowBytes,
888  void *rgbBuffer, size_t rgbRowBytes, cudaTextureObject_t rgbTex,
889  uint32_t numWarps, const nvwarpParams_t *paramArray, void **dstBuffers, const size_t *dstRowBytes);
890 
891 
892 #ifdef __cplusplus
893 }
894 #endif // __cplusplus
895 
896 
897 #endif /* __NVWARP360_H__ */
nvwarpSetUserData
void NVWARPAPI nvwarpSetUserData(nvwarpHandle han, void *userData)
Set the user data pointer.
nvwarpComputeBoxAxialAngleRange
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...
nvwarpDstToRay
nvwarpResult NVWARPAPI nvwarpDstToRay(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *rays3D)
Convert destination coordinates into normalized rays.
NVSURF_PUSHBROOM
@ NVSURF_PUSHBROOM
Simulated pushbroom. Control[0] typically in (0, 1].
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:76
NVWARP_ERR_DOMAIN
@ NVWARP_ERR_DOMAIN
The coordinates are outside of the domain.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:55
NVWARP_ERR_CUDA_MEMORY
@ NVWARP_ERR_CUDA_MEMORY
There is not enough CUDA memory for the operation specified.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:59
nvwarpYUVRGBParams_t::width
uint32_t width
The width of the Y and RGB channels (chroma has half the width, but is interleaved in NV12).
Definition: includes/NVWarp360.h:820
nvwarpParams_t
struct nvwarpParams_t nvwarpParams_t
Parameter structure.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:132
nvwarpSetSrcPrincipalPoint
void NVWARPAPI nvwarpSetSrcPrincipalPoint(nvwarpHandle han, const float xy[2], uint32_t relToCenter)
Specify the principal point of the source image.
NVWARP_ERR_CUDA_LAUNCH
@ NVWARP_ERR_CUDA_LAUNCH
CUDA was not able to launch the specified kernel.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:60
nvwarpGetDstPrincipalPoint
void NVWARPAPI nvwarpGetDstPrincipalPoint(const nvwarpHandle han, float xy[2], uint32_t relToCenter)
Get the destination principal point.
nvwarpDestroyInstance
void NVWARPAPI nvwarpDestroyInstance(nvwarpHandle han)
Destructor for a Warp360 object.
nvwarpGetSrcRadius
float NVWARPAPI nvwarpGetSrcRadius(const nvwarpHandle han)
Get the source fisheye clipping radius.
NVSURF_CYLINDER
@ NVSURF_CYLINDER
Cylindrical, panned horizontally with vertical axis.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:74
nvwarpGetParams
void NVWARPAPI nvwarpGetParams(const nvwarpHandle han, nvwarpParams_t *params)
Get the current values of the warp parameters.
nvwarpSetWarpType
nvwarpResult NVWARPAPI nvwarpSetWarpType(nvwarpHandle han, nvwarpType_t type)
Set the warp type.
nvwarpGetDstWidthHeight
void NVWARPAPI nvwarpGetDstWidthHeight(const nvwarpHandle han, uint32_t wh[2])
Get the destination width and height.
NVWARP_ERR_GENERAL
@ NVWARP_ERR_GENERAL
An otherwise unspecified failure has occurred.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:53
nvwarpComputeSrcFocalLength
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....
nvwarpWarpSurface
nvwarpResult NVWARPAPI nvwarpWarpSurface(const nvwarpHandle han, cudaStream_t stream, cudaTextureObject_t srcTex, cudaSurfaceObject_t dstSurface)
Warp an image texture to a surface.
nvwarpMultiWarp360
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
@ NVSURF_UNKNOWN
Unknown (currently 255).
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:81
nvwarpParams_t::srcY0
float srcY0
Source center of projection Y; frequently (srcHeight - 1) * 0.5, but srcHeight * ....
Definition: includes/NVWarp360.h:150
NVWARP_ERR_PARAMETER
@ NVWARP_ERR_PARAMETER
A parameter has an invalid value.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:57
nvwarpParams_t::srcHeight
uint32_t srcHeight
The height of the source image.
Definition: includes/NVWarp360.h:148
NVSURF_FISHEYE
@ NVSURF_FISHEYE
Fisheye, equidistant.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:72
nvwarpParams_t::topAngle
float topAngle
Top angle of view. (default +pi/2)
Definition: includes/NVWarp360.h:169
nvwarpSetDstPrincipalPoint
void NVWARPAPI nvwarpSetDstPrincipalPoint(nvwarpHandle han, const float xy[2], uint32_t relToCenter)
Set the destination principal point.
nvwarpInitParams
void NVWARPAPI nvwarpInitParams(nvwarpParams_t *params)
Initialize nvwarpParams_t to defaults or NaN if a particular parameter must be supplied.
NVWARP_ERR_CUDA
@ NVWARP_ERR_CUDA
An otherwise unspecified error has been reported by the CUDA runtime.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:63
nvwarpYUVRGBParams_t::gy
float gy
Coefficients for G with respect to Y, including normalization scaling.
Definition: includes/NVWarp360.h:826
NVSURF_ROTCYLINDER
@ NVSURF_ROTCYLINDER
Cylindrical, panned vertically, with horizontal axis.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:75
NVWARP_EQUIRECT_CYLINDER
@ NVWARP_EQUIRECT_CYLINDER
Equirectangular to cylindrical.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:89
NVWARP_EQUIRECT_FISHEYE
@ NVWARP_EQUIRECT_FISHEYE
Equirectangular to fisheye.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:91
NVSURF_BITS
@ NVSURF_BITS
The width of the field used for each image type.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:80
nvwarpYUVRGBParams_t::rcb
float rcb
Coefficients for R with respect to Cb, including normalization scaling.
Definition: includes/NVWarp360.h:824
nvwarpYUVRGBParams_t
Parameters for YUV:420:NV12 --> RGBA conversion.
Definition: includes/NVWarp360.h:818
nvwarpGetBlock
void NVWARPAPI nvwarpGetBlock(const nvwarpHandle han, dim3 *dim_block)
Get the current value of the CUDA block size.
nvwarpParams_t::srcFocalLen
float srcFocalLen
Source focal length.
Definition: includes/NVWarp360.h:151
nvwarpGetUserData
void *NVWARPAPI nvwarpGetUserData(nvwarpHandle han)
Get the current value of the user data pointer.
NVWARP_ERR_MISSING_PARAMETERS
@ NVWARP_ERR_MISSING_PARAMETERS
Some required parameters have not been specified.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:56
nvwarpConvertTransformBetweenYUpandYDown
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
nvwarpType_t
Warp type enumeration.
Definition: includes/NVWarp360.h:87
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: includes/nvbufsurftransform.h:40
nvwarpParams_t::dstWidth
uint32_t dstWidth
The width of the destination.
Definition: includes/NVWarp360.h:157
nvwarpGetSrcFocalLength
float NVWARPAPI nvwarpGetSrcFocalLength(const nvwarpHandle han, float *fy)
Get one or both source focal lengths.
NVWARP_EQUIRECT_PUSHBROOM
@ NVWARP_EQUIRECT_PUSHBROOM
Equirectangular to pushbroom.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:94
nvwarpParams_t::srcWidth
uint32_t srcWidth
The width of the source image.
Definition: includes/NVWarp360.h:147
nvwarpErrorStringFromCode
const char *NVWARPAPI nvwarpErrorStringFromCode(nvwarpResult err)
Get the error string corresponding to the given result code.
NVWARP_FISHEYE_CYLINDER
@ NVWARP_FISHEYE_CYLINDER
Fisheye to horizontally panned cylinder.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:97
nvwarpYUVRGBParams_t
struct nvwarpYUVRGBParams_t nvwarpYUVRGBParams_t
Parameters for YUV:420:NV12 --> RGBA conversion.
NVWARP_ERR_CUDA_NO_KERNEL
@ NVWARP_ERR_CUDA_NO_KERNEL
No suitable CUDA kernel image has been found for this GPU.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:62
nvwarpSurface_t
nvwarpSurface_t
Definition: includes/NVWarp360.h:69
NVSURF_MAX
@ NVSURF_MAX
This makes it 32 bits.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:83
nvwarpYUVRGBParams_t::ry
float ry
Coefficients for R with respect to Y, including normalization scaling.
Definition: includes/NVWarp360.h:823
nvwarpHandle
struct nvwarpObject * nvwarpHandle
Opaque definition of a pointer to the Warp360 state.
Definition: includes/NVWarp360.h:255
nvwarpInverseWarpCoordinates
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
enum nvwarpResult nvWarpResult
Error code enumerations for NVWarp360.
nvwarpSetBlock
void NVWARPAPI nvwarpSetBlock(nvwarpHandle han, dim3 dim_block)
Set the CUDA block size.
nvwarpYUVRGBParams_t::yOffset
float yOffset
Offset of luma, typically 16.
Definition: includes/NVWarp360.h:832
nvwarpParams_t::srcX0
float srcX0
Source center of projection X; frequently (srcWidth - 1) * 0.5, but srcWidth * .5 for wraparounds (eq...
Definition: includes/NVWarp360.h:149
nvwarpYUVRGBParams_t::bcr
float bcr
Coefficients for B with respect to Cr, including normalization scaling.
Definition: includes/NVWarp360.h:831
nvwarpSetControl
void NVWARPAPI nvwarpSetControl(nvwarpHandle han, uint32_t index, float control)
Set a control parameter.
NVWARP_ERR_APPROXIMATE
@ NVWARP_ERR_APPROXIMATE
An accurate calculation is not available; approximation returned.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:64
nvwarpParams_t::srcRadius
float srcRadius
Source circular clipping radius. (default 0 means no clipping) (unimplemented).
Definition: includes/NVWarp360.h:152
nvwarpComputeYCbCr2RgbMatrix
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}.
nvwarpParams_t::rotAngles
float rotAngles[3]
Rotation angles in radians, corresponding to the list of rotation axes below..
Definition: includes/NVWarp360.h:161
nvwarpParams_t::dstHeight
uint32_t dstHeight
The height of the destination.
Definition: includes/NVWarp360.h:158
nvwarpCreateInstance
nvwarpResult NVWARPAPI nvwarpCreateInstance(nvwarpHandle *han)
Constructor for a new instance of a Warp360 object.
nvwarpType_t
nvwarpType_t
Warp type enumeration.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:87
nvwarpGetPixelPhase
uint32_t NVWARPAPI nvwarpGetPixelPhase(const nvwarpHandle han)
Get the pixel phase.
nvwarpComputeSrcAngularFromPixelCoordinates
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
@ NVWARP_ERR_INITIALIZATION
Initialization has not completed successfully.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:58
NVSURF_PANINI
@ NVSURF_PANINI
Panini. Control[0] typically in (0, 1].
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:77
nvwarpGetDstFocalLength
float NVWARPAPI nvwarpGetDstFocalLength(const nvwarpHandle han, float *fy)
Get one or both destination focal lengths.
nvwarpGetRotation
void NVWARPAPI nvwarpGetRotation(const nvwarpHandle han, float R[9])
Get the rotation matrix.
nvwarpComputeDstAngularFromPixelCoordinates
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
@ NVWARP_NONE
This makes it 32 bits.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:107
NVSURF_MASK
@ NVSURF_MASK
The NVWARP_360 mask (currently 0xFF).
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:82
nvwarpResult
nvwarpResult
Error code enumerations for NVWarp360.
Definition: includes/NVWarp360.h:50
NVWARP_EQUIRECT_PANINI
@ NVWARP_EQUIRECT_PANINI
Equirectangular to Panini.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:92
nvwarpYUVRGBParams_t::cOffset
float cOffset
Offset of chroma, typically 128.
Definition: includes/NVWarp360.h:833
nvwarpWarpCoordinates
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
@ NVWARP_ERR_UNIMPLEMENTED
The requested feature has not yet been implemented.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:54
nvwarpYUVRGBParams_t::bcb
float bcb
Coefficients for B with respect to Cb, including normalization scaling.
Definition: includes/NVWarp360.h:830
nvwarpSetParams
nvwarpResult NVWARPAPI nvwarpSetParams(nvwarpHandle han, const nvwarpParams_t *params)
Set parameters for a warp.
NVWARP_FISHEYE_PANINI
@ NVWARP_FISHEYE_PANINI
Fisheye to Panini.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:100
nvwarpDstFromRay
nvwarpResult NVWARPAPI nvwarpDstFromRay(const nvwarpHandle han, uint32_t numRays, const float *rays3D, float *pts2D)
Convert rays into destination coordinates.
nvwarpSetEulerRotation
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.
nvwarpSetPixelPhase
void NVWARPAPI nvwarpSetPixelPhase(nvwarpHandle han, uint32_t phase)
Set the pixel phase.
NVWARP_FISHEYE_EQUIRECT
@ NVWARP_FISHEYE_EQUIRECT
Fisheye to equirectangular.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:98
NVWARP_EQUIRECT_STEREOGRAPHIC
@ NVWARP_EQUIRECT_STEREOGRAPHIC
Equirectangular to generalized stereographic.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:95
nvwarpSurface_t
nvwarpSurface_t
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:69
NVWARP_PERSPECTIVE_EQUIRECT
@ NVWARP_PERSPECTIVE_EQUIRECT
Perspective to equirectangular.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:104
NVWARP_FISHEYE_PERSPECTIVE
@ NVWARP_FISHEYE_PERSPECTIVE
Fisheye to perspective.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:101
nvwarpYUVRGBParams_t::by
float by
Coefficients for B with respect to Y, including normalization scaling.
Definition: includes/NVWarp360.h:829
nvwarpParams_t::rotAxes
char rotAxes[4]
3 rotation axes: upper case 'X', 'Y', and 'Z' are rotation about the positive X, Y and Z axes,...
Definition: includes/NVWarp360.h:162
NVWARP_ERR_MAX
@ NVWARP_ERR_MAX
This makes it 32 bits.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:65
nvwarpSetSrcWidthHeight
void NVWARPAPI nvwarpSetSrcWidthHeight(nvwarpHandle han, uint32_t w, uint32_t h)
Set the source dimensions.
nvwarpComputeDstPixelFromAngularCoordinates
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...
nvwarpComputeSrcPixelFromAngularCoordinates
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.
nvwarpParams_t::bottomAngle
float bottomAngle
Bottom angle of view. (default -pi/2)
Definition: includes/NVWarp360.h:170
nvwarpYUVRGBParams_t::height
uint32_t height
The height of the Y and RGB channels (chroma has half the height, so this must be even).
Definition: includes/NVWarp360.h:821
nvwarpComputeParamsOutputResolution
nvwarpResult NVWARPAPI nvwarpComputeParamsOutputResolution(nvwarpParams_t *params, float aspectRatio)
Compute the output resolution that matches the source focal length and desired aspect ratio.
nvwarpGetSrcWidthHeight
void NVWARPAPI nvwarpGetSrcWidthHeight(const nvwarpHandle han, uint32_t wh[2])
Get the source image dimensions.
nvwarpComputeDstFocalLengths
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...
nvwarpSetRotation
void NVWARPAPI nvwarpSetRotation(nvwarpHandle han, const float R[9])
Specify the rotation.
nvwarpYUVRGBParams_t::gcr
float gcr
Coefficients for G with respect to Cr, including normalization scaling.
Definition: includes/NVWarp360.h:828
nvwarpGetDistortion
void NVWARPAPI nvwarpGetDistortion(const nvwarpHandle han, float d[5])
Get the distortion coefficients.
NVSURF_EQUIRECT
@ NVSURF_EQUIRECT
Equirectangular spherical.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:73
nvwarpYUVRGBParams_t::gcb
float gcb
Coefficients for G with respect to Cb, including normalization scaling.
Definition: includes/NVWarp360.h:827
nvwarpWarpBuffer
nvwarpResult NVWARPAPI nvwarpWarpBuffer(const nvwarpHandle han, cudaStream_t stream, cudaTextureObject_t srcTex, void *dstAddr, size_t dstRowBytes)
Warp an image texture to a buffer.
nvwarpParams_t::dist
float dist[5]
Distortion, typically for the source. (default {0,0,0,0} means no distortion).
Definition: includes/NVWarp360.h:154
NVWARP_EQUIRECT_PERSPECTIVE
@ NVWARP_EQUIRECT_PERSPECTIVE
Equirectangular to perspective.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:93
nvwarpSetDistortion
void NVWARPAPI nvwarpSetDistortion(nvwarpHandle han, const float d[5])
Set the distortion coefficients.
nvwarpComputeParamsSrcFocalLength
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
@ NVWARP_EQUIRECT_EQUIRECT
Equirectangular to equirectangular.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:90
nvwarpComputeDstFocalLength
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...
nvwarpGetSrcPrincipalPoint
void NVWARPAPI nvwarpGetSrcPrincipalPoint(const nvwarpHandle han, float xy[2], uint32_t relToCenter)
Get the source principal point.
NVSURF_STEREOGRAPHIC
@ NVSURF_STEREOGRAPHIC
Generalized Stereographic. Normal stereographic has control[0] = 1.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:78
nvwarpVersion
uint32_t NVWARPAPI nvwarpVersion()
Get the version number, encoded as (major_version * 16777216u + minor * 65536u + revision * 256u).
nvwarpConvertYUVNV12ToRGBA
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.
nvwarpSetSrcRadius
void NVWARPAPI nvwarpSetSrcRadius(nvwarpHandle han, float r)
set the source fisheye clipping radius.
NVWARP_FISHEYE_PUSHBROOM
@ NVWARP_FISHEYE_PUSHBROOM
Fisheye to pushbroom.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:102
nvwarpParams_t::control
float control[4]
Projection-specific controls.
Definition: includes/NVWarp360.h:175
nvwarpSrcToRay
nvwarpResult NVWARPAPI nvwarpSrcToRay(const nvwarpHandle han, uint32_t numPts, const float *pts2D, float *rays3D)
Convert source coordinates into normalized rays.
nvwarpSetDstWidthHeight
void NVWARPAPI nvwarpSetDstWidthHeight(nvwarpHandle han, uint32_t w, uint32_t h)
Set the destination width and height.
NVWARP_ERR_CUDA_DRIVER
@ NVWARP_ERR_CUDA_DRIVER
CUDA driver version is insufficient for CUDA runtime version.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:61
nvwarpSetSrcFocalLengths
void NVWARPAPI nvwarpSetSrcFocalLengths(nvwarpHandle han, float fl, float fy)
Set the source focal length.
NVSURF_PERSPECTIVE
@ NVSURF_PERSPECTIVE
Perspective, projective, rectilinear.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:71
nvwarpGetWarpType
nvwarpType_t NVWARPAPI nvwarpGetWarpType(const nvwarpHandle han)
Get the type of the warp.
nvwarpHandle
struct nvwarpObject * nvwarpHandle
Opaque definition of a pointer to the Warp360 state.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:255
nvwarpGetControl
float NVWARPAPI nvwarpGetControl(const nvwarpHandle han, uint32_t index)
Get the value for the control parameters.
NVWARP_PERSPECTIVE_PERSPECTIVE
@ NVWARP_PERSPECTIVE_PERSPECTIVE
Perspective to perspective.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:106
NVWARP_PERSPECTIVE_PANINI
@ NVWARP_PERSPECTIVE_PANINI
Perspective to Panini.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:105
NVWARP_FISHEYE_ROTCYLINDER
@ NVWARP_FISHEYE_ROTCYLINDER
Fisheye to vertically panned radial cylinder.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:103
NVWARP_EQUIRECT_ROTCYLINDER
@ NVWARP_EQUIRECT_ROTCYLINDER
Equirectangular to vertical cylindrical.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:96
nvwarpParams_t::type
nvwarpType_t type
The type of the warp.
Definition: includes/NVWarp360.h:144
nvwarpComputeParamsAxialAngleRange
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...
nvwarpSetDstFocalLengths
void NVWARPAPI nvwarpSetDstFocalLengths(nvwarpHandle han, float fl, float fy)
Set the destination focal length.
nvwarpParams_t::userData
void * userData
Pointer supplied by the user. (default NULL)
Definition: includes/NVWarp360.h:172
nvwarpYUVRGBParams_t::rcr
float rcr
Coefficients for R with respect to Cr, including normalization scaling.
Definition: includes/NVWarp360.h:825
NVWARPAPI
#define NVWARPAPI
export tag
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:36
NVWARP_SUCCESS
@ NVWARP_SUCCESS
The operation was successful.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:52
NVWARP_FISHEYE_FISHEYE
@ NVWARP_FISHEYE_FISHEYE
Fisheye to fisheye.
Definition: sources/libs/nvdewarper/Warp360/include/NVWarp360.h:99
nvwarpSrcFromRay
nvwarpResult NVWARPAPI nvwarpSrcFromRay(const nvwarpHandle han, uint32_t numRays, const float *rays3D, float *pts2D)
Convert rays into source coordinates.
nvwarpYUVRGBParams_t::cLocation
uint32_t cLocation
0 for chroma sampled cosited horizontally with luma; 1 for chroma sampled halfway between luma sample...
Definition: includes/NVWarp360.h:822
nvwarpParams_t
Parameter structure.
Definition: includes/NVWarp360.h:141