Jetson Inference
DNN Vision Library
cudaRGB.h File Reference
#include "cudaUtility.h"

Go to the source code of this file.

Functions

RGB/RGBA to BGR/BGRA (or vice-versa)
See also
cudaConvertColor() from cudaColorspace.h for automated format conversion
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). More...
 
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). More...
 
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). More...
 
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). More...
 
8-bit RGB/BGR to 8-bit RGBA/BGRA (or vice-versa)
See also
cudaConvertColor() from cudaColorspace.h for automated format conversion
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. More...
 
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. More...
 
Floating-point RGB/BGR to floating-point RGBA/BGRA (or vice versa)
See also
cudaConvertColor() from cudaColorspace.h for automated format conversion
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. More...
 
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. More...
 
8-bit images to floating-point images
See also
cudaConvertColor() from cudaColorspace.h for automated format conversion
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Floating-point images to 8-bit images
See also
cudaConvertColor() from cudaColorspace.h for automated format conversion
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Function Documentation

◆ 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).

This function swaps the red and blue channels, so if the input is RGB it will be converted to RGB, and if the input is BGR it will be converted 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.
pixelRangespecifies the floating-point pixel value range of the input image, which is used to rescale the fixed-point pixel outputs to [0,255]. The default input range is [0,255], where no rescaling occurs. Other common input ranges are [-1, 1] or [0,1].

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.
pixelRangespecifies the floating-point pixel value range of the input image, which is used to rescale the fixed-point pixel outputs to [0,255]. The default input range is [0,255], where no rescaling occurs. Other common input ranges are [-1, 1] or [0,1].

◆ 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).

This function swaps the red and blue channels, so if the input is RGB it will be converted to RGB, and if the input is BGR it will be converted to RGB.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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).

This function swaps the red and blue channels, so if the input is RGBA it will be converted to RGBA, and if the input is BGR it will be converted to RGBA.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.
pixelRangespecifies the floating-point pixel value range of the input image, which is used to rescale the fixed-point pixel outputs to [0,255]. The default input range is [0,255], where no rescaling occurs. Other common input ranges are [-1, 1] or [0,1].

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.
pixelRangespecifies the floating-point pixel value range of the input image, which is used to rescale the fixed-point pixel outputs to [0,255]. The default input range is [0,255], where no rescaling occurs. Other common input ranges are [-1, 1] or [0,1].

◆ 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).

This function swaps the red and blue channels, so if the input is RGBA it will be converted to RGBA, and if the input is BGR it will be converted to RGBA.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.

◆ 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.

Parameters
swapRedBlueif true, swap the input's red and blue channels in the output - i.e if the input is RGB and output is BGR, or vice versa.
The default is false, and the channels will remain the same.