Skip to content

Commit

Permalink
Merge pull request #231 from parasol-framework/test/animation
Browse files Browse the repository at this point in the history
Animation features
  • Loading branch information
paul-manias authored Apr 16, 2024
2 parents 49c2118 + 1c579a6 commit 1b4c28f
Show file tree
Hide file tree
Showing 24 changed files with 906 additions and 116 deletions.
6 changes: 3 additions & 3 deletions docs/xml/modules/classes/vector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@
</method>

<method>
<name>TracePath</name>
<name>Trace</name>
<comment>Returns the coordinates for a vector path, using callbacks.</comment>
<prototype>ERR vecTracePath(OBJECTPTR Object, FUNCTION * Callback, DOUBLE Scale, LONG Transform)</prototype>
<prototype>ERR vecTrace(OBJECTPTR Object, FUNCTION * Callback, DOUBLE Scale, LONG Transform)</prototype>
<input>
<param type="FUNCTION *" name="Callback">A function to call with the path coordinates.</param>
<param type="DOUBLE" name="Scale">Set to 1.0 (recommended) to trace the path at a scale of 1 to 1.</param>
<param type="LONG" name="Transform">Set to TRUE if all transforms applicable to the vector should be applied to the path.</param>
</input>
<description>
<p>Any vector that generates a path can be traced by calling this method. Tracing allows the caller to follow the path for each pixel that would be drawn if the path were to be rendered with a stroke size of 1. The prototype of the callback function is <code>ERR Function(OBJECTPTR Vector, LONG Index, LONG Command, DOUBLE X, DOUBLE Y, APTR Meta)</code>.</p>
<p>Any vector that generates a path can be traced by calling this method. Tracing allows the caller to follow the path from point-to-point if the path were to be rendered with a stroke. The prototype of the callback function is <code>ERR Function(OBJECTPTR Vector, LONG Index, LONG Command, DOUBLE X, DOUBLE Y, APTR Meta)</code>.</p>
<p>The Vector parameter refers to the vector targeted by the method. The Index is an incrementing counter that reflects the currently plotted point. The X and Y parameters reflect the coordinate of a point on the path.</p>
<p>If the Callback returns <code>ERR::Terminate</code>, then no further coordinates will be processed.</p>
</description>
Expand Down
2 changes: 1 addition & 1 deletion docs/xml/modules/vector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ Z: Close Path
<param type="DOUBLE" name="Scale">Set to 1.0 (recommended) to trace the path at a scale of 1 to 1.</param>
</input>
<description>
<p>Generated paths can be traced by calling this function. Tracing allows the caller to follow the path for each pixel that would be drawn if the path were to be rendered with a stroke size of 1. The prototype of the callback function is <code>ERR Function(APTR Path, LONG Index, LONG Command, DOUBLE X, DOUBLE Y, APTR Meta)</code>.</p>
<p>Any vector that generates a path can be traced by calling this method. Tracing allows the caller to follow the path from point-to-point if the path were to be rendered with a stroke. The prototype of the callback function is <code>ERR Function(OBJECTPTR Vector, LONG Index, LONG Command, DOUBLE X, DOUBLE Y, APTR Meta)</code>.</p>
<p>The Index is an incrementing counter that reflects the currently plotted point. The X and Y parameters reflect the coordinate of a point on the path.</p>
<p>If the Callback returns <code>ERR::Terminate</code>, then no further coordinates will be processed.</p>
</description>
Expand Down
11 changes: 6 additions & 5 deletions include/parasol/modules/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ class objVectorFilter : public BaseClass {
// Vector methods

#define MT_VecPush -1
#define MT_VecTracePath -2
#define MT_VecTrace -2
#define MT_VecGetBoundary -3
#define MT_VecPointInPath -4
#define MT_VecSubscribeInput -5
Expand All @@ -1564,7 +1564,7 @@ class objVectorFilter : public BaseClass {
#define MT_VecFreeMatrix -10

struct vecPush { LONG Position; };
struct vecTracePath { FUNCTION * Callback; DOUBLE Scale; LONG Transform; };
struct vecTrace { FUNCTION * Callback; DOUBLE Scale; LONG Transform; };
struct vecGetBoundary { VBF Flags; DOUBLE X; DOUBLE Y; DOUBLE Width; DOUBLE Height; };
struct vecPointInPath { DOUBLE X; DOUBLE Y; };
struct vecSubscribeInput { JTYPE Mask; FUNCTION * Callback; };
Expand All @@ -1578,9 +1578,9 @@ inline ERR vecPush(APTR Ob, LONG Position) noexcept {
return(Action(MT_VecPush, (OBJECTPTR)Ob, &args));
}

inline ERR vecTracePath(APTR Ob, FUNCTION * Callback, DOUBLE Scale, LONG Transform) noexcept {
struct vecTracePath args = { Callback, Scale, Transform };
return(Action(MT_VecTracePath, (OBJECTPTR)Ob, &args));
inline ERR vecTrace(APTR Ob, FUNCTION * Callback, DOUBLE Scale, LONG Transform) noexcept {
struct vecTrace args = { Callback, Scale, Transform };
return(Action(MT_VecTrace, (OBJECTPTR)Ob, &args));
}

inline ERR vecGetBoundary(APTR Ob, VBF Flags, DOUBLE * X, DOUBLE * Y, DOUBLE * Width, DOUBLE * Height) noexcept {
Expand Down Expand Up @@ -2394,6 +2394,7 @@ inline void SET_VECTOR_COLOUR(objVectorColour *Colour, DOUBLE Red, DOUBLE Green,
#define SVF_SCALE 0x1057f68d
#define SVF_SCREEN 0x1b5ffd45
#define SVF_SEED 0x7c9dda26
#define SVF_SET 0x0b88a991
#define SVF_SHAPE_RENDERING 0xeecea7a1
#define SVF_SOFTLIGHT 0x78b6e7b9
#define SVF_SOURCEALPHA 0xbe4b853c
Expand Down
Loading

0 comments on commit 1b4c28f

Please sign in to comment.