Jetson Inference
DNN Vision Library
cudaColormap.h File Reference
#include "cudaFilterMode.h"
#include "imageFormat.h"

Go to the source code of this file.

Enumerations

enum  cudaColormapType {
  COLORMAP_INFERNO, COLORMAP_MAGMA, COLORMAP_PARULA, COLORMAP_PLASMA,
  COLORMAP_TURBO, COLORMAP_VIRIDIS, COLORMAP_INFERNO_INVERTED, COLORMAP_MAGMA_INVERTED,
  COLORMAP_PARULA_INVERTED, COLORMAP_PLASMA_INVERTED, COLORMAP_TURBO_INVERTED, COLORMAP_VIRIDIS_INVERTED,
  COLORMAP_FLOW, COLORMAP_NONE, COLORMAP_LINEAR, COLORMAP_DEFAULT = COLORMAP_VIRIDIS
}
 Enumeration of built-in colormaps. More...
 

Functions

cudaColormapType cudaColormapFromStr (const char *colormap)
 Parse a cudaColormapType enum from a string. More...
 
const char * cudaColormapToStr (cudaColormapType colormap)
 Convert a cudaColormapType enum to a string. More...
 
template<typename T >
cudaError_t cudaColormap (float *input, T *output, size_t width, size_t height, const float2 &input_range=make_float2(0, 255), cudaDataFormat input_format=FORMAT_DEFAULT, cudaColormapType colormap=COLORMAP_DEFAULT, cudaStream_t stream=NULL)
 Apply a colormap from an input image or vector field to RGB/RGBA. More...
 
cudaError_t cudaColormap (float *input, void *output, size_t width, size_t height, const float2 &input_range=make_float2(0, 255), cudaDataFormat input_format=FORMAT_DEFAULT, imageFormat output_format=IMAGE_UNKNOWN, cudaColormapType colormap=COLORMAP_DEFAULT, cudaStream_t stream=NULL)
 Apply a colormap from an input image or vector field to RGB/RGBA. More...
 
template<typename T >
cudaError_t cudaColormap (float *input, size_t input_width, size_t input_height, T *output, size_t output_width, size_t output_height, const float2 &input_range=make_float2(0, 255), cudaDataFormat input_format=FORMAT_DEFAULT, cudaColormapType colormap=COLORMAP_DEFAULT, cudaFilterMode filter=FILTER_LINEAR, cudaStream_t stream=NULL)
 Apply a colormap from an input image or vector field to RGB/RGBA. More...
 
cudaError_t cudaColormap (float *input, size_t input_width, size_t input_height, void *output, size_t output_width, size_t output_height, const float2 &input_range=make_float2(0, 255), cudaDataFormat input_format=FORMAT_DEFAULT, imageFormat output_format=IMAGE_UNKNOWN, cudaColormapType colormap=COLORMAP_DEFAULT, cudaFilterMode filter=FILTER_LINEAR, cudaStream_t stream=NULL)
 Apply a colormap from an input image or vector field to RGB/RGBA. More...
 
cudaError_t cudaColormapInit ()
 Initialize the colormap palettes by allocating them in CUDA memory. More...
 
cudaError_t cudaColormapFree ()
 Free the colormap palettes after they are done being used. More...
 
float4 * cudaColormapPalette (cudaColormapType colormap)
 Retrieve a CUDA device pointer to one of the colormaps palettes. More...
 

Function Documentation

◆ cudaColormapPalette()

float4* cudaColormapPalette ( cudaColormapType  colormap)

Retrieve a CUDA device pointer to one of the colormaps palettes.

The pointer will be to a float4 array that contains 256 elements, with each color's RGBA pixel values in the range from 0.0 to 255.0.

Note
this function will return NULL for the parameterized colormaps like COLORMAP_FLOW, it's only valid for the palettized maps like COLORMAP_VIRIDIS, COLORMAP_PARULA, ect.
Parameters
colormapthe colormap palette to return (
See also
cudaColormapType)
Returns
CUDA device pointer to the colormap palette, or NULL if an invalid parameterized colormap was requested.