Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    •  Overview
    • ApplyPath()
    • ArcTo()
    • CharWidth()
    • ClosePath()
    • Curve3()
    • Curve4()
    • DrawPath()
    • FlushMatrix()
    • GenerateEllipse()
    • GeneratePath()
    • GenerateRectangle()
    • GetFontHandle()
    • GetFontMetrics()
    • GetVertex()
    • LineTo()
    • MoveTo()
    • Multiply()
    • MultiplyMatrix()
    • ParseTransform()
    • ReadPainter()
    • ResetMatrix()
    • RewindPath()
    • Rotate()
    • Scale()
    • Skew()
    • Smooth3()
    • Smooth4()
    • StringWidth()
    • TracePath()
    • Translate()
    • TranslatePath()
    • Audio
    • Config
    • Core
    • Display
    • Document
    • Font
    • HTTP
    • Network
    • Regex
    • SVG
    • Tiri
    • Vector
    • XML
    • XQuery
    • XRandR
      • Audio
      • MP3
      • Sound
      • File
      • MetaClass
      • Module
      • StorageDevice
      • Task
      • Thread
      • Time
      • Compression
      • CompressedStream
      • Config
      • LZMAStream
      • Script
      • Tiri
      • XML
      • XQuery
      • Controller
      • BlurFX
      • ColourFX
      • CompositeFX
      • ConvolveFX
      • DisplacementFX
      • FilterEffect
      • FloodFX
      • ImageFX
      • LightingFX
      • MergeFX
      • MorphologyFX
      • OffsetFX
      • RemapFX
      • SourceFX
      • TurbulenceFX
      • WaveFunctionFX
      • Scintilla
      • Bitmap
      • Clipboard
      • Display
      • Document
      • Font
      • Image
      • Pointer
      • Surface
      • SVG
      • ClientSocket
      • HTTP
      • NetClient
      • NetLookup
      • NetServer
      • NetSocket
      • Proxy
      • Gradient
      • GradientConic
      • GradientContour
      • GradientDiamond
      • GradientDiffusion
      • GradientDistal
      • GradientGouraud
      • GradientLinear
      • GradientMesh
      • GradientRadial
      • GradientVoronoi
      • Vector
      • VectorClip
      • VectorColour
      • VectorEllipse
      • VectorFilter
      • VectorGradient
      • VectorGroup
      • VectorImage
      • VectorPath
      • VectorPattern
      • VectorPolygon
      • VectorRectangle
      • VectorScene
      • VectorShape
      • VectorSpiral
      • VectorText
      • VectorTransition
      • VectorViewport
      • VectorWave
      • Linux Builds
      • Windows Builds
      • Customising Your Build
      • Kōtuku Objects
      • Kōtuku In Depth
      • Kōtuku Design Patterns
      • Coding With AI
      • Regex Manual
      • XML Comparisons
      • Tiri Reference Manual
      • Config API
      • Defer Syntax
      • GUI API
      • HTTP Server API
      • I/O API
      • JSON API
      • OAuth API
      • Options API
      • Proxy Server API
      • Tempus API
      • URL API
      • VFX API
      • Widgets
      • RIPL Reference Manual
      • Origo
      • Flute / Unit Testing
      • Tuku
      • Embedded Document Format
      • TDL Reference Manual
      • TDL Tools
      • Action Reference Manual
      • System Error Codes

Vector Module

Create, manipulate and draw vector graphics to bitmaps.

The Vector module exports a small number of functions to assist the Vector class, as well as some primitive functions for creating paths and rendering them to bitmaps.

Functions

ApplyPath | ArcTo | CharWidth | ClosePath | Curve3 | Curve4 | DrawPath | FlushMatrix | GenerateEllipse | GeneratePath | GenerateRectangle | GetFontHandle | GetFontMetrics | GetVertex | LineTo | MoveTo | Multiply | MultiplyMatrix | ParseTransform | ReadPainter | ResetMatrix | RewindPath | Rotate | Scale | Skew | Smooth3 | Smooth4 | StringWidth | TracePath | Translate | TranslatePath

Structures

DiffusionCurveRecord | FontMetrics | GouraudVertex | GradientStop | MergeSource | MeshControl | MeshPatchRecord | PathCommand | Transition | VectorMatrix | VectorPainter | VectorPoint | VoronoiPoint

Classes

BlurFX | ColourFX | CompositeFX | ConvolveFX | DisplacementFX | FilterEffect | FloodFX | Gradient | GradientConic | GradientContour | GradientDiamond | GradientDiffusion | GradientDistal | GradientGouraud | GradientLinear | GradientMesh | GradientRadial | GradientVoronoi | ImageFX | LightingFX | MergeFX | MorphologyFX | OffsetFX | RemapFX | SourceFX | TurbulenceFX | Vector | VectorClip | VectorColour | VectorEllipse | VectorFilter | VectorGroup | VectorImage | VectorPath | VectorPattern | VectorPolygon | VectorRectangle | VectorScene | VectorShape | VectorSpiral | VectorText | VectorTransition | VectorViewport | VectorWave | WaveFunctionFX

Constants

ARC | JET | JTYPE | PE | VSF

ApplyPath()

Applies a generated path resource to a VectorPath object.

ERR vec::ApplyPath(APTR Path, objVectorPath * VectorPath)
ParameterDescription
PathThe source path to be copied.
VectorPathThe target VectorPath object.

Any path originating from GeneratePath(), GenerateEllipse() or GenerateRectangle() can be applied to a VectorPath object by calling ApplyPath(). The source Path can then be deallocated with FreeResource() if it is no longer required.

This function is intended for paths that are generated or changed at run-time, where converting the path back to a string would add unnecessary processing overhead.

Error Codes

OkayOperation successful.
InvalidDataThere is an error in the provided data
NullArgsFunction call missing argument value(s)
WrongClassAn object is not of the required class type
Vector module documentation © Paul Manias © 2010-2026

ArcTo()

Appends an arc command to a generated path.

void vec::ArcTo(APTR Path, DOUBLE RX, DOUBLE RY, DOUBLE Angle, DOUBLE X, DOUBLE Y, ARC Flags)
ParameterDescription
PathThe vector path to modify.
RXThe horizontal radius of the arc.
RYThe vertical radius of the arc.
AngleThe angle of the arc, expressed in radians.
XThe horizontal end point for the arc command.
YThe vertical end point for the arc command.
FlagsOptional flags.

This function appends an arc segment from the current point to X,Y. The LARGE and SWEEP values in Flags control which of the possible arcs is selected.

Vector module documentation © Paul Manias © 2010-2026

CharWidth()

Returns the rendered width of a single character.

DOUBLE vec::CharWidth(APTR FontHandle, UINT Char, UINT KChar, DOUBLE * Kerning)
ParameterDescription
FontHandleThe font to use for calculating the character width.
CharA 32-bit unicode character.
KCharA unicode character to use for calculating the font kerning (optional).
KerningThe resulting kerning value (optional).

This function returns the pixel width of a font character. The character is specified as a Unicode value in the Char parameter. Kerning can also be returned for positioning the character against a preceding character. Pass the preceding character in KChar and a Kerning pointer to receive the horizontal adjustment. If kerning information is not required, set KChar to zero and Kerning to NULL.

The font's glyph spacing value is not used in calculating the character width.

Result

The pixel width of the character, or 0 if FontHandle is NULL.

Vector module documentation © Paul Manias © 2010-2026

ClosePath()

Closes the current sub-path.

void vec::ClosePath(APTR Path)
ParameterDescription
PathThe vector path to modify.

This function appends a close-path command that connects the current point to the beginning of the current sub-path.

Closing a path does not terminate the path resource. Further sub-paths can be added to the sequence, and fill rules can then be used to control how overlapping areas are rendered.

Vector module documentation © Paul Manias © 2010-2026

Curve3()

Appends a quadratic Bezier curve to a generated path.

void vec::Curve3(APTR Path, DOUBLE CtrlX, DOUBLE CtrlY, DOUBLE X, DOUBLE Y)
ParameterDescription
PathThe vector path to modify.
CtrlXControl point horizontal coordinate.
CtrlYControl point vertical coordinate.
XThe horizontal end point for the curve3 command.
YThe vertical end point for the curve3 command.

This function appends a quadratic Bezier segment from the current point to X,Y using CtrlX,CtrlY as the control point.

Vector module documentation © Paul Manias © 2010-2026

Curve4()

Appends a cubic Bezier curve to a generated path.

void vec::Curve4(APTR Path, DOUBLE CtrlX1, DOUBLE CtrlY1, DOUBLE CtrlX2, DOUBLE CtrlY2, DOUBLE X, DOUBLE Y)
ParameterDescription
PathThe vector path to modify.
CtrlX1Control point 1 horizontal coordinate.
CtrlY1Control point 1 vertical coordinate.
CtrlX2Control point 2 horizontal coordinate.
CtrlY2Control point 2 vertical coordinate.
XThe horizontal end point for the curve4 command.
YThe vertical end point for the curve4 command.

This function appends a cubic Bezier segment from the current point to X,Y using two control points.

Vector module documentation © Paul Manias © 2010-2026

DrawPath()

Draws a generated vector path to a target bitmap.

ERR vec::DrawPath(objBitmap * Bitmap, APTR Path, DOUBLE StrokeWidth, OBJECTPTR StrokeStyle, OBJECTPTR FillStyle)
ParameterDescription
BitmapPointer to a target Bitmap object.
PathThe vector path to render.
StrokeWidthThe width of the stroke. Set to 0 if no stroke is required.
StrokeStylePointer to a valid object for stroke definition, or NULL if none required.
FillStylePointer to a valid object for fill definition, or NULL if none required.

Use DrawPath() to draw a generated path to a Bitmap, using customised fill and stroke definitions. This functionality provides an effective alternative to configuring vector scenes for situations where only simple vector shapes are required. However, it is limited in that advanced rendering options and effects are not available to the client.

At least one of StrokeStyle or FillStyle is required to render visible output. Valid styles are allocated and configured using recognised vector style objects, specifically VectorImage, VectorPattern and Gradient. If a fill or stroke operation is not required, set the relevant parameter to NULL. Stroke rendering is also disabled when StrokeWidth is less than 0.001.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

FlushMatrix()

Marks a vector transform as changed after direct matrix edits.

ERR vec::FlushMatrix(struct VectorMatrix * Matrix)
ParameterDescription
MatrixThe matrix to be flushed.

If a vector's matrix values have been modified directly by the client, call FlushMatrix() before the next draw cycle so the owning vector is marked for transform recalculation.

Note that if the client uses API functions to modify a VectorMatrix, a call to FlushMatrix() is unnecessary as the vector will have already been marked for an update.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

GenerateEllipse()

Generates an elliptical path resource.

ERR vec::GenerateEllipse(DOUBLE CX, DOUBLE CY, DOUBLE RX, DOUBLE RY, INT Vertices, APTR * Path)
ParameterDescription
CXHorizontal centre point of the ellipse.
CYVertical centre point of the ellipse.
RXHorizontal radius of the ellipse.
RYVertical radius of the ellipse.
VerticesOptional. If this is 3 or greater, the ellipse will be generated with exactly this many vertices.
PathA pointer variable that will receive the resulting path.

Use GenerateEllipse() to create an elliptical path suitable for passing to vector functions that receive a Path parameter. The path must be manually deallocated with FreeResource() once it is no longer required.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
CreateResourceFailed to create a new resource
Vector module documentation © Paul Manias © 2010-2026

GeneratePath()

Generates a path resource from an SVG path command sequence.

ERR vec::GeneratePath(STRVIEW Sequence, APTR * Path)
ParameterDescription
SequenceThe command sequence to process. If no sequence is specified then the path will be empty.
PathA pointer variable that will receive the resulting path.

This function generates a vector path from a sequence of coordinates and path instructions. The resulting path can then be passed to vector functions that receive a Path parameter. The path must be manually deallocated with FreeResource() once it is no longer required.

The Sequence string is based on the SVG path element's d attribute. Uppercase commands use absolute coordinates; lowercase commands use coordinates relative to the previous command.

The following commands are supported:

M: Move To
L: Line To
V: Vertical Line To
H: Horizontal Line To
Q: Quadratic Curve To
T: Quadratic Smooth Curve To
C: Curve To
S: Smooth Curve To
A: Arc
Z: Close Path

If Sequence is empty, an empty path resource will be generated. This path can be populated with functions such as MoveTo() and LineTo().

Error Codes

OkayOperation successful.
InvalidDataThere is an error in the provided data
AllocMemoryFailed to create a new memory block
BufferOverflowA buffer overflow has occurred
NullArgsFunction call missing argument value(s)
InvalidValueA value has not passed validation
Vector module documentation © Paul Manias © 2010-2026

GenerateRectangle()

Generates a rectangular path resource.

ERR vec::GenerateRectangle(DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height, APTR * Path)
ParameterDescription
XThe horizontal position of the rectangle.
YThe vertical position of the rectangle.
WidthThe width of the rectangle.
HeightThe height of the rectangle.
PathA pointer variable that will receive the resulting path.

Use GenerateRectangle() to create a rectangular path suitable for passing to vector functions that receive a Path parameter. The path must be manually deallocated with FreeResource() once it is no longer required.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
CreateResourceFailed to create a new resource
Vector module documentation © Paul Manias © 2010-2026

GetFontHandle()

Returns a cached handle for a font family, style and size.

ERR vec::GetFontHandle(STRVIEW Family, STRVIEW Style, INT Weight, INT Size, APTR * Handle)
ParameterDescription
FamilyThe name of the font family to access.
StyleThe preferred style to choose from the family. Use Regular or NULL for the default.
WeightEquivalent to CSS font-weight; a value of 400 or 0 will equate to normal.
SizeThe font-size, measured in pixels @ 72 DPI.
HandleThe resulting font handle is returned here.

For a given font family, style and size, this function returns a Handle that can be passed to font querying functions.

The handle is deterministic and permanent, remaining valid for the lifetime of the program.

Error Codes

OkayOperation successful.
FailedGeneral failure
FileFile error, e.g. file not found
SearchA search routine in this function failed
ArgsInvalid arguments passed to function
AccessObjectAttempting to lock an object failed
AllocMemoryFailed to create a new memory block
ResolvePathA call to ResolvePath() failed
CreateObjectA call to CreateObject() failed
Vector module documentation © Paul Manias © 2010-2026

GetFontMetrics()

Returns display metrics for a font handle.

ERR vec::GetFontMetrics(APTR Handle, struct FontMetrics * Info)
ParameterDescription
HandleA font handle obtained from GetFontHandle().
InfoThe font metrics for the Handle will be stored here.

Call GetFontMetrics() to retrieve the font height, line spacing, ascent and descent values for a font handle.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

GetVertex()

Retrieves the next vertex from a generated path.

INT vec::GetVertex(APTR Path, DOUBLE * X, DOUBLE * Y)
ParameterDescription
PathThe vector path to query.
XPointer to a double that will receive the X coordinate value.
YPointer to a double that will receive the Y coordinate value.

The coordinates of the next vertex are returned in X and Y. The return value is the internal command value for that vertex, or the path stop command when there are no more vertices to read.

Result

The internal command value for the vertex will be returned.

Vector module documentation © Paul Manias © 2010-2026

LineTo()

Appends a line segment to a generated path.

void vec::LineTo(APTR Path, DOUBLE X, DOUBLE Y)
ParameterDescription
PathThe vector path to modify.
XThe line end point on the horizontal plane.
YThe line end point on the vertical plane.

This function appends a straight line from the current point to X,Y.

Vector module documentation © Paul Manias © 2010-2026

MoveTo()

Moves the current point in a generated path.

void vec::MoveTo(APTR Path, DOUBLE X, DOUBLE Y)
ParameterDescription
PathThe vector path to modify.
XThe horizontal end point for the command.
YThe vertical end point for the command.

This function appends a move command. The current point is moved to X,Y without drawing a line.

Vector module documentation © Paul Manias © 2010-2026

Multiply()

Multiplies a matrix by explicit affine transform values.

ERR vec::Multiply(struct VectorMatrix * Matrix, DOUBLE ScaleX, DOUBLE ShearY, DOUBLE ShearX, DOUBLE ScaleY, DOUBLE TranslateX, DOUBLE TranslateY)
ParameterDescription
MatrixThe target transformation matrix.
ScaleXMatrix value A.
ShearYMatrix value B.
ShearXMatrix value C.
ScaleYMatrix value D.
TranslateXMatrix value E.
TranslateYMatrix value F.

This function multiplies the target VectorMatrix by the supplied affine transform values.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

MultiplyMatrix()

Multiplies a target matrix by a source matrix.

ERR vec::MultiplyMatrix(struct VectorMatrix * Target, struct VectorMatrix * Source)
ParameterDescription
TargetThe target transformation matrix.
SourceThe source transformation matrix.

This function multiplies Target by Source and stores the result in Target.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

ParseTransform()

Parses an SVG transform string and applies it to a matrix.

ERR vec::ParseTransform(struct VectorMatrix * Matrix, STRVIEW Transform)
ParameterDescription
MatrixThe target transformation matrix.
TransformThe transform to apply, expressed as a string instruction.

This function parses a sequence of SVG transform instructions and applies them to a matrix.

The string must be written using SVG transform attribute syntax. For example, skewX(20) rotate(45 50 50) is valid. Transform instructions are applied in reverse order, as required by the SVG transform model. Unsupported transform text is skipped.

Any existing values in Matrix are reset before the parsed transforms are applied. If existing matrix values need to be retained, parse into a separate matrix and use MultiplyMatrix() to combine the result.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

ReadPainter()

Parses a painter string to its colour, gradient, pattern or image value.

ERR vec::ReadPainter(objVectorScene * Scene, STRVIEW IRI, struct VectorPainter * Painter, STRVIEW * Result)
ParameterDescription
SceneOptional. Required if url() references are to be resolved.
IRIThe IRI string to be translated.
PainterThis VectorPainter structure will store the deserialised result.
ResultOptional reference for storing the end of the parsed IRI string. An empty string is returned if there is no further content to parse or an error occurred.

This function will parse an SVG style IRI into its equivalent logical values. The results can then be processed for rendering a stroke or fill operation in the chosen style.

Colours can be expressed in the following formats:

NameDescription
Named colourStandard SVG colour names such as orange and red are accepted. Application-defined colour names are also supported.
#RRGGBB / #RRGGBBAAHexadecimal formats. Alpha defaults to fully opaque when omitted.
rgb(R,G,B) / rgba(R,G,B,A)Legacy comma-separated format. Component values range from 0 to 255, or from 0% to 100%. The alpha component ranges from 0.0 to 1.0 (or 0% to 100%).
rgb(R G B) / rgb(R G B / A)Modern CSS space-separated format. Component values range from 0 to 255, or from 0% to 100%. Alpha is optional, preceded by /, and ranges from 0.0 to 1.0 (or 0% to 100%).
hsl(H,S,L) / hsla(H,S,L,A)Hue is expressed in degrees (0-360). Saturation and lightness are percentages. Alpha ranges from 0.0 to 1.0.
hsv(H,S,V)Hue in degrees (0-360), saturation and value as percentages. An optional alpha component ranging from 0.0 to 1.0 is supported.
oklab(L a b [/ A])CSS Color Level 4 OKLAB colour space. Lightness (L) is 0-1 or 0%-100%. The a and b axes range from approximately -0.4 to 0.4, or as percentages where 100% equals 0.4. Alpha (A) is optional, preceded by /, and ranges from 0.0 to 1.0 or 0% to 100%.
oklch(L C H [/ A])CSS Color Level 4 OKLCh colour space. Lightness (L) is 0-1 or 0%-100%. Chroma (C) is an unbounded positive value, or a percentage where 100% equals 0.4. Hue (H) is in degrees. Alpha (A) is optional, preceded by /, and ranges from 0.0 to 1.0 or 0% to 100%.
lab(L a b [/ A])CSS Color Level 4 CIE Lab colour space. Lightness (L) is 0-100 or 0%-100%. The a and b axes range from approximately -125 to 125, or as percentages where 100% equals 125. Alpha (A) is optional, preceded by /, and ranges from 0.0 to 1.0 or 0% to 100%.
lch(L C H [/ A])CSS Color Level 4 CIE LCH colour space (cylindrical form of Lab). Lightness (L) is 0-100 or 0%-100%. Chroma (C) is an unbounded positive value, or a percentage where 100% equals 150. Hue (H) is in degrees. Alpha (A) is optional, preceded by /, and ranges from 0.0 to 1.0 or 0% to 100%.

A Gradient, Image or Pattern can be referenced using the url(#name) format, where name is a definition registered with the provided Scene object. If Scene is NULL then it will not be possible to find the reference. Any failure to look up a reference will result in an error. The Scene parameter accepts either a VectorScene or a Vector object if its Scene field value is defined.

To access one of the pre-defined colourmaps, use the format url(#cmap:name). The colourmap will be accessible as a linear gradient that belongs to the Scene. Valid colourmap names are cmap:crest, cmap:flare, cmap:icefire, cmap:inferno, cmap:magma, cmap:mako, cmap:plasma, cmap:rocket, cmap:viridis.

A VectorPainter structure must be provided by the client and will be used to store the final result. All pointers that are returned will remain valid as long as the provided Scene exists with its registered painter definitions. An optional Result string can store a reference to the character position up to which the IRI was parsed.

Note: To ensure that colour values are never clipped, values stored in the Colour field are unclamped from the sRGB colour space (colours may be negative or exceed 1.0). Clients must clamp colours as necessary when converting to their target colour space.

Error Codes

OkayOperation successful.
NotFoundA search routine in this function failed
SyntaxInvalid syntax detected
NullArgsFunction call missing argument value(s)
InvalidObjectAn object is not of the required class type
Vector module documentation © Paul Manias © 2010-2026

ResetMatrix()

Resets a transformation matrix to the identity transform.

ERR vec::ResetMatrix(struct VectorMatrix * Matrix)
ParameterDescription
MatrixThe target transformation matrix.

Call ResetMatrix() to clear all scaling, skewing, rotation and translation from a !VectorMatrix.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

RewindPath()

Resets path iteration to the first vertex.

void vec::RewindPath(APTR Path)
ParameterDescription
PathThe vector path to rewind.

Rewinding a path resets its internal vertex iterator to the first vertex. The next call to GetVertex() will read from the start of the path.

If the referenced Path is empty, this function does nothing.

Vector module documentation © Paul Manias © 2010-2026

Rotate()

Applies a rotation transform to a matrix.

ERR vec::Rotate(struct VectorMatrix * Matrix, DOUBLE Angle, DOUBLE CenterX, DOUBLE CenterY)
ParameterDescription
MatrixThe target transformation matrix.
AngleAngle of rotation, in degrees.
CenterXCentre of rotation on the horizontal axis.
CenterYCentre of rotation on the vertical axis.

This function rotates a matrix by Angle degrees. Rotation occurs around (0, 0) unless CenterX and CenterY specify another centre point.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

Scale()

Applies a scale transform to a matrix.

ERR vec::Scale(struct VectorMatrix * Matrix, DOUBLE X, DOUBLE Y)
ParameterDescription
MatrixThe target transformation matrix.
XThe scale factor on the x-axis.
YThe scale factor on the y-axis.

This function scales a matrix on the x and y axes. Values less than 1.0 shrink the affected vector path, while values greater than 1.0 enlarge it.

Scaling is relative to position (0, 0). If the width and height of the vector path needs to be transformed without affecting its top-left position, the client must translate the path to (0, 0) around its centre point. The path should then be scaled before being transformed back to its original top-left coordinate.

The scale operation can also be used to flip a vector path if negative values are used. For instance, a value of -1.0 on the x axis results in a 1:1 horizontal flip.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

Skew()

Applies a skew transform to a matrix.

ERR vec::Skew(struct VectorMatrix * Matrix, DOUBLE X, DOUBLE Y)
ParameterDescription
MatrixThe target transformation matrix.
XThe angle to skew along the horizontal.
YThe angle to skew along the vertical.

The Skew function applies a skew transformation to the horizontal and/or vertical axis of the matrix. Valid X and Y values are in the range -90 < Angle < 90.

If X is valid and Y is outside the valid range, the horizontal skew is applied before ERR::OutOfRange is returned.

Error Codes

OkayOperation successful.
OutOfRangeAt least one of the angles is out of the allowable range.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

Smooth3()

Appends a smooth quadratic Bezier curve to a generated path.

void vec::Smooth3(APTR Path, DOUBLE X, DOUBLE Y)
ParameterDescription
PathThe vector path to modify.
XThe horizontal end point for the smooth3 command.
YThe vertical end point for the smooth3 command.

This function appends a quadratic Bezier segment from the current point to X,Y. The control point is reflected from the previous curve command.

Vector module documentation © Paul Manias © 2010-2026

Smooth4()

Appends a smooth cubic Bezier curve to a generated path.

void vec::Smooth4(APTR Path, DOUBLE CtrlX, DOUBLE CtrlY, DOUBLE X, DOUBLE Y)
ParameterDescription
PathThe vector path to modify.
CtrlXControl point horizontal coordinate.
CtrlYControl point vertical coordinate.
XThe horizontal end point for the smooth4 instruction.
YThe vertical end point for the smooth4 instruction.

This function appends a cubic Bezier segment from the current point to X,Y. The previous curve command supplies the reflected first control point, and CtrlX,CtrlY supply the second control point.

Vector module documentation © Paul Manias © 2010-2026

StringWidth()

Calculates the rendered width of a UTF-8 string.

DOUBLE vec::StringWidth(APTR FontHandle, STRVIEW String, INT Chars)
ParameterDescription
FontHandleA font handle obtained from GetFontHandle().
StringPointer to a null-terminated string.
CharsMaximum number of bytes to process from String. Set to -1 for the full string.

This function calculates the pixel width of String for a known font. Line-feeds are treated as line breaks, so for multi-line strings the width of the longest line is returned.

For scalable fonts, kerning is included when computing the distance between glyphs.

Result

The pixel width of the string, or 0 if FontHandle or String is NULL.

Vector module documentation © Paul Manias © 2010-2026

TracePath()

Calls a function for each traced coordinate in a generated path.

ERR vec::TracePath(APTR Path, FUNCTION * Callback, DOUBLE Scale)
ParameterDescription
PathThe vector path to trace.
CallbackA function to call with the path coordinates.
ScaleSet to 1.0 (recommended) to trace the path at a scale of 1 to 1.

Any generated path can be traced by calling this function. Tracing allows the caller to follow the Path point-by-point as it would be rendered with a stroke. The Callback function signature is ERR Function(*Path, INT Index, INT Command, DOUBLE X, DOUBLE Y, *Meta).

The Index is an incrementing counter for each plotted point. The Command value identifies the internal path command, and X,Y are the traced coordinates.

If the Callback returns ERR::Terminate, processing stops and the function returns immediately.

Error Codes

OkayOperation successful.
TerminateTermination requested
NullArgsFunction call missing argument value(s)
FunctionA function call failed
Vector module documentation © Paul Manias © 2010-2026

Translate()

Applies a translation transform to a matrix.

ERR vec::Translate(struct VectorMatrix * Matrix, DOUBLE X, DOUBLE Y)
ParameterDescription
MatrixThe target transformation matrix.
XTranslation along the x-axis.
YTranslation along the y-axis.

This function adds the supplied x and y offsets to the matrix translation values.

Error Codes

OkayOperation successful.
NullArgsFunction call missing argument value(s)
Vector module documentation © Paul Manias © 2010-2026

TranslatePath()

Translates every vertex in a generated path.

void vec::TranslatePath(APTR Path, DOUBLE X, DOUBLE Y)
ParameterDescription
PathPointer to a generated path.
XHorizontal offset.
YVertical offset.

This function offsets all vertices in Path by X,Y. If Path is NULL, the call is ignored.

Vector module documentation © Paul Manias © 2010-2026

ARC Type

Options for drawing arcs.

NameDescription
ARC::LARGEThe arc will take the longest available drawing path rather than the shortest.
ARC::SWEEPInverts the default behaviour in generating the arc path (go clockwise).
Vector module documentation © Paul Manias © 2010-2026

JET Type

JET constants are documented in GetInputEvent()

NameDescription
JET::ABS_XYThe X, Y values are defined as absolute coordinates, relative to the top-left of the display
JET::BUTTON_1Left mouse button; XBox A button, PS square button. Value is pressure sensitive, ranging between 0 - 1.0 (0 is released, 1.0 is fully depressed)
JET::BUTTON_10Non-specific button assignment
JET::BUTTON_2Right mouse button; XBox X button, PS cross button
JET::BUTTON_3Middle mouse button; XBox Y button, PS triangle
JET::BUTTON_4Alt. mouse button 1; XBox B button, PS circle
JET::BUTTON_5Alt. mouse button 2
JET::BUTTON_6Non-specific button assignment
JET::BUTTON_7Non-specific button assignment
JET::BUTTON_8Non-specific button assignment
JET::BUTTON_9Non-specific button assignment
JET::CROSSED_INThis message is sent by the input system when the mouse pointer enters an area for the first time. The message value refers to the object ID of the container being monitored for movement
JET::CROSSED_OUTThis message is sent by the input system when the mouse pointer leaves an area. The message value refers to the object ID of the container being monitored for movement
JET::DEVICE_TILT_XYController tilted on the X/Y axis. Value indicates angle, -ve = left, +ve = right
JET::DEVICE_TILT_ZController is rising or falling. Value expressed as 'speed',
JET::DISPLAY_EDGERecently supplied input occurred at the edge of the display
JET::PEN_TILT_XYPen tilt angle. 0 is pointing down directly with nib at bottom, 0.5 is 90 degrees, 1.0 is inversed (eraser at bottom)
JET::PRESSUREAmount of pressure applied, ranges from 0 (none) to 1.0 (normal) and possibly higher if user presses hard enough
JET::WHEELMouse wheel rotation - the value generally reflects the number of 'clicks' rotated on the wheel
JET::WHEEL_TILTSome mouse wheels can be tilted to the left or right. Ranges from -1.0 to +1.0
Vector module documentation © Paul Manias © 2010-2026

JTYPE Type

JTYPE flags are used to categorise input types

NameDescription
JTYPE::ANALOGAnalog movement (ranging from -1.0 to 1.0)
JTYPE::ANCHOREDCursor has been anchored with LockCursor()
JTYPE::BUTTONInput is a physical button or switch
JTYPE::CROSSINGCrossing events manage the entering and leaving of an area
JTYPE::DBL_CLICKSet by the input system if the Type is a button and the button has been clicked in quick succession so as to be classed as a double-click
JTYPE::DIGITALD-Pad or digital joystick source (restricted to +/- 1)
JTYPE::DRAGGEDSet if sufficient movement occurred between the original click and its point of release (usually requires a 3 or more pixel difference)
JTYPE::DRAG_ITEMThis special flag is set by the input system if the pointer is click-dragging an object at the time of the event
JTYPE::EXT_MOVEMENTExtended or indirect movement information. This covers all types of movement that are unconnected to coordinate positioning - mouse wheel movement and pen tilt are two such examples
JTYPE::MOVEMENTX/Y coordinate movement only. Movement such as the wheel mouse spinning is not covered by this type as it does not influence the coordinate system
JTYPE::REPEATEDInput is a repeated entry (i.e. user is holding down a button and a repetition timer is being triggered)
JTYPE::SECONDARYIndicates to the receiver of this message that it is not the primary/original recipient
Vector module documentation © Paul Manias © 2010-2026

PE Type

NameDescription
PE::Arc
PE::ArcRel
PE::ClosePath
PE::Curve
PE::CurveRel
PE::HLine
PE::HLineRel
PE::Line
PE::LineRel
PE::Move
PE::MoveRel
PE::QuadCurve
PE::QuadCurveRel
PE::QuadSmooth
PE::QuadSmoothRel
PE::Smooth
PE::SmoothRel
PE::VLine
PE::VLineRel
Vector module documentation © Paul Manias © 2010-2026

VSF Type

Filter source types - these are used internally

NameDescription
VSF::ALPHAAs for GRAPHIC except that only the alpha channel is used.
VSF::BKGDAn image snapshot of the SVG document under the filter region at the time that the filter element was invoked.
VSF::BKGD_ALPHAAs for BKGD but only the alpha channel is used.
VSF::FILLThe value of the fill property on the target element for the filter effect.
VSF::GRAPHICRepresents the graphics elements that were the original input into the filter element.
VSF::IGNOREThe filter does not require an input source.
VSF::PREVIOUSUse the previous effect as input, or source graphic if no previous effect.
VSF::REFERENCEThis value is an assigned name for the filter primitive in the form of a custom-ident. If supplied, then graphics that result from processing this filter primitive can be referenced by an in attribute on a subsequent filter primitive within the same filter element. If no value is provided, the output will only be available for re-use as the implicit input into the next filter primitive if that filter primitive provides no value for its in attribute.
VSF::STROKEThe value of the stroke property on the target element for the filter effect.
Vector module documentation © Paul Manias © 2010-2026

DiffusionCurveRecord Structure

Describes one curve for the GradientDiffusion Curves field.

FieldTypeDescription
Curvestruct MeshControlCubic Bezier geometry for this curve segment.
LeftStartstruct FRGBColour on the left side at the start of the curve.
LeftEndstruct FRGBColour on the left side at the end of the curve.
RightStartstruct FRGBColour on the right side at the start of the curve.
RightEndstruct FRGBColour on the right side at the end of the curve.
Vector module documentation © Paul Manias © 2010-2026

FontMetrics Structure

Font metrics, measured in pixels relative to the display

FieldTypeDescription
HeightINTFull font height equivalent to Ascent (cap-height) + Descent (gutter). Does NOT include accents.
LineSpacingINTVertical advance from one line to the next. Includes coverage for accents and additional whitespace.
AscentINTHeight from the baseline to the top (cap-height) of the font. Does NOT include accents.
DescentINTHeight from the baseline to the bottom of the font (gutter)
Vector module documentation © Paul Manias © 2010-2026

GouraudVertex Structure

Describes a coloured vertex for the GradientGouraud Vertices field.

FieldTypeDescription
XDOUBLEThe X coordinate of the vertex.
YDOUBLEThe Y coordinate of the vertex.
Colourstruct FRGBThe floating point RGB colour assigned to this vertex.
Vector module documentation © Paul Manias © 2010-2026

GradientStop Structure

Describes a colour stop for the Gradient Stops field.

FieldTypeDescription
OffsetDOUBLEAn offset in the range of 0 - 1.0
RGBstruct FRGBA floating point RGB value.
Vector module documentation © Paul Manias © 2010-2026

MergeSource Structure

Input source declaration for MergeFX

FieldTypeDescription
SourceTypeVSFThe type of the required source.
EffectobjFilterEffect *Effect pointer if the SourceType is REFERENCE.
Vector module documentation © Paul Manias © 2010-2026

MeshControl Structure

Describes one control point for the GradientMesh.

FieldTypeDescription
StartXDOUBLEStarting X coordinate.
StartYDOUBLEStarting Y coordinate.
EndXDOUBLEEnding X coordinate.
EndYDOUBLEEnding Y coordinate.
X1DOUBLEFirst control point X coordinate.
Y1DOUBLEFirst control point Y coordinate.
X2DOUBLESecond control point X coordinate.
Y2DOUBLESecond control point Y coordinate.
Vector module documentation © Paul Manias © 2010-2026

MeshPatchRecord Structure

Describes one bilinear Coons patch for the GradientMesh Patches field.

FieldTypeDescription
Topstruct MeshControlTop edge
Rightstruct MeshControlRight edge
Bottomstruct MeshControlBottom edge
Leftstruct MeshControlLeft edge
TopLeftstruct FRGBColour assigned to the top-left patch corner.
TopRightstruct FRGBColour assigned to the top-right patch corner.
BottomRightstruct FRGBColour assigned to the bottom-right patch corner.
BottomLeftstruct FRGBColour assigned to the bottom-left patch corner.
Vector module documentation © Paul Manias © 2010-2026

PathCommand Structure

Base structure for path commands.

FieldTypeDescription
TypePEThe command type
LargeArcUINT8Equivalent to the large-arc-flag in SVG, it ensures that the arc follows the longest drawing path when TRUE.
SweepUINT8Equivalent to the sweep-flag in SVG, it inverts the default behaviour in generating arc paths.
Pad1UINT8Private
XDOUBLEThe targeted X coordinate (absolute or scaled) for the command
YDOUBLEThe targeted Y coordinate (absolute or scaled) for the command
AbsXDOUBLEPrivate
AbsYDOUBLEPrivate
X2DOUBLEThe X2 coordinate for curve commands, or RX for arcs
Y2DOUBLEThe Y2 coordinate for curve commands, or RY for arcs
X3DOUBLEThe X3 coordinate for curve-to or smooth-curve-to
Y3DOUBLEThe Y3 coordinate for curve-to or smooth-curve-to
AngleDOUBLEArc angle
Vector module documentation © Paul Manias © 2010-2026

Transition Structure

For VectorTransition definitions

FieldTypeDescription
OffsetDOUBLEAn offset from 0.0 to 1.0 at which to apply the transform.
TransformSTRINGA transform string, as per SVG guidelines.
Vector module documentation © Paul Manias © 2010-2026

VectorMatrix Structure

Vector transformation matrix.

FieldTypeDescription
Nextstruct VectorMatrix *The next transform in the list.
VectorobjVector *The vector associated with the transform.
ScaleXDOUBLEMatrix value A
ShearYDOUBLEMatrix value B
ShearXDOUBLEMatrix value C
ScaleYDOUBLEMatrix value D
TranslateXDOUBLEMatrix value E
TranslateYDOUBLEMatrix value F
TagINTAn optional tag value defined by the client for matrix identification.
Vector module documentation © Paul Manias © 2010-2026

VectorPainter Structure

Deserialised painter information; compliant with SVG painter definitions.

FieldTypeDescription
PatternobjVectorPattern *A VectorPattern object, suitable for pattern based fills.
ImageobjVectorImage *A VectorImage object, suitable for image fills.
GradientobjGradient *A Gradient object, suitable for gradient fills.
Colourstruct FRGBA single RGB colour definition, suitable for block colour fills. Colour values are unclamped to support all possible colour spaces.
Vector module documentation © Paul Manias © 2010-2026

VectorPoint Structure

Structure for the VectorPolygon PointsArray field.

FieldTypeDescription
XDOUBLEThe X coordinate of this point.
YDOUBLEThe Y coordinate of this point.
XScaledUINT8TRUE if the X value is scaled to its viewport (between 0 and 1.0).
YScaledUINT8TRUE if the Y value is scaled to its viewport (between 0 and 1.0).
Vector module documentation © Paul Manias © 2010-2026

VoronoiPoint Structure

Describes a feature point for the GradientVoronoi Points field.

FieldTypeDescription
XDOUBLEThe X coordinate of the feature point.
YDOUBLEThe Y coordinate of the feature point.
HeightDOUBLEThe per-point height used by WEIGHTED and PEAKS modes.
Vector module documentation © Paul Manias © 2010-2026