Class ContourPlot.SignedDistanceCharacters
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.ContourPlot.SignedDistanceCharacters
-
- Enclosing class:
- ContourPlot
public static class ContourPlot.SignedDistanceCharacters extends java.lang.Object
The SignedDistanceCharacters class comprises signed distance fields of a set of characters. A signed distance field is an image in which each pixel encodes the distance to the nearest edge. Such an image of a character glyph allows for efficient rendering of text with arbitrary size and rotation using alpha testing and blending. For more details read this paper dl.acm.org/citation.cfm?id=1281665.The signed distance fields for each character are stored in a single image alongside a lookup table for the bounding rectangles for each character within that image. The set of characters used is defined in
CHARACTERS
which is a String sorted by char value ascending.Since the process of computing a SignedDistanceCharacters object is quite time consuming, there are pre-computed SignedDistanceCharacters instances for the Ubuntu Mono font used by JPlotter (see
ContourPlot.FontProvider
) which are statically loaded from files. These are located in.../resources/font/
alongside the corresponding true type font files. Similar to theContourPlot.FontProvider.getUbuntuMono(float, int)
the#getUbuntuMonoSDC(int)
method can be used to access the pre-computed SignedDistanceCharacters.- Author:
- hageldave
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CHARACTERS
Character set for instances ofContourPlot.SignedDistanceCharacters
.protected static ContourPlot.Img
FONTMETRIC_IMG
protected static int
genFontSize
protected static int
padding
-
Constructor Summary
Constructors Constructor Description SignedDistanceCharacters()
-
-
-
Field Detail
-
genFontSize
protected static final int genFontSize
- See Also:
- Constant Field Values
-
padding
protected static final int padding
- See Also:
- Constant Field Values
-
FONTMETRIC_IMG
protected static final ContourPlot.Img FONTMETRIC_IMG
-
CHARACTERS
public static final java.lang.String CHARACTERS
Character set for instances ofContourPlot.SignedDistanceCharacters
. Characters in this string are sorted by char value ascending.- See Also:
- Constant Field Values
-
-