Class: AffineTransformPathStream
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:12
A TransformingPathStream which applies an affine transformation to its input.
The types of transformation supported by this class are:
- Translation.
- Uniform scaling.
- Rotation.
Extends
Constructors
Constructor
new AffineTransformPathStream(
consumer
):AffineTransformPathStream
Defined in: src/sdk/graphics/path/PathStream.ts:144
Constructor.
Parameters
Parameter | Type | Description |
---|---|---|
consumer | PathStream | The path stream that consumes this stream's transformed output. |
Returns
AffineTransformPathStream
Inherited from
AbstractTransformingPathStream
.constructor
Properties
consumer
protected
consumer:PathStream
Defined in: src/sdk/graphics/path/PathStream.ts:144
The path stream that consumes this stream's transformed output.
Inherited from
AbstractTransformingPathStream
.consumer
Methods
addRotation()
addRotation(
angle
,order
):this
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:82
Adds a rotation to this stream's transformation.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
angle | number | undefined | The rotation angle, in radians. |
order | "after" | "before" | 'after' | The order in which to add the translation (defaults to 'after' ): * 'before' - Applies the rotation before this stream's current transformation. * 'after' - Applies the rotation after this stream's current transformation. |
Returns
this
This stream, after its transformation has been changed.
addScale()
addScale(
factor
,order
):this
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:56
Adds a uniform scaling to this stream's transformation.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
factor | number | undefined | The scaling factor. |
order | "after" | "before" | 'after' | The order in which to add the translation (defaults to 'after' ): * 'before' - Applies the scaling before this stream's current transformation. * 'after' - Applies the scaling after this stream's current transformation. |
Returns
this
This stream, after its transformation has been changed.
addTranslation()
addTranslation(
x
,y
,order
):this
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:32
Adds a translation to this stream's transformation.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
x | number | undefined | The x translation. |
y | number | undefined | The y translation. |
order | "after" | "before" | 'after' | The order in which to add the translation (defaults to 'after' ): * 'before' - Applies the translation before this stream's current transformation. * 'after' - Applies the translation after this stream's current transformation. |
Returns
this
This stream, after its transformation has been changed.
arc()
arc(
x
,y
,radius
,startAngle
,endAngle
,counterClockwise?
):void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:158
Paths an arc.
Parameters
Parameter | Type | Description |
---|---|---|
x | number | The x-coordinate of the center of the circle containing the arc. |
y | number | The y-coordinate of the center of the circle containing the arc. |
radius | number | The radius of the arc. |
startAngle | number | The angle of the start of the arc, in radians. |
endAngle | number | The angle of the end of the arc, in radians. |
counterClockwise? | boolean | Whether the arc should be drawn counterclockwise. False by default. |
Returns
void
Overrides
AbstractTransformingPathStream
.arc
beginPath()
beginPath():
void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:111
Begins a path. Erases all previous path state.
Returns
void
Overrides
AbstractTransformingPathStream
.beginPath
bezierCurveTo()
bezierCurveTo(
cp1x
,cp1y
,cp2x
,cp2y
,x
,y
):void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:128
Paths a cubic Bezier curve from the current point to a specified point.
Parameters
Parameter | Type | Description |
---|---|---|
cp1x | number | The x-coordinate of the first control point. |
cp1y | number | The y-coordinate of the first control point. |
cp2x | number | The x-coordinate of the second control point. |
cp2y | number | The y-coordinate of the second control point. |
x | number | The x-coordinate of the end point. |
y | number | The y-coordinate of the end point. |
Returns
void
Overrides
AbstractTransformingPathStream
.bezierCurveTo
closePath()
closePath():
void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:165
Paths a line from the current point to the first point defined by the current path.
Returns
void
Overrides
AbstractTransformingPathStream
.closePath
getConsumer()
getConsumer():
PathStream
Defined in: src/sdk/graphics/path/PathStream.ts:148
Gets the path stream that is consuming this stream's transformed output.
Returns
The path stream that is consuming this stream's transformed output.
Inherited from
AbstractTransformingPathStream
.getConsumer
lineTo()
lineTo(
x
,y
):void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:122
Paths a straight line from the current point to a specified point.
Parameters
Parameter | Type | Description |
---|---|---|
x | number | The x-coordinate of the end point. |
y | number | The y-coordinate of the end point. |
Returns
void
Overrides
AbstractTransformingPathStream
.lineTo
moveTo()
moveTo(
x
,y
):void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:116
Moves to a specified point.
Parameters
Parameter | Type | Description |
---|---|---|
x | number | The x-coordinate of the point to which to move. |
y | number | The y-coordinate of the point to which to move. |
Returns
void
Overrides
AbstractTransformingPathStream
.moveTo
quadraticCurveTo()
quadraticCurveTo(
cpx
,cpy
,x
,y
):void
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:145
Paths a quadrative Bezier curve from the current point to a specified point.
Parameters
Parameter | Type | Description |
---|---|---|
cpx | number | The x-coordinate of the control point. |
cpy | number | The y-coordinate of the control point. |
x | number | The x-coordinate of the end point. |
y | number | The y-coordinate of the end point. |
Returns
void
Overrides
AbstractTransformingPathStream
.quadraticCurveTo
resetTransform()
resetTransform():
this
Defined in: src/sdk/graphics/path/AffineTransformPathStream.ts:104
Resets this stream's transformation to the identity transformation.
Returns
this
This stream, after its transformation has been changed.
setConsumer()
setConsumer(
consumer
):void
Defined in: src/sdk/graphics/path/PathStream.ts:153
Sets the path stream that consumes this stream's transformed output.
Parameters
Parameter | Type | Description |
---|---|---|
consumer | PathStream | The new consuming path stream. |
Returns
void