docs/html/group__cudaFont.html
| | Jetson Inference
DNN Vision Library |
Fonts Utilities Library (jetson-utils) » CUDA
TTF font rasterization and image overlay rendering using CUDA. More...
|
|
| class | cudaFont |
| | TTF font rasterization and image overlay rendering using CUDA. More...
|
| |
|
|
| float | adaptFontSize (uint32_t dimension) |
| | Determine an appropriate font size given a particular dimension to use (typically an image's width). More...
|
| |
TTF font rasterization and image overlay rendering using CUDA.
| class cudaFont |
TTF font rasterization and image overlay rendering using CUDA.
|
|
| | ~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 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...
|
| |
|
| | | cudaFont () | | | | bool | init (const char *font, float size) | | | |
| | 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 const uint32_t | MaxCommands = 1024 | | | | static const uint32_t | FirstGlyph = 32 | | | | static const uint32_t | LastGlyph = 255 | | | | static const uint32_t | NumGlyphs = LastGlyph - FirstGlyph | | |
| cudaFont::~cudaFont | ( | | ) | |
Destructor.
|
| cudaFont::cudaFont | ( | | ) | |
| protected |
|
| 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. |
|
| 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. |
|
| 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. |
|
| float cudaFont::GetSize | ( | | ) | const |
| inline |
Return the size of the font (height in pixels)
|
| bool cudaFont::init | ( | const char * | font, | | | | float | size | | | ) | | |
| protected |
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.
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.
| 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.
| 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.
| int4 cudaFont::TextExtents | ( | const char * | str, |
| | | int | x = 0, |
| | | int | y = 0 |
| | ) | | |
Return the bounding rectangle of the given text string.
|
| const uint32_t cudaFont::FirstGlyph = 32 |
| staticprotected |
|
| const uint32_t cudaFont::LastGlyph = 255 |
| staticprotected |
|
| const uint32_t cudaFont::MaxCommands = 1024 |
| staticprotected |
|
| int cudaFont::mCmdIndex |
| protected |
|
| void* cudaFont::mCommandCPU |
| protected |
|
| void* cudaFont::mCommandGPU |
| protected |
|
| uint8_t* cudaFont::mFontMapCPU |
| protected |
|
| uint8_t* cudaFont::mFontMapGPU |
| protected |
|
| int cudaFont::mFontMapHeight |
| protected |
|
| int cudaFont::mFontMapWidth |
| protected |
|
| struct cudaFont::GlyphInfo cudaFont::mGlyphInfo[NumGlyphs] |
| protected |
|
| int cudaFont::mRectIndex |
| protected |
|
| float4* cudaFont::mRectsCPU |
| protected |
|
| float4* cudaFont::mRectsGPU |
| protected |
|
| float cudaFont::mSize |
| protected |
|
| const uint32_t cudaFont::NumGlyphs = LastGlyph - FirstGlyph |
| staticprotected |
| float adaptFontSize | ( | uint32_t | dimension | ) | |
Determine an appropriate font size given a particular dimension to use (typically an image's width).
Then the font won't be radically unsized.
Parameters
| dimension | The dimension's size to fit against (i.e. image width) |
Returnsa font size between 10 and 32 pixels tall.