forked from Blendman974/faceclaw
Terminal feature; raw screenshots.
This commit is contained in:
1 parent
d2a942f5a3
commit
fab6f6689e
19 files changed
+1075
-10
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { Utils } from "@nativescript/core";
|
||||
|
||||
import { type GrayImage } from "../graphics/image";
|
||||
|
||||
declare const com: any;
|
||||
|
||||
/**
|
||||
* Save an image as the raw headerless 576x288 4bpp frame buffer (the exact
|
||||
* bytes the wire compressor sees) for compression experiments. Returns the
|
||||
* absolute path of the written file; retrieve with
|
||||
* adb pull /sdcard/Android/data/com.faceclaw.app/files/screenshots/
|
||||
*/
|
||||
export function saveRawScreenshot(image: GrayImage): string {
|
||||
const context = Utils.android.getApplicationContext();
|
||||
if (!context) throw new Error("Android application context unavailable");
|
||||
return String(
|
||||
com.faceclaw.app.ScreenshotUtil.saveRawScreenshot(
|
||||
context,
|
||||
image.pixels.buffer,
|
||||
image.width,
|
||||
image.height,
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user