Back to Jetson Inference

Jetson Inference: cudaFont Class Reference

docs/html/classcudaFont.html

latest13.1 KB
Original Source

| | Jetson Inference

DNN Vision Library |

Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members

cudaFont Class Reference Utilities Library (jetson-utils) » CUDA » Fonts

TTF font rasterization and image overlay rendering using CUDA. More...

#include <cudaFont.h>

|

Classes

| | struct | GlyphInfo | | |

|

Public Member Functions

| | | ~cudaFont () | | | Destructor. More...
| | | | bool | OverlayText (void *image, imageFormat format, uint32_t width, uint32_t height, const char *str, int x, int y, const float4 &color=make_float4(0, 0, 0, 255), const float4 &background=make_float4(0, 0, 0, 0), int backgroundPadding=5) | | | Render text overlay onto image. More...
| | | | bool | OverlayText (void *image, imageFormat format, uint32_t width, uint32_t height, const std::vector< std::pair< std::string, int2 > > &text, const float4 &color=make_float4(0, 0, 0, 255), const float4 &background=make_float4(0, 0, 0, 0), int backgroundPadding=5) | | | Render text overlay onto image. More...
| | | | template<typename T > | | bool | OverlayText (T *image, uint32_t width, uint32_t height, const char *str, int x, int y, const float4 &color=make_float4(0, 0, 0, 255), const float4 &background=make_float4(0, 0, 0, 0), int backgroundPadding=5) | | | Render text overlay onto image. More...
| | | | template<typename T > | | bool | OverlayText (T *image, uint32_t width, uint32_t height, const std::vector< std::pair< std::string, int2 > > &text, const float4 &color=make_float4(0, 0, 0, 255), const float4 &background=make_float4(0, 0, 0, 0), int backgroundPadding=5) | | | Render text overlay onto image. More...
| | | | float | GetSize () const | | | Return the size of the font (height in pixels) More...
| | | | int4 | TextExtents (const char *str, int x=0, int y=0) | | | Return the bounding rectangle of the given text string. More...
| | |

|

Static Public Member Functions

| | static cudaFont * | Create (float size=32.0f) | | | Create new CUDA font overlay object using baked fonts. More...
| | | | static cudaFont * | Create (const char *font, float size) | | | Create new CUDA font overlay object using baked fonts. More...
| | | | static cudaFont * | Create (const std::vector< std::string > &fonts, float size) | | | Create new CUDA font overlay object using baked fonts. More...
| | |

|

Protected Member Functions

| | | cudaFont () | | | | bool | init (const char *font, float size) | | |

|

Protected Attributes

| | float | mSize | | | | uint8_t * | mFontMapCPU | | | | uint8_t * | mFontMapGPU | | | | int | mFontMapWidth | | | | int | mFontMapHeight | | | | void * | mCommandCPU | | | | void * | mCommandGPU | | | | int | mCmdIndex | | | | float4 * | mRectsCPU | | | | float4 * | mRectsGPU | | | | int | mRectIndex | | | | struct cudaFont::GlyphInfo | mGlyphInfo [NumGlyphs] | | |

|

Static Protected Attributes

| | static const uint32_t | MaxCommands = 1024 | | | | static const uint32_t | FirstGlyph = 32 | | | | static const uint32_t | LastGlyph = 255 | | | | static const uint32_t | NumGlyphs = LastGlyph - FirstGlyph | | |

Detailed Description

TTF font rasterization and image overlay rendering using CUDA.

Constructor & Destructor Documentation

~cudaFont()

| cudaFont::~cudaFont | ( | | ) | |

Destructor.

cudaFont()

|

| cudaFont::cudaFont | ( | | ) | |

| protected |

Member Function Documentation

Create() [1/3]

|

| static cudaFont* cudaFont::Create | ( | const char * | font, | | | | float | size | | | ) | | |

| static |

Create new CUDA font overlay object using baked fonts.

Parameters

| font | The name of the TTF font to use. | | size | The desired height of the font, in pixels. |

Create() [2/3]

|

| static cudaFont* cudaFont::Create | ( | const std::vector< std::string > & | fonts, | | | | float | size | | | ) | | |

| static |

Create new CUDA font overlay object using baked fonts.

Parameters

| font | A list of font names that are acceptable to use. If the first font isn't found on the system, then the next font from the list will be tried. | | size | The desired height of the font, in pixels. |

Create() [3/3]

|

| static cudaFont* cudaFont::Create | ( | float | size = 32.0f | ) | |

| static |

Create new CUDA font overlay object using baked fonts.

Parameters

| size | The desired height of the font, in pixels. |

GetSize()

|

| float cudaFont::GetSize | ( | | ) | const |

| inline |

Return the size of the font (height in pixels)

init()

|

| bool cudaFont::init | ( | const char * | font, | | | | float | size | | | ) | | |

| protected |

OverlayText() [1/4]

template<typename T >

|

| bool cudaFont::OverlayText | ( | T * | image, | | | | uint32_t | width, | | | | uint32_t | height, | | | | const char * | str, | | | | int | x, | | | | int | y, | | | | const float4 & | color = make_float4(0, 0, 0, 255), | | | | const float4 & | background = make_float4(0, 0, 0, 0), | | | | int | backgroundPadding = 5 | | | ) | | |

| inline |

Render text overlay onto image.

OverlayText() [2/4]

template<typename T >

|

| bool cudaFont::OverlayText | ( | T * | image, | | | | uint32_t | width, | | | | uint32_t | height, | | | | const std::vector< std::pair< std::string, int2 > > & | text, | | | | const float4 & | color = make_float4(0, 0, 0, 255), | | | | const float4 & | background = make_float4(0, 0, 0, 0), | | | | int | backgroundPadding = 5 | | | ) | | |

| inline |

Render text overlay onto image.

OverlayText() [3/4]

| bool cudaFont::OverlayText | ( | void * | image, | | | | imageFormat | format, | | | | uint32_t | width, | | | | uint32_t | height, | | | | const char * | str, | | | | int | x, | | | | int | y, | | | | const float4 & | color = make_float4(0, 0, 0, 255), | | | | const float4 & | background = make_float4(0, 0, 0, 0), | | | | int | backgroundPadding = 5 | | | ) | | |

Render text overlay onto image.

OverlayText() [4/4]

| bool cudaFont::OverlayText | ( | void * | image, | | | | imageFormat | format, | | | | uint32_t | width, | | | | uint32_t | height, | | | | const std::vector< std::pair< std::string, int2 > > & | text, | | | | const float4 & | color = make_float4(0, 0, 0, 255), | | | | const float4 & | background = make_float4(0, 0, 0, 0), | | | | int | backgroundPadding = 5 | | | ) | | |

Render text overlay onto image.

TextExtents()

| int4 cudaFont::TextExtents | ( | const char * | str, | | | | int | x = 0, | | | | int | y = 0 | | | ) | | |

Return the bounding rectangle of the given text string.

Member Data Documentation

FirstGlyph

|

| const uint32_t cudaFont::FirstGlyph = 32 |

| staticprotected |

LastGlyph

|

| const uint32_t cudaFont::LastGlyph = 255 |

| staticprotected |

MaxCommands

|

| const uint32_t cudaFont::MaxCommands = 1024 |

| staticprotected |

mCmdIndex

|

| int cudaFont::mCmdIndex |

| protected |

mCommandCPU

|

| void* cudaFont::mCommandCPU |

| protected |

mCommandGPU

|

| void* cudaFont::mCommandGPU |

| protected |

mFontMapCPU

|

| uint8_t* cudaFont::mFontMapCPU |

| protected |

mFontMapGPU

|

| uint8_t* cudaFont::mFontMapGPU |

| protected |

mFontMapHeight

|

| int cudaFont::mFontMapHeight |

| protected |

mFontMapWidth

|

| int cudaFont::mFontMapWidth |

| protected |

mGlyphInfo

|

| struct cudaFont::GlyphInfo cudaFont::mGlyphInfo[NumGlyphs] |

| protected |

mRectIndex

|

| int cudaFont::mRectIndex |

| protected |

mRectsCPU

|

| float4* cudaFont::mRectsCPU |

| protected |

mRectsGPU

|

| float4* cudaFont::mRectsGPU |

| protected |

mSize

|

| float cudaFont::mSize |

| protected |

NumGlyphs

|

| const uint32_t cudaFont::NumGlyphs = LastGlyph - FirstGlyph |

| staticprotected |


The documentation for this class was generated from the following file:

  • jetson-utils/cudaFont.h

  • cudaFont

  • Generated on Fri Mar 17 2023 14:29:30 for Jetson Inference by 1.8.17