This is the cl-vectors Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 08 17:29:23 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-vectors
cl-paths: vectorial paths manipulation
Frederic Jolliton <frederic@jolliton.com>
MIT
vectors.lisp
(file).
cl-aa
cl-aa: polygon rasterizer
Frederic Jolliton <frederic@jolliton.com>
MIT
aa.lisp
(file).
aa-bin.lisp
(file).
cl-paths
cl-paths: vectorial paths manipulation
Frederic Jolliton <frederic@jolliton.com>
MIT
paths-package.lisp
(file).
paths.lisp
(file).
paths-annotation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-vectors/cl-vectors.asd
cl-aa/cl-aa.asd
cl-paths/cl-paths.asd
cl-vectors/vectors.lisp
cl-aa/aa.lisp
cl-aa/aa-bin.lisp
cl-paths/paths-package.lisp
cl-paths/paths.lisp
cl-paths/paths-annotation.lisp
cl-vectors/vectors.lisp
cl-vectors
(system).
update-state
(function).
cl-aa/aa.lisp
cl-aa
(system).
cells-sweep
(function).
cells-sweep/rectangle
(function).
freeze-state
(function).
line
(function).
line-f
(function).
make-state
(function).
scanline-sweep
(function).
scanline-y
(function).
state-reset
(function).
+alpha-divisor+
(constant).
+alpha-range+
(constant).
+cell-width+
(constant).
cell
(structure).
cell-area
(reader).
(setf cell-area)
(writer).
cell-cover
(reader).
(setf cell-cover)
(writer).
cell-empty-p
(function).
cell-p
(function).
cell-reset
(function).
cell-x
(reader).
(setf cell-x)
(writer).
cell-y
(reader).
(setf cell-y)
(writer).
compare-cells
(function).
compute-alpha
(function).
copy-cell
(function).
copy-state
(function).
make-cell
(function).
map-grid-spans
(function).
map-line-spans
(function).
set-current-cell
(function).
state
(structure).
state-cells
(reader).
(setf state-cells)
(writer).
state-current-cell
(reader).
(setf state-current-cell)
(writer).
state-dropped-cells
(reader).
(setf state-dropped-cells)
(writer).
state-end-of-lines
(reader).
(setf state-end-of-lines)
(writer).
state-finalize
(function).
state-p
(function).
state-push-cell
(function).
state-recycling-cells
(reader).
(setf state-recycling-cells)
(writer).
state-scanlines
(reader).
(setf state-scanlines)
(writer).
state-sort-cells
(function).
update-cell
(function).
cl-aa/aa-bin.lisp
cl-aa
(system).
cells-sweep
(function).
line
(function).
line-f
(function).
make-state
(function).
+alpha-range+
(constant).
+cell-width+
(constant).
cell
(structure).
cell-p
(function).
cell-value
(reader).
(setf cell-value)
(writer).
cell-x
(reader).
(setf cell-x)
(writer).
cell-y
(reader).
(setf cell-y)
(writer).
compare-cells
(function).
copy-cell
(function).
copy-state
(function).
make-cell
(function).
map-line-intersections
(function).
set-current-cell
(function).
state
(structure).
state-cells
(reader).
(setf state-cells)
(writer).
state-p
(function).
state-reset
(function).
cl-paths/paths.lisp
paths-package.lisp
(file).
cl-paths
(system).
*arc-length-tolerance*
(special variable).
*bezier-angle-tolerance*
(special variable).
*bezier-distance-tolerance*
(special variable).
clip-path
(function).
clip-path/path
(function).
create-path
(function).
dash-path
(function).
filter-distinct
(function).
make-arc
(function).
make-bezier-curve
(function).
make-catmull-rom
(function).
make-circle-path
(function).
make-discrete-path
(function).
make-point
(function).
make-rectangle-path
(function).
make-rectangle-path/center
(function).
make-regular-polygon-path
(function).
make-simple-path
(function).
make-straight-line
(function).
p*
(function).
p+
(function).
p-
(function).
path-clear
(function).
path-clone
(function).
path-concatenate
(function).
path-extend
(function).
path-iterator
(function).
path-iterator-next
(generic function).
path-iterator-reset
(generic function).
path-iterator-segmented
(function).
path-last-knot
(function).
path-orient
(function).
path-replace
(function).
path-reset
(function).
path-reverse
(function).
path-reversed
(function).
path-rotate
(function).
path-scale
(function).
path-size
(function).
path-transform-as-marker
(function).
path-translate
(function).
point-angle
(function).
point-distance
(function).
point-norm
(function).
point-rotate
(function).
point-x
(function).
point-y
(function).
stroke-path
(function).
*miter-limit*
(special variable).
arc
(class).
bezier
(class).
catmull-rom
(class).
clip-path/1
(function).
clip-path/path/1
(function).
copy-path
(function).
copy-path-iterator-state
(function).
copy-pi-segmented-state
(function).
dash-path/1
(function).
define-for-multiple-paths
(macro).
discrete-bezier-curve
(function).
do-path
(macro).
evaluate-bezier
(function).
filter-distinct-state
(class).
interpolation-clone
(generic function).
interpolation-normal
(generic function).
interpolation-reverse
(generic function).
interpolation-reversed
(generic function).
interpolation-rotate
(generic function).
interpolation-scale
(generic function).
interpolation-segment
(generic function).
interpolation-translate
(generic function).
line-intersection
(function).
line-intersection/delta
(function).
line-normal
(function).
make-path
(function).
make-path-iterator-state
(function).
make-pi-segmented-state
(function).
normalize
(function).
path
(structure).
path-end-info
(function).
path-from-iterator
(function).
path-guess-orientation
(function).
path-interpolations
(reader).
(setf path-interpolations)
(writer).
path-iterator-state
(structure).
path-iterator-state-index
(reader).
(setf path-iterator-state-index)
(writer).
path-iterator-state-p
(function).
path-iterator-state-path
(reader).
(setf path-iterator-state-path)
(writer).
path-knots
(reader).
(setf path-knots)
(writer).
path-orientation
(reader).
(setf path-orientation)
(writer).
path-p
(function).
path-type
(reader).
(setf path-type)
(writer).
pi-segmented-state
(structure).
pi-segmented-state-end-p
(reader).
(setf pi-segmented-state-end-p)
(writer).
pi-segmented-state-index
(reader).
(setf pi-segmented-state-index)
(writer).
pi-segmented-state-p
(function).
pi-segmented-state-path
(reader).
(setf pi-segmented-state-path)
(writer).
pi-segmented-state-predicate
(reader).
(setf pi-segmented-state-predicate)
(writer).
pi-segmented-state-queue
(reader).
(setf pi-segmented-state-queue)
(writer).
point-middle
(function).
split-bezier
(function).
straight-line-p
(function).
stroke-path/1
(function).
svg-arc-parameters
(function).
svg-arc-parameters/reverse
(function).
cl-paths/paths-annotation.lisp
paths-package.lisp
(file).
paths.lisp
(file).
cl-paths
(system).
path-annotated
(function).
Packages are listed by definition order.
net.tuxee.aa-bin
aa-bin
common-lisp
.
cells-sweep
(function).
line
(function).
line-f
(function).
make-state
(function).
+alpha-range+
(constant).
+cell-width+
(constant).
cell
(structure).
cell-p
(function).
cell-value
(reader).
(setf cell-value)
(writer).
cell-x
(reader).
(setf cell-x)
(writer).
cell-y
(reader).
(setf cell-y)
(writer).
compare-cells
(function).
copy-cell
(function).
copy-state
(function).
make-cell
(function).
map-line-intersections
(function).
set-current-cell
(function).
state
(structure).
state-cells
(reader).
(setf state-cells)
(writer).
state-p
(function).
state-reset
(function).
net.tuxee.vectors
vectors
common-lisp
.
net.tuxee.aa
.
net.tuxee.paths
.
update-state
(function).
net.tuxee.paths
paths
common-lisp
.
*arc-length-tolerance*
(special variable).
*bezier-angle-tolerance*
(special variable).
*bezier-distance-tolerance*
(special variable).
clip-path
(function).
clip-path/path
(function).
create-path
(function).
dash-path
(function).
filter-distinct
(function).
make-arc
(function).
make-bezier-curve
(function).
make-catmull-rom
(function).
make-circle-path
(function).
make-discrete-path
(function).
make-point
(function).
make-rectangle-path
(function).
make-rectangle-path/center
(function).
make-regular-polygon-path
(function).
make-simple-path
(function).
make-straight-line
(function).
p*
(function).
p+
(function).
p-
(function).
path-annotated
(function).
path-clear
(function).
path-clone
(function).
path-concatenate
(function).
path-extend
(function).
path-iterator
(function).
path-iterator-next
(generic function).
path-iterator-reset
(generic function).
path-iterator-segmented
(function).
path-last-knot
(function).
path-orient
(function).
path-replace
(function).
path-reset
(function).
path-reverse
(function).
path-reversed
(function).
path-rotate
(function).
path-scale
(function).
path-size
(function).
path-transform-as-marker
(function).
path-translate
(function).
point-angle
(function).
point-distance
(function).
point-norm
(function).
point-rotate
(function).
point-x
(function).
point-y
(function).
stroke-path
(function).
*miter-limit*
(special variable).
arc
(class).
bezier
(class).
catmull-rom
(class).
clip-path/1
(function).
clip-path/path/1
(function).
copy-path
(function).
copy-path-iterator-state
(function).
copy-pi-segmented-state
(function).
dash-path/1
(function).
define-for-multiple-paths
(macro).
discrete-bezier-curve
(function).
do-path
(macro).
evaluate-bezier
(function).
filter-distinct-state
(class).
interpolation-clone
(generic function).
interpolation-normal
(generic function).
interpolation-reverse
(generic function).
interpolation-reversed
(generic function).
interpolation-rotate
(generic function).
interpolation-scale
(generic function).
interpolation-segment
(generic function).
interpolation-translate
(generic function).
line-intersection
(function).
line-intersection/delta
(function).
line-normal
(function).
make-path
(function).
make-path-iterator-state
(function).
make-pi-segmented-state
(function).
normalize
(function).
path
(structure).
path-end-info
(function).
path-from-iterator
(function).
path-guess-orientation
(function).
path-interpolations
(reader).
(setf path-interpolations)
(writer).
path-iterator-state
(structure).
path-iterator-state-index
(reader).
(setf path-iterator-state-index)
(writer).
path-iterator-state-p
(function).
path-iterator-state-path
(reader).
(setf path-iterator-state-path)
(writer).
path-knots
(reader).
(setf path-knots)
(writer).
path-orientation
(reader).
(setf path-orientation)
(writer).
path-p
(function).
path-type
(reader).
(setf path-type)
(writer).
pi-segmented-state
(structure).
pi-segmented-state-end-p
(reader).
(setf pi-segmented-state-end-p)
(writer).
pi-segmented-state-index
(reader).
(setf pi-segmented-state-index)
(writer).
pi-segmented-state-p
(function).
pi-segmented-state-path
(reader).
(setf pi-segmented-state-path)
(writer).
pi-segmented-state-predicate
(reader).
(setf pi-segmented-state-predicate)
(writer).
pi-segmented-state-queue
(reader).
(setf pi-segmented-state-queue)
(writer).
point-middle
(function).
split-bezier
(function).
straight-line-p
(function).
stroke-path/1
(function).
svg-arc-parameters
(function).
svg-arc-parameters/reverse
(function).
net.tuxee.aa
aa
common-lisp
.
cells-sweep
(function).
cells-sweep/rectangle
(function).
freeze-state
(function).
line
(function).
line-f
(function).
make-state
(function).
scanline-sweep
(function).
scanline-y
(function).
state-reset
(function).
+alpha-divisor+
(constant).
+alpha-range+
(constant).
+cell-width+
(constant).
cell
(structure).
cell-area
(reader).
(setf cell-area)
(writer).
cell-cover
(reader).
(setf cell-cover)
(writer).
cell-empty-p
(function).
cell-p
(function).
cell-reset
(function).
cell-x
(reader).
(setf cell-x)
(writer).
cell-y
(reader).
(setf cell-y)
(writer).
compare-cells
(function).
compute-alpha
(function).
copy-cell
(function).
copy-state
(function).
make-cell
(function).
map-grid-spans
(function).
map-line-spans
(function).
set-current-cell
(function).
state
(structure).
state-cells
(reader).
(setf state-cells)
(writer).
state-current-cell
(reader).
(setf state-current-cell)
(writer).
state-dropped-cells
(reader).
(setf state-dropped-cells)
(writer).
state-end-of-lines
(reader).
(setf state-end-of-lines)
(writer).
state-finalize
(function).
state-p
(function).
state-push-cell
(function).
state-recycling-cells
(reader).
(setf state-recycling-cells)
(writer).
state-scanlines
(reader).
(setf state-scanlines)
(writer).
state-sort-cells
(function).
update-cell
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The maximum length of segment describing an arc.
The default angle tolerance (in radian) used when rendering Bezier curves
The default distance tolerance used when rendering Bezier curves.
Call FUNCTION for each pixel on the polygon path described by previous call to LINE or LINE-F. The pixels are scanned in increasing Y, then on increasing X. For optimization purpose, the optional FUNCTION-SPAN, if provided, is called for a full span of identical alpha pixel. If not provided, a call is made to FUNCTION for each pixel in the span.
Call FUNCTION for each pixel on the polygon described by
previous call to LINE or LINE-F. The pixels are scanned in
increasing Y, then on increasing X.
For optimization purpose, the optional FUNCTION-SPAN, if provided, is called for a full span of identical alpha pixel. If not provided, a call is made to FUNCTION for each pixel in the span.
Call FUNCTION for each pixel on the polygon described by
previous call to LINE or LINE-F. The pixels are scanned in
increasing Y, then on increasing X. This is limited to the
rectangle region specified with (X1,Y1)-(X2,Y2) (where X2 must be
greater than X1 and Y2 must be greater than Y1, to describe a
non-empty region.)
For optimization purpose, the optional FUNCTION-SPAN, if provided, is called for a full span of identical alpha pixel. If not provided, a call is made to FUNCTION for each pixel in the span.
Create a new path of the given type. The type must be one of
the following keyword:
:open-polyline – An open polyline path,
:closed-polyline – A closed polyline path,
:polygon – Like :closed-polyline, but implicitly filled.
Freeze the state and return a list of scanlines. A scanline is an object which can be examined with SCANLINE-Y and processed with SCANLINE-SWEEP.
Draw a line from (X1,Y1) to (X2,Y2). All coordinates are integers with subpixel accuracy (a pixel width is given by +CELL-WIDTH+.) The line must be part of a closed polygon.
Draw a line, whose coordinates are translated to fixed-point as expected by function LINE. This is a convenient function to not depend on +CELL-WIDTH+.
Draw a line, whose coordinates are translated to fixed-point as expected by function LINE. This is a convenient function to not depend on +CELL-WIDTH+.
Construct a path to represent a circle centered at CX,CY of the specified RADIUS.
Construct a path with only straight lines.
Create a path with only straight line, by specifying only knots.
Annotate the path with visual effect (like color for each type
of interpolation, circle to represent knots,..)
path – a path or a list of path
Return a list of (color . paths).
Clear the path such that it is empty.
Append OTHER-PATH to PATH, joined by INTERPOLATION.
Extend the path to KNOT, with INTERPOLATION.
Return the last knot of the path. Return NIL if the path is empty.
Orient the path in the given orientation.
If OTHER-PATHS is specified, then the paths are reversed inconditionnaly if PATH is also reversed.
Replace PATH with contents of OTHER-PATH.
Reset the path such that it is a single knot.
Rotate the whole path by ANGLE radian around CENTER (which is the origin if unspecified.)
Scale the whole path by (SCALE-X,SCALE-Y) from CENTER (which is the origin if unspecified.) Warning: not all interpolations support non uniform scaling (when scale-x /= scale-y).
Return the number of knots on the path.
Translate, rotate and scale PATH representing a marker such that it is adapted to the PATH-REFERENCE. If SIDE is false, it is placed at the start of the path, otherwise it is placed at the end of the path.
Translate the whole path accordingly to VECTOR.
Compute the angle of POINT relatively to the X axis.
Compute the distance between P1 and P2.
Compute the distance of POINT from origin.
Rotate POINT by ANGLE radian around the origin.
Call FUNCTION for each pixel on the polygon covered by SCANLINE. The pixels are scanned in increasing X. The sweep can be limited to a range by START (included) or/and END (excluded).
Get the Y position of SCANLINE.
Reset the state, losing all accumulated cells. It can be faster or less memory consuming to reset a state and reuse it, rather than creating a new state.
Move the iterator to the next knot, and return
3 values: INTERPOLATION, KNOT and END-P. INTERPOLATION is the
interpolation between the previous knot and the current one. For
the first iteration, INTERPOLATION is usually the implicit
straight line between the last knot and the first knot. KNOT and
INTERPOLATION are null if the path is empty. END-P is true if the
knot is the last on the path or if the path is empty.
filter-distinct-state
)) ¶pi-segmented-state
)) ¶path-iterator-state
)) ¶Reset the iterator before the first knot.
filter-distinct-state
)) ¶pi-segmented-state
)) ¶path-iterator-state
)) ¶Constant used to translate value computed by AREA and COVER to an alpha value.
For non overlapping polygons, the alpha value will be in the
range (-limit,limit) where limit is +alpha-range+. The value is
negative or positive accordingly to the polygon
orientation (clockwise or counter-clockwise.)
For non overlapping polygons, the alpha value will be in the
range (-limit,limit) where limit is +alpha-range+. The value is
negative or positive accordingly to the polygon
orientation (clockwise or counter-clockwise.)
A cell represent a pixel square, and the width is the fractional part of the fixed-point coordinate. A large value increase precision. 256 should be enough though. Note that smaller value should NOT increase performance.
A cell represent a pixel square, and the width is the fractional part of the fixed-point coordinate. A large value increase precision. 256 should be enough though. Note that smaller value should NOT increase performance.
Miter limit before reverting to bevel joint. Must be >=1.0.
Define a new function named by NAME-MULTIPLE which accepts either a single path or a list of paths as input from a function named by NAME-SINGLE accepting only a single path and producing a list of paths.
area
.
Test if the cell is empty. A cell is empty when COVER and AREA are both zero.
Reset the cell such that CELL-EMPTY-P is true.
Compare coordinates between 2 cells. Used to sort cells by Y, then by X.
Compare coordinates between 2 cells. Used to sort cells by Y, then by X.
Compute the alpha value given the accumulated cover and the actual area of a cell.
Dash path. If TOGGLE-P is true, segments of odd indices are kept, while if TOGGLE-P is false, segments of even indices are kept. CYCLE indicate where to cycle the SIZES once the end is reached.
Subdivize Bezier curve up to certain criterions.
Evaluate the point at POSITION on the Bezier curve described by POINTS.
Compute the intersection between 2 lines (x1,y1)-(x2,y2) and (x3,y3)-(x4,y4). Return the coordinates of the intersection points as 2 values. If the 2 lines are colinears, return NIL.
Compute the intersection between the line by (x1,y1) and
direction (dx1,dy1) and the line by (x2,y2) and
direction (dx2,dy2). Return the coordinates of the intersection
points as 2 values. If the 2 lines are colinears, return NIL.
Normalize the vector (X2-X1,Y2-Y1). See NORMALIZE.
Call FUNCTION for each segments of the line from (X1,Y1) to (X2,Y2) cut by a grid with spacing +CELL-WIDTH+.
Call FUNCTION for each segment of a line with integer coordinates (A1,B1)-(A2,B2) cut by a grid of spacing +CELL-WIDTH+.
Normalize the vector (X,Y) such that its length is LENGTH (or 1.0 if unspecified.) Return the component of the resulting vector as 2 values. Return NIL if the input vector had a null length.
Construct a new path from the given iterator.
Guess the orientation of the path.
This is implemented loosely because we don’t take care about
interpolations. We only consider a polygon described by the
knots. However, it should work..
Update path orientation flag, and returns either :CW or :CCW.
path
.
type
.
path
.
Compute the point between P1 and P2.
Ensure current cell is one at coordinate X and Y. If not,
the current cell is stored, then reset accordingly to new
coordinate.
Returns the current cell.
Split the Bezier curve described by POINTS at POSITION into two Bezier curves of the same degree. Returns the curves as 2 values.
Finalize the state.
Store a copy of the current cell into the cells list. If the state was reset, possibly reuse previous cells.
Reset the state, losing all accumulated cells. It can be faster or less memory consuming to reset a state and reuse it, rather than creating a new state.
Sort the cells by Y, then by X.
Stroke the path.
Conversion from endpoint to center parameterization of SVG arc.
Returns values RC, RX, RY, START-ANGLE and DELTA-ANGLE, where RC is
the center of the ellipse, RX and RY are the normalized
radii (needed if scaling was necessary).
Conversion from center to endpoint parameterization of SVG arc.
Returns values P1, P2, LARGE-ARC-FLAG-P, SWEEP-FLAG-P.
Update COVER and AREA given a segment inside the corresponding cell. FX1, FY1, FX2 and FY2 must be subpixel coordinates between 0 and +CELL-WIDTH+ included.
Duplicate INTERPOLATION.
catmull-rom
)) ¶(eql :straight-line)
)) ¶Compute the normal, going "outside" at
either K1 (if SIDE is false) or K2 (if SIDE is true). Return NIL
if the normal cannot be computed. Return a point otherwise.
catmull-rom
) k1 k2 side) ¶(eql :straight-line)
) k1 k2 side) ¶Reverse the path described by INTERPOLATION in-place.
catmull-rom
)) ¶(eql :straight-line)
)) ¶Duplicate and reverse the INTERPOLATION.
catmull-rom
) angle) ¶(eql :straight-line)
) angle) ¶catmull-rom
) scale-x scale-y) ¶(eql :straight-line)
) scale-x scale-y) ¶Segment the path between K1 and K2 described
by the INTERPOLATION. Call FUNCTION for each generated point on
the interpolation path.
catmull-rom
) k1 k2 function) ¶(eql :straight-line)
) k1 k2 function) ¶catmull-rom
) vector) ¶(eql :straight-line)
) vector) ¶A cell used to represent the partial area covered by a line passing by a corresponding pixel. The cell alone doesn’t hold all the information to calculate the area.
structure-object
.
common-lisp
.
(member :open-polyline :closed-polyline :polygon)
:open-polyline
(member :unknown :cw :ccw)
:unknown
(make-array 0 :adjustable t :fill-pointer 0)
(make-array 0 :adjustable t :fill-pointer 0)
AA state. Hold all the cells generated when drawing lines.
structure-object
.
AA state. Hold all the cells generated when drawing lines.
structure-object
.
net.tuxee.aa::cell
(net.tuxee.aa::make-cell)
(cons nil nil)
net.tuxee.paths::rx
net.tuxee.paths::ry
net.tuxee.paths::x-axis-rotation
net.tuxee.paths::large-arc-flag
net.tuxee.paths::sweep-flag
(make-array 0)
net.tuxee.paths::control-points
Jump to: | (
C D E F G I L M N P S U |
---|
Jump to: | (
C D E F G I L M N P S U |
---|
Jump to: | *
+
A C D E F H I K L N O P Q R S T V X Y |
---|
Jump to: | *
+
A C D E F H I K L N O P Q R S T V X Y |
---|
Jump to: | A B C F N P S V |
---|
Jump to: | A B C F N P S V |
---|