mfx
Version:
In-browser video editing toolkit, with effects accelerated by WebGL
36 lines (35 loc) • 1.49 kB
TypeScript
import { mat4 } from "gl-matrix";
/**
* Helper function to create a matrix with a translation to the specified origin.
* @param origin - The transform origin [x, y, z].
* @returns A mat4 with translation to the origin.
*/
export declare const origin: (origin?: number[]) => [mat4, () => mat4];
/**
* Scale transformation with a specified origin.
* @param factors - Scale factors [scaleX, scaleY, scaleZ].
* @param originPoint - Transform origin [x, y, z].
* @returns A mat4 scaling matrix.
*/
export declare const scale: (factors?: number[], originPoint?: number[]) => mat4;
/**
* Rotate transformation with a specified origin and axis.
* @param angle - Rotation angle in degrees.
* @param axis - Rotation axis [x, y, z]. Example: [1, 0, 0] for X-axis.
* @param originPoint - Transform origin [x, y, z].
* @returns A mat4 rotation matrix.
*/
export declare const rotate: (angle?: number, axis?: number[], originPoint?: number[]) => mat4;
/**
* Translation transformation.
* @param vector - Translation vector [translateX, translateY, translateZ].
* @returns A mat4 translation matrix.
*/
export declare const translate: (vector?: number[]) => mat4;
/**
* Skew transformation with a specified origin.
* @param skewFactors - Skew angles in degrees [skewXY, skewXZ, skewYX, skewYZ, skewZX, skewZY].
* @param originPoint - Transform origin [x, y, z].
* @returns A mat4 skewing matrix.
*/
export declare const skew: (skewFactors?: number[], originPoint?: number[]) => mat4;