Abstract base class for implementations of the IShapeRasterizer interface.
abstract class
|
ShapeRasterizer
|
with
|
<T>
|
as
|
class, ISampleBufferBase
|
implements
|
IShapeRasterizer<T>
|
The factory that has created this shape rasterizer.
public
property
|
Factory
{
get
}
|
||
type
|
IShapeRasterizerFactory<T>
|
||
value
|
|
The factory. | |
implements
|
IShapeRasterizer.Factory
|
Returns the distance value range that will be used by shape rasterizers.
public
virtual
method
|
Range
()
|
||
type
|
RangeD
|
||
returns
|
The distance value range. | ||
implements
|
IShapeRasterizer.Range
|
Returns the distance value range that will be used by shape rasterizers.
public
virtual
method
|
Range
(T target)
|
||
type
|
RangeD
|
||
params
|
target
|
[not-null]
|
The target sample buffer. |
returns
|
The distance value range for the given sample buffer. | ||
implements
|
IShapeRasterizer.Range
|
Rasterizes this shape.
public
method
|
Rasterize
(T target,
Box2D bounds = default(Box2D),
float64 scale = 1,
PixelCoverage coverage = PixelCoverage.PixelIsArea,
CubemapFace face = CubemapFace.None)
|
||
type
|
bool
|
||
params
|
target
|
[not-null]
|
The target sample buffer. |
bounds
|
The
bounds
of
the
target
distance
buffer,
in
the
coordinate
system
of
the
shape:
X1 and Y1 refer to the top-left corner of the top-left sample in target, and X2 and Y2 refer to the bottom-right corner of the bottom-right sample. When target has PixelIsPoint coverage (see coverage), the top-left and bottom-right corners coincide. Passing Bounds to this parameter will render the whole shape. If bounds is empty (see IsEmpty), the shape bounds will be used. Defaults to Empty. |
||
scale
|
Optional
scale
factor
to
apply
to
distance
values.
Defaults
to
1 .
|
||
coverage
|
The coverage semantic of the samples if target. Defaults to PixelIsArea. | ||
face
|
The cubemap face. This is only relevant for cubemap shapes (see IsCubemap). Defaults to None. | ||
returns
|
true
if
target
has
been
updated
with
rasterized
samples,
false
if
bounds
did
not
intersect
the
shape.
|
||
implements
|
IShapeRasterizer.Rasterize
|
The shape that is being rasterized.
protected
readonly
field
|
shape
|
||
type
|
IShape
|
Creates a new instance of ShapeRasterizer.
protected
constructor
|
ShapeRasterizer
(IShapeRasterizerFactory<T> factory,
IShape shape,
bool uniform)
|
||
params
|
factory
|
[not-null]
|
The owning factory. |
shape
|
[not-null]
|
The shape instance. | |
uniform
|
true
if
this
shape
rasterizer
works
uniformly,
based
on
distance
only;
false
if
the
rasterizer
uses
additional
information,
such
as
nearest
vertices.
|
Clears the given block to an uniform sample value.
protected
abstract
method
|
Clear
(T target,
int32 x,
int32 y,
int32 width,
int32 height,
float64 distance)
|
||
params
|
target
|
The target buffer. | |
x
|
X-coordinate of top-left sample to clear. | ||
y
|
Y-coordinate of top-left sample to clear. | ||
width
|
Width of sample block. | ||
height
|
Height of sample block. | ||
distance
|
Uniform distance value. |
Fills the given block according to shape distance values.
protected
abstract
method
|
Fill
(T target,
int32 x,
int32 y,
int32 width,
int32 height,
float64 shapeX,
float64 shapeY,
float64 shapeDeltaX,
float64 shapeDeltaY,
float64 scale,
bool area)
|
||
params
|
target
|
The target buffer. | |
x
|
Buffer X-coordinate of top-left sample to fill. | ||
y
|
Buffer Y-coordinate of top-left sample to fill. | ||
width
|
Width of sample block. | ||
height
|
Height of sample block. | ||
shapeX
|
Shape X-coordinate that corresponds to top-left buffer sample. | ||
shapeY
|
Shape Y-coordinate that corresponds to top-left buffer sample. | ||
shapeDeltaX
|
Step distance from one sample to adjacent one, along shape X-axis. | ||
shapeDeltaY
|
Step distance from one sample to adjacent one, along shape Y-axis. | ||
scale
|
Scale factor to apply to computed shape distance values. | ||
area
|
true
if
each
sample
represents
an
area,
false
if
each
sample
represents
a
point.
|