Kōtuku
  • Gallery
  • API
  • Wiki
  • GitHub
    • 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

VectorPattern Class

Provides support for the filling and stroking of vectors with patterns.

The VectorPattern class is used by Vector painting algorithms to fill and stroke vectors with pre-rendered patterns. It is the most efficient way of rendering a common set of graphics multiple times.

The VectorPattern must be registered with a VectorScene via the VectorScene⇒AddDef() method. Any vector within the target scene will be able to utilise the pattern for filling or stroking by referencing its name through the Vector⇒Fill and Vector⇒Stroke fields. For instance url(#dots).

A special use case is made for patterns that are applied as a fill operation in VectorViewport objects. In this case the renderer will dynamically render the pattern as a background within the viewport. This ensures that the pattern is rendered at maximum fidelity whenever it is used, and not affected by bitmap clipping restrictions. It should be noted that this means the image caching feature will be disabled.

It is strongly recommended that the VectorPattern is owned by the VectorScene that is handling the definition. This will ensure that the VectorPattern is deallocated when the scene is destroyed.

Structure

The VectorPattern class consists of the following fields:

Access
NameTypeComment
 ContentUnitsVUNITNot yet implemented.

In compliance with SVG requirements, the application of ContentUnits is only effective if the Viewport's X, Y, Width and Height fields have been defined. The default setting is USERSPACE.

NameDescription
VUNIT::BOUNDING_BOXCoordinates are scaled to the object's bounding box.
VUNIT::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VUNIT::USERSPACECoordinates are scaled to the current viewport.
 HeightUNITHeight of the pattern tile.

The (Width,Height) field values define the dimensions of the pattern tile. If the provided value is scaled, then the dimension is calculated relative to the bounding box or viewport applying the pattern, dependent on the Units setting.

 Inherit*VectorPatternInherit attributes from a VectorPattern referenced here.

Attributes can be inherited from another pattern by referencing it in this field. This feature is provided primarily for the purpose of simplifying SVG compatibility and its use may result in an unnecessary performance penalty.

 Matriceskt::vector<VectorMatrix>Applies one or more transforms to a pattern.

A transform can be applied to a pattern via one or more matrices. These will influence how pattern fills are rendered within their vector space. Each matrix is represented by a VectorMatrix structure, and the matrices are linked in the order in which they should be applied.

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.
 OpacityDOUBLEThe opacity of the pattern.

The opacity of the pattern is defined as a value between 0.0 and 1.0, with 1.0 being fully opaque. The default value is 1.0.

 Scene*VectorSceneRefers to the internal VectorScene that will contain the rendered pattern.

The VectorPattern class allocates a VectorScene in this field and inherits its functionality. In addition, a VectorViewport class will be assigned to the scene and is referenced in the Viewport field for managing the vectors that will be rendered.

 SpreadMethodVSPREADThe behaviour to use when the pattern bounds do not match the vector path.

Indicates what happens if the pattern starts or ends inside the bounds of the target vector. The default value is VSPREAD::PAD.

NameDescription
VSPREAD::CLIPDo not scale the graphic. Clip it if it extends past imposed boundaries.
VSPREAD::PADScale the graphic to the object bounds.
VSPREAD::REFLECTTile the graphic, reflecting the image alternately on the X and Y axis.
VSPREAD::REFLECT_XTile the graphic, reflecting the image alternately on the X axis only.
VSPREAD::REFLECT_YTile the graphic, reflecting the image alternately on the Y axis only.
VSPREAD::REPEATTile the graphic repeatedly.
VSPREAD::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
 TransformSTRINGApplies a transform to the pattern during the render process.

A transform can be applied to the pattern by setting this field with an SVG compliant transform string.

 UnitsVUNITDefines the coordinate system for fields X, Y, Width and Height.

This field declares the coordinate system that is used for values in the X, Y, Width and Height fields. The default setting is BOUNDING_BOX, which means the pattern will be drawn to scale in realtime. The most efficient method is USERSPACE, which allows the pattern image to be persistently cached.

NameDescription
VUNIT::BOUNDING_BOXCoordinates are scaled to the object's bounding box.
VUNIT::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VUNIT::USERSPACECoordinates are scaled to the current viewport.
 Viewport*VectorViewportRefers to the viewport that contains the pattern.

The Viewport refers to a VectorViewport object that is created to host the vectors for the rendered pattern. If the Viewport does not contain at least one vector that renders an image, the pattern will be ineffective.

 WidthUNITWidth of the pattern tile.

The (Width,Height) field values define the dimensions of the pattern tile. If the provided value is scaled, the dimension is calculated relative to the bounding box or viewport applying the pattern, dependent on the Units setting.

 XUNITX coordinate for the pattern.

The (X,Y) field values define the starting coordinate for mapping patterns.

 YUNITY coordinate for the pattern.

The (X,Y) field values define the starting coordinate for mapping patterns.

Actions

The following actions are currently supported:

DrawDraws object graphics to drawable areas.
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
ParameterDescription
XThe X position of the region to be drawn.
YThe Y position of the region to be drawn.
WidthThe width of the region to be drawn.
HeightThe height of the region to be drawn.
VectorPattern class documentation © Paul Manias © 2010-2026

VSPREAD Type

Spread method options define the method to use for tiling filled graphics.

NameDescription
VSPREAD::CLIPDo not scale the graphic. Clip it if it extends past imposed boundaries.
VSPREAD::PADScale the graphic to the object bounds.
VSPREAD::REFLECTTile the graphic, reflecting the image alternately on the X and Y axis.
VSPREAD::REFLECT_XTile the graphic, reflecting the image alternately on the X axis only.
VSPREAD::REFLECT_YTile the graphic, reflecting the image alternately on the Y axis only.
VSPREAD::REPEATTile the graphic repeatedly.
VSPREAD::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VectorPattern module documentation © Paul Manias © 2010-2026

VUNIT Type

NameDescription
VUNIT::BOUNDING_BOXCoordinates are scaled to the object's bounding box.
VUNIT::UNDEFINEDEither the default setting will be applied or the setting will be inherited from a parent object.
VUNIT::USERSPACECoordinates are scaled to the current viewport.
VectorPattern 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.
VectorPattern class documentation © Paul Manias © 2010-2026