Jetson Inference
DNN Vision Library
cudaRGB.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_RGB_CONVERT_H
24 #define __CUDA_RGB_CONVERT_H
25 
26 
27 #include "cudaUtility.h"
28 
29 
30 
36 
38 
44 cudaError_t cudaRGB8ToBGR8( uchar3* input, uchar3* output, size_t width, size_t height );
45 
51 cudaError_t cudaRGB32ToBGR32( float3* input, float3* output, size_t width, size_t height );
52 
58 cudaError_t cudaRGBA8ToBGRA8( uchar4* input, uchar4* output, size_t width, size_t height );
59 
65 cudaError_t cudaRGBA32ToBGRA32( float4* input, float4* output, size_t width, size_t height );
66 
67 
69 
75 
77 
85 cudaError_t cudaRGB8ToRGBA8( uchar3* input, uchar4* output, size_t width, size_t height, bool swapRedBlue=false );
86 
94 cudaError_t cudaRGBA8ToRGB8( uchar4* input, uchar3* output, size_t width, size_t height, bool swapRedBlue=false );
95 
97 
98 
104 
106 
114 cudaError_t cudaRGB32ToRGBA32( float3* input, float4* output, size_t width, size_t height, bool swapRedBlue=false );
115 
123 cudaError_t cudaRGBA32ToRGB32( float4* input, float3* output, size_t width, size_t height, bool swapRedBlue=false );
124 
126 
127 
133 
135 
143 cudaError_t cudaRGB8ToRGB32( uchar3* input, float3* output, size_t width, size_t height, bool swapRedBlue=false );
144 
152 cudaError_t cudaRGB8ToRGBA32( uchar3* input, float4* output, size_t width, size_t height, bool swapRedBlue=false );
153 
161 cudaError_t cudaRGBA8ToRGB32( uchar4* input, float3* output, size_t width, size_t height, bool swapRedBlue=false );
162 
170 cudaError_t cudaRGBA8ToRGBA32( uchar4* input, float4* output, size_t width, size_t height, bool swapRedBlue=false );
171 
173 
174 
180 
182 
195 cudaError_t cudaRGB32ToRGB8( float3* input, uchar3* output, size_t width, size_t height,
196  bool swapRedBlue=false, const float2& pixelRange=make_float2(0,255) );
197 
210 cudaError_t cudaRGB32ToRGBA8( float3* input, uchar4* output, size_t width, size_t height,
211  bool swapRedBlue=false, const float2& pixelRange=make_float2(0,255) );
212 
225 cudaError_t cudaRGBA32ToRGB8( float4* input, uchar3* output, size_t width, size_t height,
226  bool swapRedBlue=false, const float2& pixelRange=make_float2(0,255) );
227 
240 cudaError_t cudaRGBA32ToRGBA8( float4* input, uchar4* output, size_t width, size_t height,
241  bool swapRedBlue=false, const float2& pixelRange=make_float2(0,255) );
242 
244 
245 #endif
cudaRGBA8ToRGBA32
cudaError_t cudaRGBA8ToRGBA32(uchar4 *input, float4 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert uchar4 RGBA/BGRA image to float4 RGBA/BGRA image.
cudaRGBA8ToRGB32
cudaError_t cudaRGBA8ToRGB32(uchar4 *input, float3 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert uchar4 RGBA/BGRA image to float3 RGB/BGR image.
cudaUtility.h
cudaRGBA32ToRGB32
cudaError_t cudaRGBA32ToRGB32(float4 *input, float3 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert float4 RGBA/BGRA image into float3 RGB/BGR image.
cudaRGBA32ToRGB8
cudaError_t cudaRGBA32ToRGB8(float4 *input, uchar3 *output, size_t width, size_t height, bool swapRedBlue=false, const float2 &pixelRange=make_float2(0, 255))
Convert float4 RGBA/BGRA image into uchar3 image.
cudaRGBA8ToRGB8
cudaError_t cudaRGBA8ToRGB8(uchar4 *input, uchar3 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert uchar4 RGBA/BGRA image to uchar3 RGB/BGR image.
cudaRGBA32ToRGBA8
cudaError_t cudaRGBA32ToRGBA8(float4 *input, uchar4 *output, size_t width, size_t height, bool swapRedBlue=false, const float2 &pixelRange=make_float2(0, 255))
Convert float4 RGBA/BGRA image into uchar4 RGBA/BGRA image.
cudaRGB32ToBGR32
cudaError_t cudaRGB32ToBGR32(float3 *input, float3 *output, size_t width, size_t height)
Convert float3 RGB image to float3 BGR (or convert BGR to RGB).
cudaRGB8ToRGBA8
cudaError_t cudaRGB8ToRGBA8(uchar3 *input, uchar4 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert uchar3 RGB/BGR image to uchar4 RGBA/BGRA image.
cudaRGB8ToRGB32
cudaError_t cudaRGB8ToRGB32(uchar3 *input, float3 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert uchar3 RGB/BGR image to float3 RGB/BGR image.
cudaRGBA32ToBGRA32
cudaError_t cudaRGBA32ToBGRA32(float4 *input, float4 *output, size_t width, size_t height)
Convert float4 RGBA image to float4 BGRA (or convert BGRA to RGBA).
cudaRGB8ToRGBA32
cudaError_t cudaRGB8ToRGBA32(uchar3 *input, float4 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert uchar3 RGB/BGR image to float4 RGBA/BGRA image.
cudaRGB32ToRGBA32
cudaError_t cudaRGB32ToRGBA32(float3 *input, float4 *output, size_t width, size_t height, bool swapRedBlue=false)
Convert float3 RGB/BGR image into float4 RGBA/BGRA image.
cudaRGB32ToRGBA8
cudaError_t cudaRGB32ToRGBA8(float3 *input, uchar4 *output, size_t width, size_t height, bool swapRedBlue=false, const float2 &pixelRange=make_float2(0, 255))
Convert float3 RGB/BGR image into uchar4 RGBA/BGRA image.
make_float2
__host__ __device__ float2 make_float2(float s)
Definition: cudaMath.h:81
cudaRGB8ToBGR8
cudaError_t cudaRGB8ToBGR8(uchar3 *input, uchar3 *output, size_t width, size_t height)
Convert uchar3 RGB image to uchar3 BGR (or convert BGR to RGB).
cudaRGB32ToRGB8
cudaError_t cudaRGB32ToRGB8(float3 *input, uchar3 *output, size_t width, size_t height, bool swapRedBlue=false, const float2 &pixelRange=make_float2(0, 255))
Convert float3 RGB/BGR image into uchar3 RGB/BGR image.
cudaRGBA8ToBGRA8
cudaError_t cudaRGBA8ToBGRA8(uchar4 *input, uchar4 *output, size_t width, size_t height)
Convert uchar4 RGBA image to uchar4 BGRA (or convert BGRA to RGBA).