mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 22:22:34 +03:00
bbaf619f63
swc_bundler: - [x] Fix wrapped esms. (denoland/deno#9307) - [x] Make test secure.
30 lines
708 B
TypeScript
30 lines
708 B
TypeScript
// Loaded from https://deno.land/x/deno_image@v0.0.3/lib/decoders/fast-png/index.ts
|
|
|
|
|
|
import PNGDecoder from './PNGDecoder.ts';
|
|
import PNGEncoder from './PNGEncoder.ts';
|
|
import {
|
|
DecoderInputType,
|
|
IPNGDecoderOptions,
|
|
IDecodedPNG,
|
|
IImageData,
|
|
IPNGEncoderOptions,
|
|
} from './types.ts';
|
|
|
|
export * from './types.ts';
|
|
|
|
function decodePNG(
|
|
data: DecoderInputType,
|
|
options?: IPNGDecoderOptions,
|
|
): IDecodedPNG {
|
|
const decoder = new PNGDecoder(data, options);
|
|
return decoder.decode();
|
|
}
|
|
|
|
function encodePNG(png: IImageData, options?: IPNGEncoderOptions): Uint8Array {
|
|
const encoder = new PNGEncoder(png, options);
|
|
return encoder.encode();
|
|
}
|
|
|
|
export { decodePNG as decode, encodePNG as encode };
|