Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

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 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
  DimensionsDMFDimension flags are stored here.
NameDescription
DMF::FIXED_CENTER_XThe CenterX field is a fixed size.
DMF::FIXED_CENTER_YThe CenterY field is a fixed size.
DMF::FIXED_DEPTHThe Depth field is a fixed size.
DMF::FIXED_HEIGHTThe Height field is a fixed size.
DMF::FIXED_RADIUS_XThe RadiusX field is a fixed size.
DMF::FIXED_RADIUS_YThe RadiusY field is a fixed size.
DMF::FIXED_WIDTHThe Width field is a fixed suze.
DMF::FIXED_XThe X field is a fixed coordinate.
DMF::FIXED_X_OFFSETThe XOffset field is a fixed coordinate.
DMF::FIXED_YThe Y field is a fixed coordinate.
DMF::FIXED_Y_OFFSETThe YOffset field is a fixed coordinate.
DMF::FIXED_ZThe Z field is a fixed coordinate.
DMF::SCALED_CENTER_XThe CenterX field is scaled to this object's parent.
DMF::SCALED_CENTER_YThe CenterY field is scaled to this object's parent.
DMF::SCALED_DEPTHThe Depth field is scaled to this object's parent.
DMF::SCALED_HEIGHTThe Height field is scaled to this object's parent.
DMF::SCALED_RADIUS_XThe RadiusX field is scaled to this object's parent.
DMF::SCALED_RADIUS_YThe RadiusY field is a scaled size to this object's parent.
DMF::SCALED_WIDTHThe Width field is scaled to this object's parent.
DMF::SCALED_XThe X field is scaled to this object's parent.
DMF::SCALED_X_OFFSETThe XOffset field is scaled to this object's parent.
DMF::SCALED_YThe Y field is scaled to this object's parent.
DMF::SCALED_Y_OFFSETThe YOffset field is scaled to this object's parent.
DMF::SCALED_ZThe Z field is a scaled coordinate to this object's parent.
DMF::STATUS_CHANGE_H
DMF::STATUS_CHANGE_V
  HeightDOUBLEHeight 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.

  MatricesAPTRA linked list of transform matrices that have been applied to the pattern.

All transforms that have been applied to the pattern can be read from the Matrices field. Each transform is represented by a VectorMatrix structure, and are linked in the order in which they were applied to the pattern.

Setting this field is always additive unless NULL is passed, in which case all existing matrices are removed.

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 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 and Y 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.

  WidthDOUBLEWidth 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.

  XDOUBLEX coordinate for the pattern.

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

  YDOUBLEY coordinate for the pattern.

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

VectorPattern class documentation © Paul Manias © 2010-2025

DMF Type

NameDescription
DMF::FIXED_CENTER_XThe CenterX field is a fixed size.
DMF::FIXED_CENTER_YThe CenterY field is a fixed size.
DMF::FIXED_DEPTHThe Depth field is a fixed size.
DMF::FIXED_HEIGHTThe Height field is a fixed size.
DMF::FIXED_RADIUS_XThe RadiusX field is a fixed size.
DMF::FIXED_RADIUS_YThe RadiusY field is a fixed size.
DMF::FIXED_WIDTHThe Width field is a fixed suze.
DMF::FIXED_XThe X field is a fixed coordinate.
DMF::FIXED_X_OFFSETThe XOffset field is a fixed coordinate.
DMF::FIXED_YThe Y field is a fixed coordinate.
DMF::FIXED_Y_OFFSETThe YOffset field is a fixed coordinate.
DMF::FIXED_ZThe Z field is a fixed coordinate.
DMF::SCALED_CENTER_XThe CenterX field is scaled to this object's parent.
DMF::SCALED_CENTER_YThe CenterY field is scaled to this object's parent.
DMF::SCALED_DEPTHThe Depth field is scaled to this object's parent.
DMF::SCALED_HEIGHTThe Height field is scaled to this object's parent.
DMF::SCALED_RADIUS_XThe RadiusX field is scaled to this object's parent.
DMF::SCALED_RADIUS_YThe RadiusY field is a scaled size to this object's parent.
DMF::SCALED_WIDTHThe Width field is scaled to this object's parent.
DMF::SCALED_XThe X field is scaled to this object's parent.
DMF::SCALED_X_OFFSETThe XOffset field is scaled to this object's parent.
DMF::SCALED_YThe Y field is scaled to this object's parent.
DMF::SCALED_Y_OFFSETThe YOffset field is scaled to this object's parent.
DMF::SCALED_ZThe Z field is a scaled coordinate to this object's parent.
DMF::STATUS_CHANGE_H
DMF::STATUS_CHANGE_V
VectorPattern module documentation © Paul Manias © 2010-2025

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-2025

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-2025

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-2025