Vuo
1.2.1
|
VuoImageText implementation.
Classes | |
class | VuoFontClass |
A wrapper for VuoFont, so it can be used as a std::map key. More... | |
Typedefs | |
typedef std::pair< std::string, std::pair< VuoFontClass, double > > | VuoImageTextCacheDescriptor |
Text, font, and backingScaleFactor. | |
typedef std::pair< VuoImage, double > | VuoImageTextCacheEntry |
An image and the last time it was used. | |
typedef std::map < VuoImageTextCacheDescriptor, VuoImageTextCacheEntry > | VuoImageTextCacheType |
A pool of images. | |
Functions | |
bool | operator< (const VuoFontClass &a, const VuoFontClass &b) |
Returns true if a is less than b . | |
static void | VuoImageTextCache_cleanup (void *blah) |
Purges expired images from the cache. | |
static void | VuoImageTextCache_init (void) |
Initializes the cache. | |
static void | VuoImageTextCache_fini (void) |
Destroys the cache. | |
static CFArrayRef | VuoImageText_createCTLines (VuoText text, VuoFont font, float backingScaleFactor, CTFontRef *ctFont, CGColorRef *cgColor, CGColorSpaceRef *colorspace, unsigned int *width, unsigned int *height, double *lineHeight, CGRect *bounds, CGRect **lineBounds) |
Formats the specified text for rendering using font and backingScaleFactor . | |
VuoRectangle | VuoImage_getTextRectangle (VuoText text, VuoFont font) |
Returns a rectangle (in points) that fully encloses the specified text when rendered with the specified font . | |
VuoImage | VuoImage_makeText (VuoText text, VuoFont font, float backingScaleFactor) |
Creates an image containing the specified text. | |
Variables | |
static VuoImageTextCacheType * | VuoImageTextCache |
A pool of images. | |
static dispatch_semaphore_t | VuoImageTextCache_semaphore |
Serializes access to VuoImageTextCache. | |
static dispatch_semaphore_t | VuoImageTextCache_canceledAndCompleted |
Signals when the last VuoImageTextCache cleanup has completed. | |
static dispatch_source_t | VuoImageTextCache_timer |
Periodically cleans up VuoImageTextCache. | |
static double | VuoImageTextCache_timeout = 1.0 |
Seconds an image can remain in the cache unused, before it gets purged. | |
typedef std::pair<std::string, std::pair<VuoFontClass,double> > VuoImageTextCacheDescriptor |
Text, font, and backingScaleFactor.
typedef std::pair<VuoImage,double> VuoImageTextCacheEntry |
An image and the last time it was used.
typedef std::map<VuoImageTextCacheDescriptor, VuoImageTextCacheEntry> VuoImageTextCacheType |
A pool of images.
bool operator< | ( | const VuoFontClass & | a, |
const VuoFontClass & | b | ||
) |
Returns true if a
is less than b
.
VuoRectangle VuoImage_getTextRectangle | ( | VuoText | text, |
VuoFont | font | ||
) |
Returns a rectangle (in points) that fully encloses the specified text
when rendered with the specified font
.
Depending on the font's design (e.g., if the font is monospace), the rectangle may be larger than the actual glyphs.
Creates an image containing the specified text.
|
static |
Formats the specified text
for rendering using font
and backingScaleFactor
.
|
static |
Purges expired images from the cache.
|
static |
Destroys the cache.
|
static |
Initializes the cache.
|
static |
A pool of images.
|
static |
Signals when the last VuoImageTextCache cleanup has completed.
|
static |
Serializes access to VuoImageTextCache.
|
static |
Seconds an image can remain in the cache unused, before it gets purged.
|
static |
Periodically cleans up VuoImageTextCache.