UNPKG

@diffusionstudio/core-v4

Version:

A fast, browser based video compositing engine powered by WebCodecs

137 lines (136 loc) 2.41 kB
import { hex, Percent } from '../types'; import { FontStyle, FontWeight, LineCap, LineJoin } from './types'; /** * Defines the properties of a point */ export interface Point { /** * The x coordinate of the point */ x: number; /** * The y coordinate of the point */ y: number; } export interface RelativePoint { /** * The x coordinate of the point */ x: number | Percent; /** * The y coordinate of the point */ y: number | Percent; } /** * Defines the properties of a rectangle */ export interface Rect extends Partial<Point> { /** * The width of the rectangle */ width: number; /** * The height of the rectangle */ height: number; } /** * Defines the stroke properties that * can be applied to a shape */ export interface Stroke { /** * The color of the stroke */ color?: hex; /** * The width of the stroke */ width?: number; /** * The line cap style to use */ lineCap?: LineCap; /** * The line join style to use */ lineJoin?: LineJoin; /** * The miter limit to use */ miterLimit?: number; /** * The opacity of the stroke */ opacity?: number; } /** * Defines the shadow properties that * can be applied to a shape */ export interface Shadow { /** * The color of the shadow */ color?: hex; /** * The horizontal offset of the shadow */ offsetX?: number; /** * The vertical offset of the shadow */ offsetY?: number; /** * The blur of the shadow */ blur?: number; /** * The opacity of the shadow */ opacity?: number; } /** * Defines the properties of a font */ export interface Font { /** * The size of the font */ size: number; /** * The family of the font */ family: string; /** * The weight of the font */ weight?: FontWeight; /** * The style of the font */ style?: FontStyle; } /** * Defines the properties of a glow */ export interface Glow { /** * The color of the glow */ color?: hex; /** * The radius of the glow */ radius?: number; /** * The intensity of the glow */ intensity?: number; /** * The opacity of the glow */ opacity?: number; }