Jetson Inference
DNN Vision Library
cudaYUV.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __CUDA_YUV_CONVERT_H
24 #define __CUDA_YUV_CONVERT_H
25 
26 
27 #include "cudaUtility.h"
28 #include <stdint.h>
29 
30 
35 
37 
42 cudaError_t cudaRGBAToI420( uchar4* input, uint8_t* output, size_t width, size_t height );
43 
48 cudaError_t cudaRGBAToI420( uchar4* input, size_t inputPitch, uint8_t* output, size_t outputPitch, size_t width, size_t height );
49 
54 cudaError_t cudaRGBAToYV12( uchar4* input, uint8_t* output, size_t width, size_t height );
55 
60 cudaError_t cudaRGBAToYV12( uchar4* input, size_t inputPitch, uint8_t* output, size_t outputPitch, size_t width, size_t height );
61 
63 
64 
69 
71 
76 cudaError_t cudaUYVYToRGBA( uchar2* input, uchar4* output, size_t width, size_t height );
77 
82 cudaError_t cudaUYVYToRGBA( uchar2* input, size_t inputPitch, uchar4* output, size_t outputPitch, size_t width, size_t height );
83 
88 cudaError_t cudaYUYVToRGBA( uchar2* input, uchar4* output, size_t width, size_t height );
89 
94 cudaError_t cudaYUYVToRGBA( uchar2* input, size_t inputPitch, uchar4* output, size_t outputPitch, size_t width, size_t height );
95 
97 
98 
103 
105 
110 cudaError_t cudaUYVYToGray( uchar2* input, float* output, size_t width, size_t height );
111 
116 cudaError_t cudaUYVYToGray( uchar2* input, size_t inputPitch, float* output, size_t outputPitch, size_t width, size_t height );
117 
122 cudaError_t cudaYUYVToGray( uchar2* input, float* output, size_t width, size_t height );
123 
128 cudaError_t cudaYUYVToGray( uchar2* input, size_t inputPitch, float* output, size_t outputPitch, size_t width, size_t height );
129 
131 
132 
137 
139 
145 cudaError_t cudaNV12ToRGBA( uint8_t* input, uchar4* output, size_t width, size_t height );
146 
152 cudaError_t cudaNV12ToRGBA( uint8_t* input, size_t inputPitch, uchar4* output, size_t outputPitch, size_t width, size_t height );
153 
159 cudaError_t cudaNV12ToRGBA32( uint8_t* input, float4* output, size_t width, size_t height );
160 
166 cudaError_t cudaNV12ToRGBA32( uint8_t* input, size_t inputPitch, float4* output, size_t outputPitch, size_t width, size_t height );
167 
176 cudaError_t cudaNV12SetupColorspace( float hue = 0.0f );
177 
179 
180 #endif
181 
cudaError_t cudaNV12SetupColorspace(float hue=0.0f)
Setup NV12 color conversion constants.
cudaError_t cudaUYVYToGray(uchar2 *input, float *output, size_t width, size_t height)
Convert a UYVY 422 packed image into a floating-point grayscale image.
cudaError_t cudaRGBAToI420(uchar4 *input, uint8_t *output, size_t width, size_t height)
Convert an RGBA uchar4 buffer into YUV I420 planar.
cudaError_t cudaUYVYToRGBA(uchar2 *input, uchar4 *output, size_t width, size_t height)
Convert a UYVY 422 packed image into RGBA uchar4.
cudaError_t cudaYUYVToGray(uchar2 *input, float *output, size_t width, size_t height)
Convert a YUYV 422 packed image into a floating-point grayscale image.
cudaError_t cudaNV12ToRGBA(uint8_t *input, uchar4 *output, size_t width, size_t height)
Convert an NV12 texture (semi-planar 4:2:0) to RGBA uchar4 format.
cudaError_t cudaRGBAToYV12(uchar4 *input, uint8_t *output, size_t width, size_t height)
Convert an RGBA uchar4 buffer into YUV YV12 planar.
cudaError_t cudaNV12ToRGBA32(uint8_t *input, float4 *output, size_t width, size_t height)
Convert an NV12 texture (semi-planar 4:2:0) to RGBA float4 format.
cudaError_t cudaYUYVToRGBA(uchar2 *input, uchar4 *output, size_t width, size_t height)
Convert a YUYV 422 packed image into RGBA uchar4.