P3 native cinema/clarity/denoise/grain (exportEngine port) verified on Xiaomi (gates pass)
This commit is contained in:
@@ -9,7 +9,10 @@ export interface DecodeEncodeTimings {
|
||||
export interface ColorTimings {
|
||||
decodeMs: number;
|
||||
toneMs?: number;
|
||||
cinemaMs?: number;
|
||||
colorMs: number;
|
||||
clarityMs?: number;
|
||||
grainMs?: number;
|
||||
encodeWriteMs: number;
|
||||
totalMs: number;
|
||||
}
|
||||
@@ -29,22 +32,45 @@ export interface ToneUniforms {
|
||||
sh: number;
|
||||
}
|
||||
|
||||
/** Optional pipeline params passed as a map (native Coroutine arity cap = 8). */
|
||||
export interface PhotoAdjust {
|
||||
/** ToneUniforms from toneShader.ts; default 0/0/0 = skip tone pass. */
|
||||
toneDr?: number;
|
||||
toneHl?: number;
|
||||
toneSh?: number;
|
||||
/** 16 flat floats from cinemaShader.ts getCinemaUniforms(season).flat; null/omitted or flat[0]=0 = skip. */
|
||||
cinema?: number[] | null;
|
||||
/** ColorAdjustments.denoise 0..10 (0 = skip). */
|
||||
denoise?: number;
|
||||
/** ColorAdjustments.clarity -10..10; >0 conv sharpen, <0 mist blur (0 = skip). */
|
||||
clarity?: number;
|
||||
/** ColorAdjustments.grain 0..10 (0 = skip). */
|
||||
grain?: number;
|
||||
/** JPEG quality 0..100; default 95. */
|
||||
quality?: 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>;
|
||||
/**
|
||||
* Decode srcPath, optional crop rect, optional tone pass (DR/highlight/
|
||||
* shadow, port of toneShader.ts), then row-major 4x5 color matrix (translate
|
||||
* column in 0..1 Skia space), JPEG-encode to dstPath. All native, off the
|
||||
* JS/main threads. Stage order mirrors exportEngine: crop -> tone -> matrix.
|
||||
* Native pipeline mirroring exportEngine.ts filter order — decode, optional
|
||||
* center-largest crop, optional tone pass (TONE_SKSL port), optional cinema
|
||||
* seasonal grade (CINEMA_SKSL port), row-major 4x5 color matrix (translate
|
||||
* column in 0..1 Skia space), optional denoise blur / clarity conv / mist
|
||||
* blur / grain Overlay, then JPEG-encode to dstPath. All native, off the
|
||||
* JS/main threads. Stage order mirrors exportEngine: crop -> tone -> cinema
|
||||
* -> matrix -> denoise/clarity -> grain -> encode.
|
||||
*/
|
||||
processPhotoAsync(srcPath: string, dstPath: string, matrix: number[], crop: CropRect | null, tone: ToneUniforms, quality: number): Promise<ColorTimings>;
|
||||
/** P1 alias: matrix + crop, no tone pass. */
|
||||
processPhotoAsync(srcPath: string, dstPath: string, matrix: number[], crop: CropRect | null, adjust?: PhotoAdjust): Promise<ColorTimings>;
|
||||
/** P1 alias: matrix + crop, no tone/cinema/enhance passes. */
|
||||
processColorAsync(srcPath: string, dstPath: string, matrix: number[], crop: CropRect | null, quality: number): Promise<ColorTimings>;
|
||||
/** P0 probe helpers — removed before ship. */
|
||||
ping(): Promise<string>;
|
||||
materializeBenchAsset(assetName: string): Promise<string>;
|
||||
materializeSolidAsset(r: number, g: number, b: number): Promise<string>;
|
||||
materializeRampAsset(): Promise<string>;
|
||||
materializeStepAsset(): Promise<string>;
|
||||
}
|
||||
|
||||
export default requireNativeModule('RecipesCamExport') as RecipescamExportModule;
|
||||
|
||||
Reference in New Issue
Block a user