react-image-mask
Version:
A React component for creating image masks with drawing tools
23 lines • 1.03 kB
TypeScript
/**
* Downloads the current mask as a PNG image file
*
* This utility function processes the mask canvas data and converts it to a
* standard mask format where white pixels represent masked areas and black
* pixels represent background areas. The resulting image is downloaded as
* 'mask.png' to the user's default download location.
*
* @param {HTMLCanvasElement | null} maskCanvas - The canvas element containing the mask data
* @param {number} width - The desired width of the output mask image in pixels
* @param {number} height - The desired height of the output mask image in pixels
*
* @example
* ```typescript
* // Download a mask from a canvas
* const canvas = document.getElementById('maskCanvas') as HTMLCanvasElement;
* downloadMask(canvas, 1024, 768);
* ```
*
* @returns {void} This function doesn't return a value, it triggers a download
*/
export declare const downloadMask: (maskCanvas: HTMLCanvasElement | null, width: number, height: number) => void;
//# sourceMappingURL=downloadMask.d.ts.map