Skip to content

MemoizationCanvas

Memoization Canvas

Constructors

new MemoizationCanvas()

new MemoizationCanvas(): MemoizationCanvas

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:292

Properties

alpha

alpha: number

Source

graphics/memoization-canvas.ts:289


canvas

canvas: Canvas

Source

graphics/memoization-canvas.ts:278


do

do: DO[]

Source

graphics/memoization-canvas.ts:280


fillColor

fillColor: string

Source

graphics/memoization-canvas.ts:285


fillStyle

fillStyle: string

Source

graphics/memoization-canvas.ts:286


font

font: string

Source

graphics/memoization-canvas.ts:288


fontColor

fontColor: string

Source

graphics/memoization-canvas.ts:287


generator

generator: RoughGenerator

Source

graphics/memoization-canvas.ts:281


roughness

roughness: number

Source

graphics/memoization-canvas.ts:290


stateStack

stateStack: CanvasState[]

Source

graphics/memoization-canvas.ts:279


strokeColor

strokeColor: string

Source

graphics/memoization-canvas.ts:282


strokePattern

strokePattern: number[]

Source

graphics/memoization-canvas.ts:284


strokeWidth

strokeWidth: number

Source

graphics/memoization-canvas.ts:283

Methods

arc()

arc(x, y, r, startAngle, endAngle, seed): MemoizationCanvas

Draw an arc

Parameters

x: number

y: number

r: number

startAngle: number

endAngle: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:992


clear()

clear(): void

Returns

void

Source

graphics/memoization-canvas.ts:343


curve()

curve(path, seed): MemoizationCanvas

Draw a curve

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:836


draw()

draw(canvas): void

Draw memoized drawing objects

Parameters

canvas: Canvas

Returns

void

Source

graphics/memoization-canvas.ts:1162


drawImage()

drawImage(image, x, y, width, height, radius): MemoizationCanvas

Draw Image

Parameters

image: HTMLImageElement

x: number

y: number

width: number

height: number

radius: number | number[]

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:1127


ellipse()

ellipse(x1, y1, x2, y2, seed): MemoizationCanvas

Draw an ellipse

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:745


fillArc()

fillArc(x, y, r, startAngle, endAngle, seed): MemoizationCanvas

Draw filled arc. angles are started from 12’clock in degree.

Parameters

x: number

y: number

r: number

startAngle: number

endAngle: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:951


fillCurve()

fillCurve(path, seed): MemoizationCanvas

Draw filled curved lines

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:808


fillEllipse()

fillEllipse(x1, y1, x2, y2, seed): MemoizationCanvas

Draw a filled ellipse

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:702


fillPath()

fillPath(path, seed): MemoizationCanvas

Draw filled path

Parameters

path: SVGPath

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:1037


fillPolygon()

fillPolygon(path, seed): MemoizationCanvas

Draw filled polygon

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:872


fillRect()

fillRect(x1, y1, x2, y2, seed): MemoizationCanvas

Draw a filled rect

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:489


fillRoundRect()

fillRoundRect(x1, y1, x2, y2, radius, seed): MemoizationCanvas

Draw a filled round rect

Parameters

x1: number

y1: number

x2: number

y2: number

radius: number | number[]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:588


fillText()

fillText(x, y, text): MemoizationCanvas

Fill a text

Parameters

x: number

y: number

text baseline (metric.ascent - not the top of text)

text: string

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:1111


line()

line(x1, y1, x2, y2, seed): MemoizationCanvas

Draw a line

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:426


path()

path(path, seed): MemoizationCanvas

Draw a path

Parameters

path: SVGPath

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:1067


polygon()

polygon(path, seed): MemoizationCanvas

Draw a polygon

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:900


polyline()

polyline(path, seed): MemoizationCanvas

Draw polyline

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:754


rect()

rect(x1, y1, x2, y2, seed): MemoizationCanvas

Draw a rect

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:524


restoreState()

restoreState(): void

Restore the canvas states from a stack

Returns

void

Source

graphics/memoization-canvas.ts:328


roundRect()

roundRect(x1, y1, x2, y2, radius, seed): MemoizationCanvas

Draw a round rect

Parameters

x1: number

y1: number

x2: number

y2: number

radius: number | number[]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:644


setAlpha()

setAlpha(alpha): MemoizationCanvas

Set alpha

Parameters

alpha: number

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:410


setCanvas()

setCanvas(canvas): void

Parameters

canvas: Canvas

Returns

void

Source

graphics/memoization-canvas.ts:347


setFillColor()

setFillColor(color): MemoizationCanvas

Set fill color

Parameters

color: string

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:378


setFillStyle()

setFillStyle(style): MemoizationCanvas

Set fill style

Parameters

style: string

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:386


setFont()

setFont(font): MemoizationCanvas

Set font

Parameters

font: string

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:402


setFontColor()

setFontColor(color): MemoizationCanvas

Set font color

Parameters

color: string

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:394


setRoughness()

setRoughness(roughness): MemoizationCanvas

Set roughness

Parameters

roughness: number

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:418


setStrokeColor()

setStrokeColor(color): MemoizationCanvas

Set stroke color

Parameters

color: string

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:354


setStrokePattern()

setStrokePattern(pattern): MemoizationCanvas

Set stroke pattern

Parameters

pattern: number[]

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:370


setStrokeWidth()

setStrokeWidth(width): MemoizationCanvas

Set stroke width

Parameters

width: number

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:362


storeState()

storeState(): void

Store current canvas state into a stack

Returns

void

Source

graphics/memoization-canvas.ts:310


strokeArc()

strokeArc(x, y, r, startAngle, endAngle, seed): MemoizationCanvas

Draw an arc. angles are started from 3’clock in degree (0~360).

Parameters

x: number

y: number

r: number

startAngle: number

endAngle: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:909


strokeCurve()

strokeCurve(path, seed): MemoizationCanvas

Draw curved lines

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:781


strokeEllipse()

strokeEllipse(x1, y1, x2, y2, seed): MemoizationCanvas

Draw an ellipse

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:660


strokeFreehand()

strokeFreehand(path, thinning, tailTaper, headTaper): MemoizationCanvas

Draw a freehand stroke

Parameters

path: number[][]

thinning: number= 0

Thinning of the path

tailTaper: number= 0

Taper at the start of the path. value must be 0~1

headTaper: number= 0

Taper at the end of the path value must be 0~1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:1081


strokePath()

strokePath(path, seed): MemoizationCanvas

Draw a path

Parameters

path: SVGPath

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:1008


strokePolygon()

strokePolygon(path, seed): MemoizationCanvas

Draw polygon

Parameters

path: number[][]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:845


strokeRect()

strokeRect(x1, y1, x2, y2, seed): MemoizationCanvas

Draw a rect lines

Parameters

x1: number

y1: number

x2: number

y2: number

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:455


strokeRoundRect()

strokeRoundRect(x1, y1, x2, y2, radius, seed): MemoizationCanvas

Draw a round rect lines

Parameters

x1: number

y1: number

x2: number

y2: number

radius: number | number[]

seed: number= 1

Returns

MemoizationCanvas

Source

graphics/memoization-canvas.ts:533


textMetric()

textMetric(text): CanvasTextMetric

Get Text Metric

Parameters

text: string

Returns

CanvasTextMetric

Source

graphics/memoization-canvas.ts:1154