You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
671 B
13 lines
671 B
/**
|
|
* Draws a line from pointA to pointB on the canvas
|
|
* with the Bresenham algorithm.
|
|
* @param {Uint8ClampedArray} data - The linearised pixel array
|
|
* @param {[number, number]} pointA - The start point of the line
|
|
* @param {[number, number]} pointB - The end point of the line
|
|
* @param {number} width - The width of the canvas
|
|
* @param {number} height - The height of the canvas
|
|
*/
|
|
export function bresenham(data: Uint8ClampedArray, pointA: [number, number], pointB: [number, number], width: number, height: number) {
|
|
|
|
// TODO: Adapt the C-implementation at https://de.wikipedia.org/wiki/Bresenham-Algorithmus#C-Implementierung
|
|
}
|