a8932f52ed
Local Kotlin module modules/recipescam-export (autolinked via expo ./modules) exposes decodeEncodeAsync — BitmapFactory decode -> JPEG q95 encode -> file, all on Dispatchers.IO off the JS/main threads. EXPO_PUBLIC_BENCH=1 builds run src/dev/nativeBenchProbe.ts: 3 timed decode+encode passes on the bundled wallframe artwork plus a JS-timer gap check proving the JS thread never blocks during native rendering. Legacy Skia engine untouched (reference).
15 lines
541 B
TypeScript
15 lines
541 B
TypeScript
import { requireNativeModule } from 'expo-modules-core';
|
|
|
|
export interface DecodeEncodeTimings {
|
|
decodeMs: number;
|
|
encodeWriteMs: number;
|
|
totalMs: number;
|
|
}
|
|
|
|
export interface RecipescamExportModule {
|
|
/** Decode JPEG/PNG at srcPath (plain absolute path), re-encode JPEG q and write dstPath. All native, background. Returns stage timings in ms. */
|
|
decodeEncodeAsync(srcPath: string, dstPath: string, quality: number): Promise<DecodeEncodeTimings>;
|
|
}
|
|
|
|
export default requireNativeModule('RecipesCamExport') as RecipescamExportModule;
|