Performs rasterisation scanning of glyphs/ vectors.
Public Member Functions | |
void | Start () |
Called automatically when the first vector is rasterized. More... | |
void | CreateDistanceCache () |
void | MoveTo (float x, float y) |
void | AddPoint (float x, float y) |
Adds the given point as a point on our vector. Note that it's relative at this point. More... | |
void | ReindexDistanceCache () |
Clears out all node entries in the distance cache. More... | |
void | ClearDistanceCache () |
Clears out all node entries in the distance cache. More... | |
bool | Rasterise (VectorPath glyph, Color32[] atlasPixels, int atlasWidth, int baseIndex, int width, int height, float hOffset, float vOffset, Color32 fill, bool clear) |
Rasterises a generic vector. More... | |
Public Attributes | |
int | BlurSpread =10 |
The size of the SDF "blur" (distance field) in pixels around each vector. More... | |
float | ScalarX =1f |
Read only. Use Scale or ScaleX. A scalar value applied to all vectors rendered by this scanner. More... | |
float | ScalarY =1f |
Read only. Use Scale or ScaleX. A scalar value applied to all vectors rendered by this scanner. More... | |
float | VerticalOffset |
A vertical offset value applied to each point. Used for example on glyphs which extend below the baseline. More... | |
float | HorizontalOffset |
A horizontal offset value applied to each point. Used for example on glyphs which are offset and would otherwise waste space. More... | |
bool | RequiresStart =true |
True if this scanner needs some values to be setup. Set this true if you e.g. change the blur spread. More... | |
Package Attributes | |
float | RawSampleDistance |
The distance between each row of pixels. Set automatically. More... | |
const int | MaxPoolCount =50 |
The max pixel count in the pool. More... | |
int | PooledPixels |
The number of pixels in the pool. More... | |
DistanceCacheSquare[] | DistanceCache |
Shared pool of vector verts. More... | |
int | DistanceCacheWidth |
The width of the distance cache. More... | |
int | DistanceCacheHeight |
The height of the distance cache. More... | |
ScannerPixel | FirstPooled |
Shared pool of scanner pixels. More... | |
Properties | |
float | SampleDistance [get, set] |
The distance between each row of pixels. Set automatically. More... | |
int | SDFSize [get, set] |
Changes the "spread" of SDF rastered vectors. More... | |
bool | SDF [get, set] |
Change this scanners draw mode. Defaults to SDF draw mode. More... | |
float | ScaleY [get, set] |
The scale applied to all vectors rendered with this scanner. More... | |
float | ScaleX [get, set] |
The scale applied to all vectors rendered with this scanner. More... | |
float | Scale [get, set] |
The scale applied to all vectors rendered with this scanner. More... | |
int | DrawHeight [get, set] |
Change the SDF default draw height of the scanner. More... | |
Properties inherited from Blaze.PointReceiver | |
float | SampleDistance [get, set] |
Private Member Functions | |
void | AddPixel (float x, int y) |
Adds a given pixel to the scanline buffer. More... | |
Private Attributes | |
bool | Blurred =true |
True if the raster result is "blurred" (actually an SDF). More... | |
int | DoubleBlurSpread |
Computed when the first vector is rasterised. BlurSpread * 2. More... | |
int | HalfBlurSpread |
Computed when the first vector is rasterised. BlurSpread / 2. More... | |
ScannerScanLine[] | ScanLineBuffer |
A globally shared scan line buffer. More... | |
float | MaxDistance |
Used in SDF rendering. The max distance a pixel can be from the outline. Same as BlurSpread, but as a float. More... | |
float | MaxDistanceSquared |
The square of the maximum distance. Used in SDF rendering. More... | |
float | DistanceAdjuster |
Used in SDF rendering. Maps a distance value to being in 0-255 byte range. More... | |
int | RawSDFSize |
The raw spread of SDF rastered vectors. See SDFSize. More... | |
bool | WentUp |
Used whilst adding points to scanlines. Did we last go up or down. More... | |
int | MoveToY |
Used whilst adding points to scanlines. The Y line that was moved to. More... | |
int | PreviousY |
Used whilst adding points to scanlines. The previous visited line. More... | |
int | LineChangeY =-1 |
The cached "line change" point's X value. More... | |
float | LineChangeX |
The cached "line change" point's X value. The line change point is essentially the first point that is not on the moveTo line. More... | |
bool | LineChangeWentUp |
Did the line change point go up? More... | |
|
inlineprivate |
Adds a given pixel to the scanline buffer.
|
inline |
Adds the given point as a point on our vector. Note that it's relative at this point.
Implements Blaze.PointReceiver.
|
inline |
Clears out all node entries in the distance cache.
|
inline |
|
inline |
Implements Blaze.PointReceiver.
|
inline |
Rasterises a generic vector.
|
inline |
Clears out all node entries in the distance cache.
|
inline |
Called automatically when the first vector is rasterized.
|
private |
True if the raster result is "blurred" (actually an SDF).
int Blaze.Scanner.BlurSpread =10 |
The size of the SDF "blur" (distance field) in pixels around each vector.
|
private |
Used in SDF rendering. Maps a distance value to being in 0-255 byte range.
|
package |
Shared pool of vector verts.
Shared grid-cache. It's used for rapid distance checking. It's a 2D grid. x + (width*y).
|
package |
The height of the distance cache.
|
package |
The width of the distance cache.
|
private |
Computed when the first vector is rasterised. BlurSpread * 2.
|
package |
Shared pool of scanner pixels.
|
private |
Computed when the first vector is rasterised. BlurSpread / 2.
float Blaze.Scanner.HorizontalOffset |
A horizontal offset value applied to each point. Used for example on glyphs which are offset and would otherwise waste space.
|
private |
Did the line change point go up?
|
private |
The cached "line change" point's X value. The line change point is essentially the first point that is not on the moveTo line.
|
private |
The cached "line change" point's X value.
|
private |
Used in SDF rendering. The max distance a pixel can be from the outline. Same as BlurSpread, but as a float.
|
private |
The square of the maximum distance. Used in SDF rendering.
|
package |
The max pixel count in the pool.
|
private |
Used whilst adding points to scanlines. The Y line that was moved to.
|
package |
The number of pixels in the pool.
|
private |
Used whilst adding points to scanlines. The previous visited line.
|
package |
The distance between each row of pixels. Set automatically.
|
private |
The raw spread of SDF rastered vectors. See SDFSize.
bool Blaze.Scanner.RequiresStart =true |
True if this scanner needs some values to be setup. Set this true if you e.g. change the blur spread.
float Blaze.Scanner.ScalarX =1f |
Read only. Use Scale or ScaleX. A scalar value applied to all vectors rendered by this scanner.
float Blaze.Scanner.ScalarY =1f |
Read only. Use Scale or ScaleX. A scalar value applied to all vectors rendered by this scanner.
|
private |
A globally shared scan line buffer.
float Blaze.Scanner.VerticalOffset |
A vertical offset value applied to each point. Used for example on glyphs which extend below the baseline.
|
private |
Used whilst adding points to scanlines. Did we last go up or down.
|
getset |
Change the SDF default draw height of the scanner.
|
getset |
The distance between each row of pixels. Set automatically.
|
getset |
The scale applied to all vectors rendered with this scanner.
|
getset |
The scale applied to all vectors rendered with this scanner.
|
getset |
The scale applied to all vectors rendered with this scanner.
|
getset |
Change this scanners draw mode. Defaults to SDF draw mode.
|
getset |
Changes the "spread" of SDF rastered vectors.