image-js
Version:
Image processing and manipulation in JavaScript
19 lines • 578 B
JavaScript
/**
* Apply a given transform to a set of points.
* @param points - Points to process.
* @param model - The transformation function.
* @returns The transformed points.
*/
export function applyAffineTransfom(points, model) {
const result = [];
for (const point of points) {
const transformed = model(point);
const roundedPoint = {
row: Math.round(transformed.row),
column: Math.round(transformed.column),
};
result.push(roundedPoint);
}
return result;
}
//# sourceMappingURL=applyAffineTransform.js.map