@image-marker/web 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +100 -0
- package/api-contract.json +224 -0
- package/lib/commonjs/core/batch.d.ts +32 -0
- package/lib/commonjs/core/batch.js +85 -0
- package/lib/commonjs/core/content-credentials.d.ts +53 -0
- package/lib/commonjs/core/content-credentials.js +96 -0
- package/lib/commonjs/core/image-info.d.ts +30 -0
- package/lib/commonjs/core/image-info.js +348 -0
- package/lib/commonjs/core/index.d.ts +1014 -0
- package/lib/commonjs/core/index.js +92 -0
- package/lib/commonjs/core/invisible-watermark.d.ts +102 -0
- package/lib/commonjs/core/invisible-watermark.js +913 -0
- package/lib/commonjs/core/job.d.ts +57 -0
- package/lib/commonjs/core/job.js +151 -0
- package/lib/commonjs/core/layout.d.ts +19 -0
- package/lib/commonjs/core/layout.js +75 -0
- package/lib/commonjs/core/marker.d.ts +1 -0
- package/lib/commonjs/core/marker.js +11 -0
- package/lib/commonjs/core/recipe.d.ts +44 -0
- package/lib/commonjs/core/recipe.js +175 -0
- package/lib/commonjs/core/result.d.ts +34 -0
- package/lib/commonjs/core/result.js +41 -0
- package/lib/commonjs/core/trace-runtime.d.ts +43 -0
- package/lib/commonjs/core/trace-runtime.js +92 -0
- package/lib/commonjs/core/validate.d.ts +4 -0
- package/lib/commonjs/core/validate.js +192 -0
- package/lib/commonjs/core/web/browser.d.ts +105 -0
- package/lib/commonjs/core/web/browser.js +434 -0
- package/lib/commonjs/core/web/helpers.d.ts +41 -0
- package/lib/commonjs/core/web/helpers.js +264 -0
- package/lib/commonjs/core/web/index.d.ts +59 -0
- package/lib/commonjs/core/web/index.js +724 -0
- package/lib/commonjs/core/web/invisible-worker-client.d.ts +13 -0
- package/lib/commonjs/core/web/invisible-worker-client.js +140 -0
- package/lib/commonjs/core/web/renderer.d.ts +20 -0
- package/lib/commonjs/core/web/renderer.js +665 -0
- package/lib/commonjs/core/web/runtime.d.ts +106 -0
- package/lib/commonjs/core/web/runtime.js +2 -0
- package/lib/commonjs/editor/adapter.d.ts +26 -0
- package/lib/commonjs/editor/adapter.js +102 -0
- package/lib/commonjs/editor/controller.d.ts +106 -0
- package/lib/commonjs/editor/controller.js +919 -0
- package/lib/commonjs/editor/core-contract.d.ts +2 -0
- package/lib/commonjs/editor/core-contract.js +23 -0
- package/lib/commonjs/editor/geometry.d.ts +8 -0
- package/lib/commonjs/editor/geometry.js +109 -0
- package/lib/commonjs/editor/headless.d.ts +5 -0
- package/lib/commonjs/editor/headless.js +22 -0
- package/lib/commonjs/editor/presets.d.ts +19 -0
- package/lib/commonjs/editor/presets.js +64 -0
- package/lib/commonjs/editor/projection.d.ts +12 -0
- package/lib/commonjs/editor/projection.js +195 -0
- package/lib/commonjs/editor/types.d.ts +166 -0
- package/lib/commonjs/editor/types.js +2 -0
- package/lib/commonjs/editor-adapter.d.ts +7 -0
- package/lib/commonjs/editor-adapter.js +17 -0
- package/lib/commonjs/headless.d.ts +2 -0
- package/lib/commonjs/headless.js +26 -0
- package/lib/commonjs/index.d.ts +5 -0
- package/lib/commonjs/index.js +27 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/core/batch.d.ts +32 -0
- package/lib/module/core/batch.js +82 -0
- package/lib/module/core/content-credentials.d.ts +53 -0
- package/lib/module/core/content-credentials.js +92 -0
- package/lib/module/core/image-info.d.ts +30 -0
- package/lib/module/core/image-info.js +343 -0
- package/lib/module/core/index.d.ts +1014 -0
- package/lib/module/core/index.js +56 -0
- package/lib/module/core/invisible-watermark.d.ts +102 -0
- package/lib/module/core/invisible-watermark.js +897 -0
- package/lib/module/core/job.d.ts +57 -0
- package/lib/module/core/job.js +143 -0
- package/lib/module/core/layout.d.ts +19 -0
- package/lib/module/core/layout.js +70 -0
- package/lib/module/core/marker.d.ts +1 -0
- package/lib/module/core/marker.js +4 -0
- package/lib/module/core/recipe.d.ts +44 -0
- package/lib/module/core/recipe.js +169 -0
- package/lib/module/core/result.d.ts +34 -0
- package/lib/module/core/result.js +38 -0
- package/lib/module/core/trace-runtime.d.ts +43 -0
- package/lib/module/core/trace-runtime.js +89 -0
- package/lib/module/core/validate.d.ts +4 -0
- package/lib/module/core/validate.js +187 -0
- package/lib/module/core/web/browser.d.ts +105 -0
- package/lib/module/core/web/browser.js +427 -0
- package/lib/module/core/web/helpers.d.ts +41 -0
- package/lib/module/core/web/helpers.js +251 -0
- package/lib/module/core/web/index.d.ts +59 -0
- package/lib/module/core/web/index.js +709 -0
- package/lib/module/core/web/invisible-worker-client.d.ts +13 -0
- package/lib/module/core/web/invisible-worker-client.js +137 -0
- package/lib/module/core/web/renderer.d.ts +20 -0
- package/lib/module/core/web/renderer.js +661 -0
- package/lib/module/core/web/runtime.d.ts +106 -0
- package/lib/module/core/web/runtime.js +1 -0
- package/lib/module/editor/adapter.d.ts +26 -0
- package/lib/module/editor/adapter.js +99 -0
- package/lib/module/editor/controller.d.ts +106 -0
- package/lib/module/editor/controller.js +915 -0
- package/lib/module/editor/core-contract.d.ts +2 -0
- package/lib/module/editor/core-contract.js +2 -0
- package/lib/module/editor/geometry.d.ts +8 -0
- package/lib/module/editor/geometry.js +103 -0
- package/lib/module/editor/headless.d.ts +5 -0
- package/lib/module/editor/headless.js +4 -0
- package/lib/module/editor/presets.d.ts +19 -0
- package/lib/module/editor/presets.js +57 -0
- package/lib/module/editor/projection.d.ts +12 -0
- package/lib/module/editor/projection.js +188 -0
- package/lib/module/editor/types.d.ts +166 -0
- package/lib/module/editor/types.js +1 -0
- package/lib/module/editor-adapter.d.ts +7 -0
- package/lib/module/editor-adapter.js +10 -0
- package/lib/module/headless.d.ts +2 -0
- package/lib/module/headless.js +2 -0
- package/lib/module/index.d.ts +5 -0
- package/lib/module/index.js +3 -0
- package/lib/module/package.json +1 -0
- package/lib/source-manifest.json +34 -0
- package/lib/worker/invisible-watermark.js +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RotationCanvasMode = exports.ImageFormat = exports.TextBackgroundType = exports.Position = exports.INVISIBLE_WATERMARK_RESIZE_SCALES = exports.INVISIBLE_WATERMARK_MIN_WIDTH = exports.INVISIBLE_WATERMARK_MIN_KEY_BYTES = exports.INVISIBLE_WATERMARK_MIN_HEIGHT = exports.INVISIBLE_WATERMARK_MAX_PAYLOAD_BYTES = exports.INVISIBLE_WATERMARK_ALGORITHM = exports.WatermarkRecipeValidationError = exports.validateWatermarkTemplate = exports.validateWatermarkRecipe = exports.updateWatermarkRecipeLayer = exports.ungroupWatermarkRecipeLayers = exports.serializeWatermarkRecipe = exports.safeValidateWatermarkRecipe = exports.resolveWatermarkTemplate = exports.reorderWatermarkRecipeLayer = exports.removeWatermarkRecipeLayer = exports.recipeValidationPatterns = exports.parseWatermarkRecipe = exports.materializeWatermarkRecipe = exports.groupWatermarkRecipeLayers = exports.duplicateWatermarkRecipeLayer = exports.createWatermarkRecipeDefinition = exports.cloneWatermarkRecipeLayer = exports.cloneWatermarkRecipe = exports.cloneRecipeValue = exports.addWatermarkRecipeLayer = exports.WATERMARK_RECIPE_SCHEMA_VERSION = exports.migrateWatermarkRecipe = exports.ImageMarkerError = exports.parseEncodedImageInfo = void 0;
|
|
7
|
+
const marker_js_1 = __importDefault(require("./marker.js"));
|
|
8
|
+
var image_info_js_1 = require("./image-info.js");
|
|
9
|
+
Object.defineProperty(exports, "parseEncodedImageInfo", { enumerable: true, get: function () { return image_info_js_1.parseEncodedImageInfo; } });
|
|
10
|
+
var job_js_1 = require("./job.js");
|
|
11
|
+
Object.defineProperty(exports, "ImageMarkerError", { enumerable: true, get: function () { return job_js_1.ImageMarkerError; } });
|
|
12
|
+
var recipe_js_1 = require("./recipe.js");
|
|
13
|
+
Object.defineProperty(exports, "migrateWatermarkRecipe", { enumerable: true, get: function () { return recipe_js_1.migrateWatermarkRecipe; } });
|
|
14
|
+
Object.defineProperty(exports, "WATERMARK_RECIPE_SCHEMA_VERSION", { enumerable: true, get: function () { return recipe_js_1.WATERMARK_RECIPE_SCHEMA_VERSION; } });
|
|
15
|
+
var recipe_1 = require("@image-marker/recipe");
|
|
16
|
+
Object.defineProperty(exports, "addWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.addWatermarkRecipeLayer; } });
|
|
17
|
+
Object.defineProperty(exports, "cloneRecipeValue", { enumerable: true, get: function () { return recipe_1.cloneRecipeValue; } });
|
|
18
|
+
Object.defineProperty(exports, "cloneWatermarkRecipe", { enumerable: true, get: function () { return recipe_1.cloneWatermarkRecipe; } });
|
|
19
|
+
Object.defineProperty(exports, "cloneWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.cloneWatermarkRecipeLayer; } });
|
|
20
|
+
Object.defineProperty(exports, "createWatermarkRecipeDefinition", { enumerable: true, get: function () { return recipe_1.createWatermarkRecipeDefinition; } });
|
|
21
|
+
Object.defineProperty(exports, "duplicateWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.duplicateWatermarkRecipeLayer; } });
|
|
22
|
+
Object.defineProperty(exports, "groupWatermarkRecipeLayers", { enumerable: true, get: function () { return recipe_1.groupWatermarkRecipeLayers; } });
|
|
23
|
+
Object.defineProperty(exports, "materializeWatermarkRecipe", { enumerable: true, get: function () { return recipe_1.materializeWatermarkRecipe; } });
|
|
24
|
+
Object.defineProperty(exports, "parseWatermarkRecipe", { enumerable: true, get: function () { return recipe_1.parseWatermarkRecipe; } });
|
|
25
|
+
Object.defineProperty(exports, "recipeValidationPatterns", { enumerable: true, get: function () { return recipe_1.recipeValidationPatterns; } });
|
|
26
|
+
Object.defineProperty(exports, "removeWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.removeWatermarkRecipeLayer; } });
|
|
27
|
+
Object.defineProperty(exports, "reorderWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.reorderWatermarkRecipeLayer; } });
|
|
28
|
+
Object.defineProperty(exports, "resolveWatermarkTemplate", { enumerable: true, get: function () { return recipe_1.resolveWatermarkTemplate; } });
|
|
29
|
+
Object.defineProperty(exports, "safeValidateWatermarkRecipe", { enumerable: true, get: function () { return recipe_1.safeValidateWatermarkRecipe; } });
|
|
30
|
+
Object.defineProperty(exports, "serializeWatermarkRecipe", { enumerable: true, get: function () { return recipe_1.serializeWatermarkRecipe; } });
|
|
31
|
+
Object.defineProperty(exports, "ungroupWatermarkRecipeLayers", { enumerable: true, get: function () { return recipe_1.ungroupWatermarkRecipeLayers; } });
|
|
32
|
+
Object.defineProperty(exports, "updateWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.updateWatermarkRecipeLayer; } });
|
|
33
|
+
Object.defineProperty(exports, "validateWatermarkRecipe", { enumerable: true, get: function () { return recipe_1.validateWatermarkRecipe; } });
|
|
34
|
+
Object.defineProperty(exports, "validateWatermarkTemplate", { enumerable: true, get: function () { return recipe_1.validateWatermarkTemplate; } });
|
|
35
|
+
Object.defineProperty(exports, "WatermarkRecipeValidationError", { enumerable: true, get: function () { return recipe_1.WatermarkRecipeValidationError; } });
|
|
36
|
+
var invisible_watermark_js_1 = require("./invisible-watermark.js");
|
|
37
|
+
Object.defineProperty(exports, "INVISIBLE_WATERMARK_ALGORITHM", { enumerable: true, get: function () { return invisible_watermark_js_1.INVISIBLE_WATERMARK_ALGORITHM; } });
|
|
38
|
+
Object.defineProperty(exports, "INVISIBLE_WATERMARK_MAX_PAYLOAD_BYTES", { enumerable: true, get: function () { return invisible_watermark_js_1.INVISIBLE_WATERMARK_MAX_PAYLOAD_BYTES; } });
|
|
39
|
+
Object.defineProperty(exports, "INVISIBLE_WATERMARK_MIN_HEIGHT", { enumerable: true, get: function () { return invisible_watermark_js_1.INVISIBLE_WATERMARK_MIN_HEIGHT; } });
|
|
40
|
+
Object.defineProperty(exports, "INVISIBLE_WATERMARK_MIN_KEY_BYTES", { enumerable: true, get: function () { return invisible_watermark_js_1.INVISIBLE_WATERMARK_MIN_KEY_BYTES; } });
|
|
41
|
+
Object.defineProperty(exports, "INVISIBLE_WATERMARK_MIN_WIDTH", { enumerable: true, get: function () { return invisible_watermark_js_1.INVISIBLE_WATERMARK_MIN_WIDTH; } });
|
|
42
|
+
Object.defineProperty(exports, "INVISIBLE_WATERMARK_RESIZE_SCALES", { enumerable: true, get: function () { return invisible_watermark_js_1.INVISIBLE_WATERMARK_RESIZE_SCALES; } });
|
|
43
|
+
/**
|
|
44
|
+
* Position enum for text watermark and image watermark
|
|
45
|
+
* @enum
|
|
46
|
+
*/
|
|
47
|
+
var Position;
|
|
48
|
+
(function (Position) {
|
|
49
|
+
Position["topLeft"] = "topLeft";
|
|
50
|
+
Position["topCenter"] = "topCenter";
|
|
51
|
+
Position["topRight"] = "topRight";
|
|
52
|
+
Position["bottomLeft"] = "bottomLeft";
|
|
53
|
+
Position["bottomCenter"] = "bottomCenter";
|
|
54
|
+
Position["bottomRight"] = "bottomRight";
|
|
55
|
+
Position["center"] = "center";
|
|
56
|
+
})(Position || (exports.Position = Position = {}));
|
|
57
|
+
/**
|
|
58
|
+
* TextBackgroundType enum for text watermark
|
|
59
|
+
* @enum
|
|
60
|
+
*/
|
|
61
|
+
var TextBackgroundType;
|
|
62
|
+
(function (TextBackgroundType) {
|
|
63
|
+
TextBackgroundType["stretchX"] = "stretchX";
|
|
64
|
+
TextBackgroundType["stretchY"] = "stretchY";
|
|
65
|
+
TextBackgroundType["none"] = "fit";
|
|
66
|
+
})(TextBackgroundType || (exports.TextBackgroundType = TextBackgroundType = {}));
|
|
67
|
+
/**
|
|
68
|
+
* ImageFormat enum for save image format
|
|
69
|
+
* @enum
|
|
70
|
+
*/
|
|
71
|
+
var ImageFormat;
|
|
72
|
+
(function (ImageFormat) {
|
|
73
|
+
ImageFormat["png"] = "png";
|
|
74
|
+
ImageFormat["jpg"] = "jpg";
|
|
75
|
+
/** WebP output on Android and compatible browsers. iOS rejects it explicitly. */
|
|
76
|
+
ImageFormat["webp"] = "webp";
|
|
77
|
+
// base64 string
|
|
78
|
+
ImageFormat["base64"] = "base64";
|
|
79
|
+
})(ImageFormat || (exports.ImageFormat = ImageFormat = {}));
|
|
80
|
+
/**
|
|
81
|
+
* Controls the output canvas after the composed image is rotated.
|
|
82
|
+
*
|
|
83
|
+
* `expand` preserves the entire rotated image by growing the output canvas.
|
|
84
|
+
* `crop` keeps the original canvas dimensions and clips content outside it.
|
|
85
|
+
* @enum
|
|
86
|
+
*/
|
|
87
|
+
var RotationCanvasMode;
|
|
88
|
+
(function (RotationCanvasMode) {
|
|
89
|
+
RotationCanvasMode["expand"] = "expand";
|
|
90
|
+
RotationCanvasMode["crop"] = "crop";
|
|
91
|
+
})(RotationCanvasMode || (exports.RotationCanvasMode = RotationCanvasMode = {}));
|
|
92
|
+
exports.default = marker_js_1.default;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { ImageFormat } from './index.js';
|
|
2
|
+
export declare const INVISIBLE_WATERMARK_ALGORITHM: "dct-qim-v1";
|
|
3
|
+
export declare const INVISIBLE_WATERMARK_MAX_PAYLOAD_BYTES = 12;
|
|
4
|
+
export declare const INVISIBLE_WATERMARK_MIN_KEY_BYTES = 16;
|
|
5
|
+
export declare const INVISIBLE_WATERMARK_MIN_WIDTH = 128;
|
|
6
|
+
export declare const INVISIBLE_WATERMARK_MIN_HEIGHT = 88;
|
|
7
|
+
export declare const INVISIBLE_WATERMARK_RESIZE_SCALES: readonly [0.95, 1.05, 0.9, 1.1];
|
|
8
|
+
/** Pixel-change strength used by the DCT-QIM invisible watermark. */
|
|
9
|
+
export type InvisibleWatermarkStrength = 'subtle' | 'balanced' | 'robust';
|
|
10
|
+
/** Detection search cost. Robust search also checks light resizing, shifted block grids, and tile phases. */
|
|
11
|
+
export type InvisibleWatermarkSearch = 'fast' | 'robust';
|
|
12
|
+
/** Source image accepted by the invisible watermark APIs. */
|
|
13
|
+
export interface InvisibleWatermarkImage {
|
|
14
|
+
/** Native image asset, URI object, URL/data URL, Blob, File, or loaded browser image. */
|
|
15
|
+
src: any;
|
|
16
|
+
}
|
|
17
|
+
export type InvisibleWatermarkWorkerProgressPhase = 'queued' | 'detecting' | 'complete';
|
|
18
|
+
/** Browser-only dedicated Worker settings for CPU-intensive detection. */
|
|
19
|
+
export interface InvisibleWatermarkWorkerOptions {
|
|
20
|
+
/** Trusted same-origin URL of the packaged invisible watermark worker. */
|
|
21
|
+
scriptUrl: string;
|
|
22
|
+
/** Cancels the current detection and terminates its one-time Worker. */
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
/** Coarse lifecycle updates. Exceptions thrown here are ignored. */
|
|
25
|
+
onProgress?: (progress: {
|
|
26
|
+
phase: InvisibleWatermarkWorkerProgressPhase;
|
|
27
|
+
}) => void;
|
|
28
|
+
}
|
|
29
|
+
/** Options for writing an authenticated short locator into image pixels. */
|
|
30
|
+
export interface EmbedInvisibleWatermarkOptions {
|
|
31
|
+
/** Source image. It must be at least 128×88 pixels after `maxSize` is applied. */
|
|
32
|
+
image: InvisibleWatermarkImage;
|
|
33
|
+
/** Locator containing 1–12 UTF-8 bytes. Do not store personal data directly. */
|
|
34
|
+
payload: string;
|
|
35
|
+
/** Secret containing at least 16 UTF-8 bytes. Do not bundle a production master key. */
|
|
36
|
+
key: string;
|
|
37
|
+
/** Pixel-change strength. Use the same value during detection. @defaultValue `balanced` */
|
|
38
|
+
strength?: InvisibleWatermarkStrength;
|
|
39
|
+
/** JPEG encoder quality from 0–100. */
|
|
40
|
+
quality?: number;
|
|
41
|
+
/** Safe output basename on iOS and Android. */
|
|
42
|
+
filename?: string;
|
|
43
|
+
/** Output encoding. Web returns a data URL; native returns a cache path. */
|
|
44
|
+
saveFormat?: ImageFormat;
|
|
45
|
+
/** Maximum decoded width or height. @defaultValue 2048 */
|
|
46
|
+
maxSize?: number;
|
|
47
|
+
}
|
|
48
|
+
/** Options for recovering and authenticating an invisible trace locator. */
|
|
49
|
+
export interface DetectInvisibleWatermarkOptions {
|
|
50
|
+
/** Image that may contain an invisible trace watermark. */
|
|
51
|
+
image: InvisibleWatermarkImage;
|
|
52
|
+
/** The same secret that was used to embed the locator. */
|
|
53
|
+
key: string;
|
|
54
|
+
/** The same pixel-change strength used during embedding. @defaultValue `balanced` */
|
|
55
|
+
strength?: InvisibleWatermarkStrength;
|
|
56
|
+
/** Use `robust` for 0.9×–1.1× resize and limited crop recovery at a higher CPU cost. @defaultValue `fast` */
|
|
57
|
+
search?: InvisibleWatermarkSearch;
|
|
58
|
+
/** Maximum decoded width or height. Keep this consistent with embedding. @defaultValue 2048 */
|
|
59
|
+
maxSize?: number;
|
|
60
|
+
/** Run pixel detection in a dedicated browser Worker. Ignored on native. */
|
|
61
|
+
worker?: InvisibleWatermarkWorkerOptions;
|
|
62
|
+
}
|
|
63
|
+
/** Authenticated detector payload before a public Core job envelope is added. */
|
|
64
|
+
export interface InvisibleWatermarkDetectionData {
|
|
65
|
+
/** Whether the frame passed magic, CRC, and authentication checks. */
|
|
66
|
+
detected: boolean;
|
|
67
|
+
/** Recovered locator, present only when `detected` is true. */
|
|
68
|
+
payload?: string;
|
|
69
|
+
/** Normalized detector confidence from 0–1. */
|
|
70
|
+
confidence: number;
|
|
71
|
+
/** Disagreement between decoded frame bits and individual block votes. */
|
|
72
|
+
bitErrorRate?: number;
|
|
73
|
+
/** Versioned pixel algorithm identifier. */
|
|
74
|
+
algorithm: typeof INVISIBLE_WATERMARK_ALGORITHM;
|
|
75
|
+
/** Estimated input scale when robust resize recovery was required. */
|
|
76
|
+
scale?: number;
|
|
77
|
+
}
|
|
78
|
+
/** Structured public detection result. A positive result does not prove the image was unmodified. */
|
|
79
|
+
export interface InvisibleWatermarkDetectionResult extends InvisibleWatermarkDetectionData {
|
|
80
|
+
jobId: string;
|
|
81
|
+
operation: 'detectInvisible';
|
|
82
|
+
durationMs: number;
|
|
83
|
+
}
|
|
84
|
+
export interface InvisibleWatermarkPixelBuffer {
|
|
85
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
}
|
|
89
|
+
/** Small dependency-free SHA-256 used to keep Web frame vectors deterministic. */
|
|
90
|
+
export declare function sha256(input: Uint8Array): Uint8Array;
|
|
91
|
+
export declare function hmacSha256(key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
92
|
+
export declare function encodeUtf8(value: string): Uint8Array;
|
|
93
|
+
export declare function decodeUtf8(bytes: Uint8Array): string;
|
|
94
|
+
export declare function crc16Ccitt(bytes: Uint8Array): number;
|
|
95
|
+
export declare function buildInvisibleWatermarkFrame(payload: string, key: string): Uint8Array;
|
|
96
|
+
export declare function createInvisibleWatermarkPermutation(key: string): Uint16Array;
|
|
97
|
+
export declare function validateEmbedInvisibleOptions(options: EmbedInvisibleWatermarkOptions): void;
|
|
98
|
+
export declare function validateDetectInvisibleOptions(options: DetectInvisibleWatermarkOptions): void;
|
|
99
|
+
export declare function embedInvisibleWatermarkPixels(buffer: InvisibleWatermarkPixelBuffer, options: Pick<EmbedInvisibleWatermarkOptions, 'payload' | 'key' | 'strength'>): void;
|
|
100
|
+
export declare function resizeInvisibleWatermarkPixels(buffer: InvisibleWatermarkPixelBuffer, width: number, height: number): InvisibleWatermarkPixelBuffer;
|
|
101
|
+
export declare function detectInvisibleWatermarkPixels(buffer: InvisibleWatermarkPixelBuffer, options: Pick<DetectInvisibleWatermarkOptions, 'key' | 'strength' | 'search'>): InvisibleWatermarkDetectionData;
|
|
102
|
+
export declare function detectInvisibleWatermarkPixelsAsync(buffer: InvisibleWatermarkPixelBuffer, options: Pick<DetectInvisibleWatermarkOptions, 'key' | 'strength' | 'search'>): Promise<InvisibleWatermarkDetectionData>;
|