interface ImageToBlocksResult { blocks: Buffer[]; width: number; height: number; channels: number; blockCountX: number; blockCountY: number; } interface ImageBufferResult { imageBuffer: Buffer; width: number; height: number; } /** * Split an RGBA image buffer into an array of blocks (Node.js Buffer wrapper) * @param buffer Source image buffer (RGBA format) * @param width Image width in pixels * @param height Image height in pixels * @param blockSize Block size in pixels * @returns Array of block buffers */ export declare function splitImageToBlocks(buffer: Buffer, width: number, height: number, blockSize: number): Buffer[]; /** * Reconstruct an RGBA image buffer from an array of blocks (Node.js Buffer wrapper) * @param blocks Array of block buffers * @param width Target image width in pixels * @param height Target image height in pixels * @param blockSize Block size in pixels * @returns Reconstructed image buffer */ export declare function blocksToImageBuffer(blocks: Buffer[], width: number, height: number, blockSize: number): Buffer; /** * Load an image from file or buffer and split into blocks * @param input Path to the image file or Buffer containing image data * @param blockSize Block size in pixels * @returns Promise resolving to block data and image metadata */ export declare function imageToBlocks(input: string | Buffer, blockSize: number): Promise; /** * Load an image and return its raw RGBA buffer and dimensions * @param input Path to the image file or Buffer containing image data * @returns Promise resolving to image buffer and dimensions */ export declare function loadImageBuffer(input: string | Buffer): Promise; /** * Reconstruct a PNG image from blocks * @param blocks Array of block buffers * @param width Target image width in pixels * @param height Target image height in pixels * @param blockSize Block size in pixels * @returns Promise resolving to PNG buffer */ export declare function blocksToPngImage(blocks: Buffer[], width: number, height: number, blockSize: number): Promise; /** * Extract raw RGBA image buffer from a PNG buffer * @param pngBuffer PNG image buffer * @returns Promise resolving to image buffer and image dimensions */ export declare function extractImageBufferFromPng(pngBuffer: Buffer): Promise<{ imageBuffer: Buffer; width: number; height: number; }>; /** * Create a PNG buffer from raw RGBA image buffer * @param imageBuffer Raw RGBA image buffer * @param width Image width in pixels * @param height Image height in pixels * @returns Promise resolving to PNG buffer */ export declare function createPngFromImageBuffer(imageBuffer: Buffer, width: number, height: number): Promise; /** * Apply a function to blocks per image * @param allBlocks - All blocks to process * @param fragmentBlocksCount - Number of blocks per fragment * @param seed - Seed for the processing function * @param processFunc - Function to apply to blocks (shuffle or unshuffle) * @returns Processed blocks */ export declare function blocksPerImage(allBlocks: Buffer[], fragmentBlocksCount: number[], seed: string, processFunc: (blocks: Buffer[], seed: string) => Buffer[]): Buffer[]; export {};